Commit a4c18dfd authored by Jeremy Kerr's avatar Jeremy Kerr
Browse files

sql: Add uncommitted migration scripts


Signed-off-by: default avatarJeremy Kerr <jk@ozlabs.org>
parent e11f1b02
BEGIN;
ALTER TABLE "patchwork_comment" ADD COLUMN "parent_id" integer NULL;
ALTER TABLE "patchwork_comment" ADD CONSTRAINT parent_id_refs_id_7b721867
FOREIGN KEY ("parent_id")
REFERENCES "patchwork_comment" ("id")
DEFERRABLE INITIALLY DEFERRED;
COMMIT;
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;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment