From a4c18dfd4492e61c4025c378a68a0d3511308b89 Mon Sep 17 00:00:00 2001
From: Jeremy Kerr <jk@ozlabs.org>
Date: Tue, 10 Aug 2010 11:22:01 +0800
Subject: sql: Add uncommitted migration scripts

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
---
 .../006-maintainer-project-attributes.sql          | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 lib/sql/migration/006-maintainer-project-attributes.sql

(limited to 'lib/sql/migration/006-maintainer-project-attributes.sql')

diff --git a/lib/sql/migration/006-maintainer-project-attributes.sql b/lib/sql/migration/006-maintainer-project-attributes.sql
new file mode 100644
index 0000000..86b82e1
--- /dev/null
+++ b/lib/sql/migration/006-maintainer-project-attributes.sql
@@ -0,0 +1,22 @@
+BEGIN;
+
+CREATE TABLE "patchwork_projectmaintainer" (                                    
+    "id" serial NOT NULL PRIMARY KEY,
+    "project_id" integer NOT NULL
+        REFERENCES "patchwork_project" ("id") DEFERRABLE INITIALLY DEFERRED,
+    "user_id" integer NOT NULL
+        REFERENCES "auth_user" ("id") DEFERRABLE INITIALLY DEFERRED,
+    "master" boolean NOT NULL
+);
+
+INSERT INTO patchwork_projectmaintainer
+    (project_id, user_id, master)
+    SELECT project_id, patchwork_userprofile.user_id, False
+        FROM patchwork_userprofile_maintainer_projects
+        INNER JOIN patchwork_userprofile
+            ON patchwork_userprofile.id =
+                patchwork_userprofile_maintainer_projects.userprofile_id;
+
+--DROP TABLE patchwork_userprofile_maintainer_projects;
+
+COMMIT;
-- 
cgit v1.2.3

