From fd2047d302e4ba1bfe7686c085d8fbecc730fe37 Mon Sep 17 00:00:00 2001 From: Michael Ziegler Date: Sun, 21 Feb 2010 17:48:33 +0100 Subject: [PATCH] rename a few of the sqlite conversion scripts, add MumbleUser table being recreated, drop old tables instead of keeping them. --- ...chema-mumble-server_id.sql => 01-schema-mumble.sql} | 0 .../conversionsql/sqlite/02-schema-mumbleuser.sql | 10 ++++++++++ ...umble_mumbleserver.sql => 11-data-mumbleserver.sql} | 0 .../{12-data-mumble_mumble.sql => 12-data-mumble.sql} | 2 +- .../mumble/conversionsql/sqlite/13-data-mumbleuser.sql | 9 +++++++++ .../conversionsql/sqlite/21-remove-old-mumble.sql | 1 + .../conversionsql/sqlite/21-rename-old-table.sql | 1 - ...2-rename-new-table.sql => 22-rename-new-mumble.sql} | 0 .../conversionsql/sqlite/23-remove-old-mumbleuser.sql | 1 + .../conversionsql/sqlite/24-rename-new-mumbleuser.sql | 1 + 10 files changed, 23 insertions(+), 2 deletions(-) rename pyweb/mumble/conversionsql/sqlite/{01-schema-mumble-server_id.sql => 01-schema-mumble.sql} (100%) create mode 100644 pyweb/mumble/conversionsql/sqlite/02-schema-mumbleuser.sql rename pyweb/mumble/conversionsql/sqlite/{11-data-mumble_mumbleserver.sql => 11-data-mumbleserver.sql} (100%) rename pyweb/mumble/conversionsql/sqlite/{12-data-mumble_mumble.sql => 12-data-mumble.sql} (80%) create mode 100644 pyweb/mumble/conversionsql/sqlite/13-data-mumbleuser.sql create mode 100644 pyweb/mumble/conversionsql/sqlite/21-remove-old-mumble.sql delete mode 100644 pyweb/mumble/conversionsql/sqlite/21-rename-old-table.sql rename pyweb/mumble/conversionsql/sqlite/{22-rename-new-table.sql => 22-rename-new-mumble.sql} (100%) create mode 100644 pyweb/mumble/conversionsql/sqlite/23-remove-old-mumbleuser.sql create mode 100644 pyweb/mumble/conversionsql/sqlite/24-rename-new-mumbleuser.sql diff --git a/pyweb/mumble/conversionsql/sqlite/01-schema-mumble-server_id.sql b/pyweb/mumble/conversionsql/sqlite/01-schema-mumble.sql similarity index 100% rename from pyweb/mumble/conversionsql/sqlite/01-schema-mumble-server_id.sql rename to pyweb/mumble/conversionsql/sqlite/01-schema-mumble.sql diff --git a/pyweb/mumble/conversionsql/sqlite/02-schema-mumbleuser.sql b/pyweb/mumble/conversionsql/sqlite/02-schema-mumbleuser.sql new file mode 100644 index 0000000..bbf1455 --- /dev/null +++ b/pyweb/mumble/conversionsql/sqlite/02-schema-mumbleuser.sql @@ -0,0 +1,10 @@ +CREATE TABLE "mumble_mumbleuser_new" ( + "id" integer NOT NULL PRIMARY KEY, + "mumbleid" integer NOT NULL, + "name" varchar(200) NOT NULL, + "password" varchar(200) NOT NULL, + "server_id" integer NOT NULL REFERENCES "mumble_mumble" ("id"), + "owner_id" integer REFERENCES "auth_user" ("id"), + UNIQUE ("server_id", "owner_id"), + UNIQUE ("server_id", "mumbleid") +); diff --git a/pyweb/mumble/conversionsql/sqlite/11-data-mumble_mumbleserver.sql b/pyweb/mumble/conversionsql/sqlite/11-data-mumbleserver.sql similarity index 100% rename from pyweb/mumble/conversionsql/sqlite/11-data-mumble_mumbleserver.sql rename to pyweb/mumble/conversionsql/sqlite/11-data-mumbleserver.sql diff --git a/pyweb/mumble/conversionsql/sqlite/12-data-mumble_mumble.sql b/pyweb/mumble/conversionsql/sqlite/12-data-mumble.sql similarity index 80% rename from pyweb/mumble/conversionsql/sqlite/12-data-mumble_mumble.sql rename to pyweb/mumble/conversionsql/sqlite/12-data-mumble.sql index b7ca79b..24dcd7b 100644 --- a/pyweb/mumble/conversionsql/sqlite/12-data-mumble_mumble.sql +++ b/pyweb/mumble/conversionsql/sqlite/12-data-mumble.sql @@ -8,4 +8,4 @@ SELECT "mumble_mumble"."port", '' FROM "mumble_mumble" INNER JOIN "mumble_mumbleserver" -WHERE "mumble_mumbleserver"."dbus" = "mumble_mumble"."dbus" +WHERE "mumble_mumbleserver"."dbus" = "mumble_mumble"."dbus"; diff --git a/pyweb/mumble/conversionsql/sqlite/13-data-mumbleuser.sql b/pyweb/mumble/conversionsql/sqlite/13-data-mumbleuser.sql new file mode 100644 index 0000000..f2eff3e --- /dev/null +++ b/pyweb/mumble/conversionsql/sqlite/13-data-mumbleuser.sql @@ -0,0 +1,9 @@ +INSERT INTO "mumble_mumbleuser_new" +SELECT + "id", + "mumbleid", + "name", + "password", + "server_id", + "owner_id" +FROM "mumble_mumbleuser"; diff --git a/pyweb/mumble/conversionsql/sqlite/21-remove-old-mumble.sql b/pyweb/mumble/conversionsql/sqlite/21-remove-old-mumble.sql new file mode 100644 index 0000000..9065ed9 --- /dev/null +++ b/pyweb/mumble/conversionsql/sqlite/21-remove-old-mumble.sql @@ -0,0 +1 @@ +DROP TABLE "mumble_mumble"; diff --git a/pyweb/mumble/conversionsql/sqlite/21-rename-old-table.sql b/pyweb/mumble/conversionsql/sqlite/21-rename-old-table.sql deleted file mode 100644 index 75775db..0000000 --- a/pyweb/mumble/conversionsql/sqlite/21-rename-old-table.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE "mumble_mumble" RENAME TO "mumble_mumble_old"; diff --git a/pyweb/mumble/conversionsql/sqlite/22-rename-new-table.sql b/pyweb/mumble/conversionsql/sqlite/22-rename-new-mumble.sql similarity index 100% rename from pyweb/mumble/conversionsql/sqlite/22-rename-new-table.sql rename to pyweb/mumble/conversionsql/sqlite/22-rename-new-mumble.sql diff --git a/pyweb/mumble/conversionsql/sqlite/23-remove-old-mumbleuser.sql b/pyweb/mumble/conversionsql/sqlite/23-remove-old-mumbleuser.sql new file mode 100644 index 0000000..2ac2610 --- /dev/null +++ b/pyweb/mumble/conversionsql/sqlite/23-remove-old-mumbleuser.sql @@ -0,0 +1 @@ +DROP TABLE "mumble_mumbleuser"; diff --git a/pyweb/mumble/conversionsql/sqlite/24-rename-new-mumbleuser.sql b/pyweb/mumble/conversionsql/sqlite/24-rename-new-mumbleuser.sql new file mode 100644 index 0000000..ebfc5d5 --- /dev/null +++ b/pyweb/mumble/conversionsql/sqlite/24-rename-new-mumbleuser.sql @@ -0,0 +1 @@ +ALTER TABLE "mumble_mumbleuser_new" RENAME TO "mumble_mumbleuser";