Skip to content

Commit

Permalink
EZEE-2176: Fixed fail of the db schema update script when the eznotif…
Browse files Browse the repository at this point in the history
…ication table already exists (ezsystems#2389)
  • Loading branch information
adamwojs authored and Łukasz Serwatka committed Jul 11, 2018
1 parent 11e7a1e commit 0e9ef92
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion data/update/mysql/dbupdate-7.1.0-to-7.2.0.sql
Expand Up @@ -100,7 +100,7 @@ ADD CONSTRAINT `ezcontentbrowsebookmark_user_fk`
-- EZEE-2081: Move NotificationBundle into AdminUI
--

CREATE TABLE `eznotification` (
CREATE TABLE IF NOT EXISTS `eznotification` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`owner_id` int(11) NOT NULL DEFAULT 0,
`is_pending` tinyint(1) NOT NULL DEFAULT '1',
Expand Down
11 changes: 6 additions & 5 deletions data/update/postgres/dbupdate-7.1.0-to-7.2.0.sql
Expand Up @@ -27,19 +27,20 @@ ADD CONSTRAINT ezcontentbrowsebookmark_user_fk
-- EZEE-2081: Move NotificationBundle into AdminUI
--

CREATE TABLE eznotification (
CREATE TABLE IF NOT EXISTS eznotification (
id SERIAL,
owner_id integer DEFAULT 0 NOT NULL ,
is_pending integer DEFAULT 1 NOT NULL,
type character varying(128) NOT NULL,
created integer DEFAULT 0 NOT NULL,
data text
data text,
CONSTRAINT eznotification_pkey PRIMARY KEY (id)
);

ALTER TABLE ONLY eznotification
ADD CONSTRAINT eznotification_pkey PRIMARY KEY (id);

DROP INDEX IF EXISTS eznotification_owner_id;
CREATE INDEX eznotification_owner_id ON eznotification USING btree (owner_id);

DROP INDEX IF EXISTS eznotification_owner_id_is_pending;
CREATE INDEX eznotification_owner_id_is_pending ON eznotification USING btree (owner_id, is_pending);
COMMIT;

Expand Down

0 comments on commit 0e9ef92

Please sign in to comment.