Skip to content

Commit

Permalink
[scripts] Add missing "if not exists" to sqls
Browse files Browse the repository at this point in the history
  • Loading branch information
xiez committed Jul 22, 2014
1 parent 2eedccd commit 9c76fc9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion scripts/upgrade/sql/3.1.0/mysql/seahub.sql
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ alter table share_uploadlinkshare add column password varchar(128);
alter table share_uploadlinkshare add column expire_date datetime;
alter table profile_profile add column lang_code varchar(50) DEFAULT NULL;

CREATE TABLE `share_orgfileshare` (
CREATE TABLE IF NOT EXISTS `share_orgfileshare` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`org_id` int(11) NOT NULL,
`file_share_id` int(11) NOT NULL,
Expand Down
5 changes: 3 additions & 2 deletions scripts/upgrade/sql/3.1.0/sqlite3/seahub.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ alter table "share_uploadlinkshare" add column "password" varchar(128);
alter table "share_uploadlinkshare" add column "expire_date" datetime;
alter table "profile_profile" add column "lang_code" varchar(50);

CREATE TABLE "share_orgfileshare" (
CREATE TABLE IF NOT EXISTS "share_orgfileshare" (
"id" integer NOT NULL PRIMARY KEY,
"org_id" integer NOT NULL,
"file_share_id" integer NOT NULL UNIQUE REFERENCES "share_fileshare" ("id")
);
CREATE INDEX "share_orgfileshare_944dadb6" ON "share_orgfileshare" ("org_id");
CREATE INDEX IF NOT EXISTS "share_orgfileshare_944dadb6" ON "share_orgfileshare" ("org_id");

0 comments on commit 9c76fc9

Please sign in to comment.