Skip to content

Commit

Permalink
EZP-24898: Fixed update scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
lolautruche committed Oct 5, 2015
1 parent 23482d3 commit ec0a30b
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
10 changes: 10 additions & 0 deletions data/update/mysql/unstable/dbupdate-5.4.0-to-6.0.0alpha7.sql
@@ -0,0 +1,10 @@
--
-- The `ezrole` table has changed. `version` has been added to the primary key, after the `id`. This is because role
-- drafts are now handled differently. A draft now has the same `id` as the published role, and `version` decides which
-- is which. You should make sure you don't have any role drafts in the database when upgrading. To find drafts, select
-- entries in the `ezrole` table where `version` is not zero. Before this change, the `version` of a draft equals the
-- `id` of the role. The safe way to get rid of stray role drafts is to edit the role in question, and then cancel
-- editing.
--

ALTER TABLE ezrole DROP PRIMARY KEY, ADD PRIMARY KEY(id,version);
@@ -0,0 +1,6 @@
--
-- The `ezrole` table was switched back to its original state
-- (only one PRIMARY KEY being ID column)
--

ALTER TABLE ezrole DROP PRIMARY KEY, ADD PRIMARY KEY(id);
10 changes: 10 additions & 0 deletions data/update/postgres/unstable/dbupdate-5.4.0-to-6.0.0alpha7.sql
@@ -0,0 +1,10 @@
--
-- The `ezrole` table has changed. `version` has been added to the primary key, after the `id`. This is because role
-- drafts are now handled differently. A draft now has the same `id` as the published role, and `version` decides which
-- is which. You should make sure you don't have any role drafts in the database when upgrading. To find drafts, select
-- entries in the `ezrole` table where `version` is not zero. Before this change, the `version` of a draft equals the
-- `id` of the role. The safe way to get rid of stray role drafts is to edit the role in question, and then cancel
-- editing.
--

ALTER TABLE ezrole DROP CONSTRAINT ezrole_pkey, ADD CONSTRAINT ezrole_pkey PRIMARY KEY (id,version);
@@ -0,0 +1,6 @@
--
-- The `ezrole` table was switched back to its original state
-- (only one PRIMARY KEY being ID column)
--

ALTER TABLE ezrole DROP CONSTRAINT ezrole_pkey, ADD CONSTRAINT ezrole_pkey PRIMARY KEY (id);

0 comments on commit ec0a30b

Please sign in to comment.