1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 01:08:50 +02:00

Allow databases to be created outside upgrade_schema scrpt.

Summary:
Current scripts make it hard to administer Phabricator instance while not having
direct (priviledged) access to the database.  This change allows scenario where
DB administrator creates the databases for you before you run update_schema
script.

Test Plan:
Create the databases before running the update_schema script - it shouldn't
complain that the databases already exist.

Reviewers: aran, epriestley

Reviewed By: epriestley

CC: aran, epriestley

Differential Revision: 1014
This commit is contained in:
Marek Sapota 2011-10-17 13:28:23 -07:00
parent 9030f489cf
commit cb0700a99c
8 changed files with 14 additions and 14 deletions

View file

@ -1,4 +1,4 @@
CREATE DATABASE phabricator_herald;
CREATE DATABASE IF NOT EXISTS phabricator_herald;
CREATE TABLE phabricator_herald.herald_action (
id int unsigned not null auto_increment primary key,
@ -41,4 +41,4 @@ CREATE TABLE phabricator_herald.herald_transcript (
conditionTranscripts longblob not null,
applyTranscripts longblob not null,
unique key (phid)
);
);

View file

@ -1,4 +1,4 @@
CREATE DATABASE phabricator_owners;
CREATE DATABASE IF NOT EXISTS phabricator_owners;
CREATE TABLE phabricator_owners.owners_package (
id int unsigned not null auto_increment primary key,
@ -24,4 +24,4 @@ CREATE TABLE phabricator_owners.owners_path (
key(packageID),
repositoryPHID varchar(64) binary not null,
path varchar(255) not null
);
);

View file

@ -1,4 +1,4 @@
CREATE DATABASE phabricator_xhpastview;
CREATE DATABASE IF NOT EXISTS phabricator_xhpastview;
CREATE TABLE phabricator_xhpastview.xhpastview_parsetree (
id int unsigned not null auto_increment primary key,
authorPHID varchar(64) binary,
@ -6,4 +6,4 @@ CREATE TABLE phabricator_xhpastview.xhpastview_parsetree (
stdout longblob not null,
dateCreated int unsigned not null,
dateModified int unsigned not null
);
);

View file

@ -1,4 +1,4 @@
CREATE DATABASE phabricator_pastebin;
CREATE DATABASE IF NOT EXISTS phabricator_pastebin;
CREATE TABLE phabricator_pastebin.pastebin_paste (
id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
@ -14,4 +14,4 @@ INSERT INTO phabricator_directory.directory_item
(name, description, href, categoryID, sequence, dateCreated, dateModified)
VALUES
("Paste", "Mmm... tasty, delicious paste.", "/paste/", 5, 150,
UNIX_TIMESTAMP(), UNIX_TIMESTAMP());
UNIX_TIMESTAMP(), UNIX_TIMESTAMP());

View file

@ -1,4 +1,4 @@
CREATE DATABASE phabricator_countdown;
CREATE DATABASE IF NOT EXISTS phabricator_countdown;
CREATE TABLE phabricator_countdown.countdown_timer (
id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,

View file

@ -1,4 +1,4 @@
CREATE DATABASE phabricator_feed;
CREATE DATABASE IF NOT EXISTS phabricator_feed;
CREATE TABLE phabricator_feed.feed_storydata (
id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,

View file

@ -1,4 +1,4 @@
CREATE DATABASE phabricator_slowvote;
CREATE DATABASE IF NOT EXISTS phabricator_slowvote;
CREATE TABLE phabricator_slowvote.slowvote_poll (
id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
@ -47,4 +47,4 @@ INSERT INTO phabricator_directory.directory_item
(name, description, href, categoryID, sequence, dateCreated, dateModified)
VALUES
("Slowvote", "Design by committee.", "/vote/", 5, 250,
UNIX_TIMESTAMP(), UNIX_TIMESTAMP());
UNIX_TIMESTAMP(), UNIX_TIMESTAMP());

View file

@ -1,4 +1,4 @@
CREATE DATABASE phabricator_phriction;
CREATE DATABASE IF NOT EXISTS phabricator_phriction;
CREATE TABLE phabricator_phriction.phriction_document (
id INT UNSIGNED NOT NULL,
@ -9,4 +9,4 @@ CREATE TABLE phabricator_phriction.phriction_document (
depth INT UNSIGNED NOT NULL,
UNIQUE KEY (depth, slug),
contentID INT UNSIGNED NOT NULL
) ENGINE=InnoDB;
) ENGINE=InnoDB;