]> git.agnieray.net Git - galette.git/commitdiff
Fix schema updates
authorJohan Cwiklinski <johan@x-tnd.be>
Fri, 7 May 2021 07:07:33 +0000 (09:07 +0200)
committerJohan Cwiklinski <johan@x-tnd.be>
Sat, 8 May 2021 09:28:19 +0000 (11:28 +0200)
Table should has been dropped

Drop if exists

galette/install/scripts/sql/upgrade-to-0.70-mysql.sql
galette/install/scripts/upgrade-to-0.62-pgsql.sql
galette/install/scripts/upgrade-to-0.63-mysql.sql
galette/install/scripts/upgrade-to-0.63-pgsql.sql
galette/install/scripts/upgrade-to-0.91-pgsql.sql
galette/install/scripts/upgrade-to-0.95-mysql.sql
galette/install/scripts/upgrade-to-0.95-pgsql.sql

index 6f54f9eb8e6fbcc023d5d96f0543c28a73412847..53f32ee605f0e8749c443ee7cc2c990f744c48b0 100644 (file)
@@ -60,7 +60,12 @@ ALTER TABLE `galette_adherents` CHANGE `activite_adh` `activite_adh` TINYINT( 1
 ALTER TABLE `galette_adherents` CHANGE `bool_admin_adh` `bool_admin_adh` TINYINT( 1 ) NOT NULL DEFAULT 0;
 ALTER TABLE `galette_adherents` CHANGE `bool_exempt_adh` `bool_exempt_adh` TINYINT( 1 ) NOT NULL DEFAULT 0;
 ALTER TABLE `galette_adherents` CHANGE `bool_display_info` `bool_display_info` TINYINT( 1 ) NOT NULL DEFAULT 0;
-ALTER TABLE `galette_types_cotisation` CHANGE `cotis_extension` `cotis_extension` TINYINT( 1 ) NOT NULL DEFAULT 0;
+
+ALTER TABLE `galette_types_cotisation` ADD `_cotis_extension` TINYINT(1) NOT NULL DEFAULT 0 AFTER `cotis_extension`;
+UPDATE `galette_types_cotisation` SET _cotis_extension=1 WHERE cotis_extension IS NOT NULL;
+ALTER TABLE `galette_types_cotisation` DROP `cotis_extension`;
+ALTER TABLE `galette_types_cotisation` CHANGE `_cotis_extension` `cotis_extension` TINYINT(1) NOT NULL DEFAULT 0;
+
 ALTER TABLE `galette_field_types` CHANGE `field_required` `field_required` TINYINT( 1 ) NOT NULL DEFAULT 0;
 
 -- New table for fields categories
index 0d2a77ef1d204314fa1cfb2fcfbcf192f4c6b3f7..f4590b5bf6528890c445c84e442df4d2e7231476 100644 (file)
@@ -1,12 +1,12 @@
-DROP SEQUENCE galette_preferences_id_seq;
+DROP SEQUENCE IF EXISTS galette_preferences_id_seq;
 CREATE SEQUENCE galette_preferences_id_seq
     START 1
     INCREMENT 1
     MAXVALUE 2147483647
     MINVALUE 1
     CACHE 1;
-               
-DROP TABLE galette_preferences;
+
+DROP TABLE IF EXISTS galette_preferences;
 CREATE TABLE galette_preferences (
   id_pref integer DEFAULT nextval('galette_preferences_id_seq'::text) NOT NULL,
   nom_pref character varying(100) DEFAULT '' NOT NULL,
index 274e4107c830fd291416d3bc6c02e256cbc7acda..316160a001514563ceda1b9c3dad2b4c22b24557 100644 (file)
@@ -1,5 +1,9 @@
 ALTER TABLE galette_adherents ADD pref_lang varchar(20) default 'french' AFTER date_echeance;
-INSERT INTO galette_types_cotisation VALUES (7, 'Cotisation annuelle (à payer)');
+ALTER TABLE galette_adherents ADD lieu_naissance varchar(20) default '';
+ALTER TABLE galette_adherents ADD gpgid varchar(8);
+ALTER TABLE galette_adherents ADD fingerprint varchar(50);
+
+INSERT INTO galette_types_cotisation VALUES (7, 'Cotisation annuelle (a payer)');
 ALTER TABLE galette_adherents ADD  UNIQUE (login_adh);
 ALTER TABLE `galette_adherents` CHANGE `mdp_adh` `mdp_adh` VARCHAR(40);
 
@@ -13,7 +17,7 @@ INSERT INTO galette_preferences (nom_pref, val_pref) VALUES ('pref_beg_membershi
 INSERT INTO galette_preferences (nom_pref, val_pref) VALUES ('pref_email_reply_to', '');
 
 -- New tables for dynamic fields;
-DROP TABLE galette_field_types;
+DROP TABLE IF EXISTS galette_field_types;
 CREATE TABLE galette_field_types (
     field_id int(10) unsigned NOT NULL auto_increment,
     field_form varchar(10) NOT NULL,
@@ -32,7 +36,7 @@ CREATE TABLE galette_field_types (
     INDEX (field_form)
 ) ENGINE=MyISAM;
 
-DROP TABLE galette_dynamic_fields;
+DROP TABLE IF EXISTS galette_dynamic_fields;
 CREATE TABLE galette_dynamic_fields (
     item_id int(10) NOT NULL default '0',
     field_id int(10) NOT NULL default '0',
@@ -72,7 +76,7 @@ UPDATE galette_types_cotisation SET cotis_extension='1' WHERE
     id_type_cotis <= 3 OR id_type_cotis = 7;
 
 -- Table for dynamic translation of strings;
-DROP TABLE galette_l10n;
+DROP TABLE IF EXISTS galette_l10n;
 CREATE TABLE galette_l10n (
     text_orig varchar(40) NOT NULL,
     text_locale varchar(15) NOT NULL,
@@ -82,7 +86,7 @@ CREATE TABLE galette_l10n (
 ) ENGINE=MyISAM;
 
 -- Table for transactions;
-DROP TABLE galette_transactions;
+DROP TABLE IF EXISTS galette_transactions;
 CREATE TABLE galette_transactions (
   trans_id int(10) unsigned NOT NULL auto_increment,
   trans_date date NOT NULL default '0000-00-00',
index c44dfbb83dd53134cf6161e9e853e32984a0b8c7..9264a7fa50509fd091bc15bcae7f020f4d90f02d 100644 (file)
@@ -22,7 +22,7 @@ CREATE TABLE galette_pictures (
 );
 
 -- stephs ;
-INSERT INTO galette_types_cotisation VALUES (7, 'Cotisation annuelle (à payer)');
+INSERT INTO galette_types_cotisation VALUES (7, 'Cotisation annuelle (a payer)');
 CREATE UNIQUE INDEX galette_adherents_idx ON galette_adherents (id_adh);
 CREATE UNIQUE INDEX galette_login_idx     ON galette_adherents (login_adh);
 CREATE UNIQUE INDEX galette_cotisations_idx ON galette_cotisations (id_cotis);
@@ -39,13 +39,13 @@ CREATE UNIQUE INDEX galette_preferences_idx ON galette_preferences (id_pref);
 INSERT INTO galette_preferences(nom_pref, val_pref) VALUES ('pref_pays', '-');
 INSERT INTO galette_preferences(nom_pref, val_pref) VALUES ('pref_website', '');
 INSERT INTO galette_preferences(nom_pref, val_pref) VALUES ('pref_mail_method', '0');
-INSERT INTO galette_preferences(nom_pref, val_pref) VALUES ('pref_mail_smtp', '0'); 
+INSERT INTO galette_preferences(nom_pref, val_pref) VALUES ('pref_mail_smtp', '0');
 INSERT INTO galette_preferences(nom_pref, val_pref) VALUES ('pref_membership_ext', '12');
 INSERT INTO galette_preferences(nom_pref, val_pref) VALUES ('pref_beg_membership', '');
 INSERT INTO galette_preferences(nom_pref, val_pref) VALUES ('pref_email_reply_to', '');
 
 -- New tables for dynamic fields;
-DROP SEQUENCE galette_field_types_id_seq;
+DROP SEQUENCE IF EXISTS galette_field_types_id_seq;
 CREATE SEQUENCE galette_field_types_id_seq
     START 1
     INCREMENT 1
@@ -53,7 +53,7 @@ CREATE SEQUENCE galette_field_types_id_seq
     MINVALUE 1
     CACHE 1;
 
-DROP TABLE galette_field_types;
+DROP TABLE IF EXISTS galette_field_types;
 CREATE TABLE galette_field_types (
   field_id integer DEFAULT nextval('galette_field_types_id_seq'::text) NOT NULL,
   field_form character varying(10) NOT NULL,
@@ -72,7 +72,7 @@ CREATE TABLE galette_field_types (
 CREATE UNIQUE INDEX galette_field_types_idx ON galette_field_types (field_id);
 CREATE INDEX galette_field_types_form_idx ON galette_field_types (field_form);
 
-DROP TABLE galette_dynamic_fields;
+DROP TABLE IF EXISTS galette_dynamic_fields;
 CREATE TABLE galette_dynamic_fields (
   item_id integer DEFAULT '0' NOT NULL,
   field_id integer DEFAULT '0' NOT NULL,
@@ -110,7 +110,7 @@ UPDATE galette_types_cotisation SET cotis_extension=1 WHERE
     id_type_cotis <= 3 OR id_type_cotis = 7;
 
 -- Table for dynamic translation of strings;
-DROP TABLE galette_l10n;
+DROP TABLE IF EXISTS galette_l10n;
 CREATE TABLE galette_l10n (
   text_orig character varying(40) NOT NULL,
   text_locale character varying(15) NOT NULL,
@@ -120,7 +120,7 @@ CREATE TABLE galette_l10n (
 CREATE UNIQUE INDEX galette_l10n_idx ON galette_l10n (text_orig, text_locale);
 
 -- Table for transactions;
-DROP SEQUENCE galette_transactions_id_seq;
+DROP SEQUENCE IF EXISTS galette_transactions_id_seq;
 CREATE SEQUENCE galette_transactions_id_seq
     START 1
     INCREMENT 1
@@ -128,7 +128,7 @@ CREATE SEQUENCE galette_transactions_id_seq
     MINVALUE 1
     CACHE 1;
 
-DROP TABLE galette_transactions;
+DROP TABLE IF EXISTS galette_transactions;
 CREATE TABLE galette_transactions (
     trans_id integer DEFAULT nextval('galette_transactions_id_seq'::text)  NOT NULL,
     trans_date date DEFAULT '19010101' NOT NULL,
@@ -142,7 +142,7 @@ ALTER TABLE galette_cotisations ADD trans_id integer;
 ALTER TABLE galette_cotisations ALTER COLUMN trans_id SET DEFAULT NULL;
 
 -- new table for temporary passwords  2006-02-18;
-DROP TABLE galette_tmppasswds;
+DROP TABLE IF EXISTS galette_tmppasswds;
 CREATE TABLE galette_tmppasswds (
     id_adh integer NOT NULL,
     tmp_passwd character varying(40) NOT NULL,
index e64cafc4077fca95f3d3900756d1de8f0222f217..96db2a50f95b9d6cbdb5ad01143f7a464396560a 100644 (file)
@@ -12,6 +12,6 @@ ALTER TABLE galette_adherents ALTER COLUMN gpgid TYPE text;
 DELETE FROM galette_dynamic_fields WHERE item_id = 0;
 
 -- Detailled log history has ben dropped
-UPDATE galette_preferences SET val_pref = 1 WHERE nom_pref = 'pref_log' AND val_pref = 2;
+UPDATE galette_preferences SET val_pref = 1 WHERE nom_pref = 'pref_log' AND val_pref = '2';
 
 UPDATE galette_database SET version = 0.91;
index 0b33263cc40af8c07a5130e76c63d9d711526444..a46059e34c9158ac2bdab47dc0e4c68e5bb94955 100644 (file)
@@ -42,4 +42,6 @@ ALTER TABLE galette_pdfmodels CHANGE model_subtitle model_subtitle varchar(250);
 
 ALTER TABLE galette_tmplinks CHANGE hash hash varchar(250) NOT NULL;
 
+DROP TABLE IF EXISTS galette_required;
+
 UPDATE galette_database SET version = 0.950;
index e01b1696752120cfc6b34ab811a1b79ccd06772d..0e4d022115cdacc063dd39d7e756ce7af1935277 100644 (file)
@@ -40,6 +40,8 @@ ALTER TABLE galette_groups ALTER COLUMN group_name TYPE varchar(250);
 ALTER TABLE galette_pdfmodels ALTER COLUMN model_title TYPE varchar(250);
 ALTER TABLE galette_pdfmodels ALTER COLUMN model_subtitle TYPE varchar(250);
 
-ALTER TABLE galette_tmplinks ALTER COLUMN hash hash varchar(250);
+ALTER TABLE galette_tmplinks ALTER COLUMN hash TYPE varchar(250);
+
+DROP TABLE IF EXISTS galette_required;
 
 UPDATE galette_database SET version = 0.950;