summaryrefslogtreecommitdiffstats
path: root/gerrit-war/src/main/webapp/WEB-INF/sql/upgrade014_015_part1_postgres.sql
diff options
context:
space:
mode:
Diffstat (limited to 'gerrit-war/src/main/webapp/WEB-INF/sql/upgrade014_015_part1_postgres.sql')
-rw-r--r--gerrit-war/src/main/webapp/WEB-INF/sql/upgrade014_015_part1_postgres.sql38
1 files changed, 38 insertions, 0 deletions
diff --git a/gerrit-war/src/main/webapp/WEB-INF/sql/upgrade014_015_part1_postgres.sql b/gerrit-war/src/main/webapp/WEB-INF/sql/upgrade014_015_part1_postgres.sql
new file mode 100644
index 0000000000..0c56f4139b
--- /dev/null
+++ b/gerrit-war/src/main/webapp/WEB-INF/sql/upgrade014_015_part1_postgres.sql
@@ -0,0 +1,38 @@
+-- Upgrade: schema_version 14 to 15
+--
+ALTER TABLE patch_comments ADD parent_uuid VARCHAR(40);
+
+CREATE TABLE account_patch_reviews
+(account_id INTEGER NOT NULL DEFAULT(0),
+change_id INTEGER NOT NULL DEFAULT(0),
+patch_set_id INTEGER NOT NULL DEFAULT(0),
+file_name VARCHAR(255) NOT NULL DEFAULT(''),
+PRIMARY KEY (account_id, change_id, patch_set_id, file_name)
+);
+
+ALTER TABLE account_patch_reviews OWNER TO gerrit2;
+
+INSERT INTO approval_categories
+(name, position, function_name, category_id)
+VALUES
+('Owner', -1, 'NoOp', 'OWN');
+
+INSERT INTO approval_category_values
+(category_id, value, name)
+VALUES
+('OWN', 1, 'Administer All Settings');
+
+INSERT INTO project_rights
+(project_id, category_id, group_id, min_value, max_value)
+SELECT p.project_id, 'OWN', p.owner_group_id, 1, 1
+FROM projects p
+WHERE p.project_id <> 0;
+
+DROP INDEX projects_ownedByGroup;
+DROP INDEX project_rights_byCat;
+DROP INDEX project_rights_byGroup;
+
+CREATE INDEX project_rights_byCatGroup
+ON project_rights (category_id, group_id);
+
+UPDATE schema_version SET version_nbr = 15;