r601 - trunk/faxtomail-service/src/main/resources/db/migration/sqlserver
Author: echatellier Date: 2014-09-03 17:00:34 +0200 (Wed, 03 Sep 2014) New Revision: 601 Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/601 Log: Correction du script de migration pour sql server Modified: trunk/faxtomail-service/src/main/resources/db/migration/sqlserver/V1_0_0_597__mise_a_jour_performances.sql Modified: trunk/faxtomail-service/src/main/resources/db/migration/sqlserver/V1_0_0_597__mise_a_jour_performances.sql =================================================================== --- trunk/faxtomail-service/src/main/resources/db/migration/sqlserver/V1_0_0_597__mise_a_jour_performances.sql 2014-09-03 14:24:11 UTC (rev 600) +++ trunk/faxtomail-service/src/main/resources/db/migration/sqlserver/V1_0_0_597__mise_a_jour_performances.sql 2014-09-03 15:00:34 UTC (rev 601) @@ -1,20 +1,22 @@ -- remove contraints alter table email drop constraint FK_4q69gdpfr96aqig9ephikqxxr; -alter table etatAttente drop constraint UK_e1mte18x0rh5akvjfbi5ljse9; +--sql serveur n'utilise pas le nom donne :( +--alter table etatAttente drop constraint UK_e1mte18x0rh5akvjfbi5ljse9; alter table etatattentes_mailfolder drop constraint FK_3gi1yi1o932oe5t8ikcnsd3ef; alter table etatattentes_mailfolder drop constraint FK_hsynjnyke7heuntkxkks9voxy; alter table history_fields drop constraint FK_qoup2jo9smmju8hgou9sq5108; -DROP INDEX idx_MailFolder_etatAttentes; -DROP INDEX email_etatAttente_idx; +DROP INDEX etatattentes_mailfolder.idx_MailFolder_etatAttentes; +DROP INDEX email.email_etatAttente_idx; GO -- renommage etat attente -ALTER TABLE email RENAME etatAttente TO waitingState; -ALTER TABLE etatAttente RENAME TO waitingState; -ALTER TABLE etatattentes_mailfolder RENAME TO mailfolder_waitingstates; -ALTER TABLE mailfolder_waitingstates RENAME etatAttentes TO waitingStates; -ALTER TABLE mailFolder RENAME useCurrentLevelEtatAttente TO useCurrentLevelWaitingState; +EXEC sp_rename 'etatAttente', 'waitingState'; +EXEC sp_rename 'etatattentes_mailfolder', 'mailfolder_waitingstates'; GO +EXEC sp_rename 'email.etatAttente', 'waitingState', 'COLUMN'; +EXEC sp_rename 'mailfolder_waitingstates.etatAttentes', 'waitingStates', 'COLUMN'; +EXEC sp_rename 'mailFolder.useCurrentLevelEtatAttente', 'useCurrentLevelWaitingState', 'COLUMN'; +GO -- migration des topia id update waitingState set topiaId = replace(topiaId, 'EtatAttente', 'WaitingState'); @@ -27,7 +29,8 @@ update DemandType set requiredFields = replace(requiredFields, 'ETAT_ATTENTE', 'WAITING_STATE') where requiredFields is not null; -- restore constraints -alter table waitingState add constraint UK_ccllv66h9tle79mgklh1kpicn unique (label); +--sql serveur n'utilise pas le nom donne :( +--alter table waitingState add constraint UK_ccllv66h9tle79mgklh1kpicn unique (label); alter table email add constraint FK_nfplqi5mxyfuxgkpe3rb83put foreign key (waitingState) @@ -46,8 +49,8 @@ -- Reply delete from reply; -ALTER TABLE reply ALTER sentDate SET NOT NULL; -ALTER TABLE reply ALTER subject SET NOT NULL; +ALTER TABLE reply ALTER COLUMN sentDate datetime2 NOT NULL; +ALTER TABLE reply ALTER COLUMN subject varchar(MAX) NOT NULL; ALTER TABLE reply ADD sender varchar(MAX) not null; ALTER TABLE reply ADD recipient varchar(MAX) not null; ALTER TABLE reply ADD replyContent varchar(255) not null;
participants (1)
-
echatellier@users.forge.codelutin.com