Skip to content

Commit

Permalink
EZEE-2988: Provided migration script for scheduled hiding (#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
michal-myszka authored Apr 2, 2020
1 parent fa08a41 commit a99bc5a
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
16 changes: 16 additions & 0 deletions upgrade/db/mysql/ezplatform-2.5.latest-to-3.0.0.sql
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,19 @@ ALTER TABLE `ezeditorialworkflow_markings`
ADD COLUMN `reviewer_id` INT(11),
ADD COLUMN `result` TEXT;
--

-- EZEE-2988: Added availability for schedule hide --
START TRANSACTION;
ALTER TABLE `ezdatebasedpublisher_scheduled_version`
CHANGE COLUMN `publication_date` `action_timestamp` INT(11) NOT NULL;
ALTER TABLE `ezdatebasedpublisher_scheduled_version`
ADD COLUMN `action` VARCHAR(32);
UPDATE `ezdatebasedpublisher_scheduled_version` SET `action` = 'publish';
ALTER TABLE `ezdatebasedpublisher_scheduled_version` CHANGE COLUMN `action` `action` VARCHAR(32) NOT NULL;
COMMIT;
--
ALTER TABLE `ezdatebasedpublisher_scheduled_version`
CHANGE COLUMN `version_id` `version_id` INT NULL ,
CHANGE COLUMN `version_number` `version_number` INT NULL ,
RENAME TO `ezdatebasedpublisher_scheduled_entries`;
--
18 changes: 18 additions & 0 deletions upgrade/db/postgresql/ezplatform-2.5.latest-to-3.0.0.sql
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,21 @@ ALTER TABLE ezeditorialworkflow_markings
ADD COLUMN reviewer_id INTEGER,
ADD COLUMN result TEXT;
--

-- EZEE-2988: Added availability for schedule hide --
START TRANSACTION;
ALTER TABLE ezdatebasedpublisher_scheduled_version RENAME COLUMN publication_date TO action_timestamp;
ALTER TABLE ezdatebasedpublisher_scheduled_version ADD COLUMN action VARCHAR(32);
UPDATE ezdatebasedpublisher_scheduled_version SET action = 'publish';
ALTER TABLE ezdatebasedpublisher_scheduled_version ALTER COLUMN action SET NOT NULL ;
COMMIT;
--
START TRANSACTION;
ALTER TABLE ezdatebasedpublisher_scheduled_version
RENAME TO ezdatebasedpublisher_scheduled_entries;
ALTER TABLE ezdatebasedpublisher_scheduled_entries
ALTER COLUMN version_id DROP NOT NULL;
ALTER TABLE ezdatebasedpublisher_scheduled_entries
ALTER COLUMN version_number DROP NOT NULL;
COMMIT;
--

0 comments on commit a99bc5a

Please sign in to comment.