From ddaa59ecff23af6712db92ea9a925154457b045f Mon Sep 17 00:00:00 2001 From: Michael Ziegler Date: Sun, 21 Feb 2010 13:50:38 +0100 Subject: [PATCH] add data conversion scripts for MySQL. --- .../mysql/01-schema-prepare-mumble.sql | 12 ++++++++ .../mysql/11-data-mumble_mumbleserver.sql | 3 ++ .../mysql/12-data-mumble_mumble.sql | 6 ++++ .../mysql/21-schema-cleanup-mumble.sql | 29 +++++++++++++++++++ .../mysql/22-schema-cleanup-mumbleuser.sql | 3 ++ 5 files changed, 53 insertions(+) create mode 100644 pyweb/mumble/conversionsql/mysql/01-schema-prepare-mumble.sql create mode 100644 pyweb/mumble/conversionsql/mysql/11-data-mumble_mumbleserver.sql create mode 100644 pyweb/mumble/conversionsql/mysql/12-data-mumble_mumble.sql create mode 100644 pyweb/mumble/conversionsql/mysql/21-schema-cleanup-mumble.sql create mode 100644 pyweb/mumble/conversionsql/mysql/22-schema-cleanup-mumbleuser.sql diff --git a/pyweb/mumble/conversionsql/mysql/01-schema-prepare-mumble.sql b/pyweb/mumble/conversionsql/mysql/01-schema-prepare-mumble.sql new file mode 100644 index 0000000..0fe8c7d --- /dev/null +++ b/pyweb/mumble/conversionsql/mysql/01-schema-prepare-mumble.sql @@ -0,0 +1,12 @@ +BEGIN; +-- Model: Mumble +ALTER TABLE `mumble_mumble` + ADD `server_id` integer FIRST; +ALTER TABLE `mumble_mumble` + ADD `display` varchar(200) AFTER `name`; +COMMIT; + +BEGIN; +CREATE INDEX `mumble_mumble_server_id_idx` + ON `mumble_mumble` (`server_id`); +COMMIT; diff --git a/pyweb/mumble/conversionsql/mysql/11-data-mumble_mumbleserver.sql b/pyweb/mumble/conversionsql/mysql/11-data-mumble_mumbleserver.sql new file mode 100644 index 0000000..110611e --- /dev/null +++ b/pyweb/mumble/conversionsql/mysql/11-data-mumble_mumbleserver.sql @@ -0,0 +1,3 @@ +INSERT INTO `mumble_mumbleserver` ( `dbus`, `secret` ) +SELECT DISTINCT `dbus`, '' +FROM `mumble_mumble`; diff --git a/pyweb/mumble/conversionsql/mysql/12-data-mumble_mumble.sql b/pyweb/mumble/conversionsql/mysql/12-data-mumble_mumble.sql new file mode 100644 index 0000000..21cd480 --- /dev/null +++ b/pyweb/mumble/conversionsql/mysql/12-data-mumble_mumble.sql @@ -0,0 +1,6 @@ +UPDATE `mumble_mumble` +SET `server_id`=( + SELECT `id` + FROM `mumble_mumbleserver` + WHERE `mumble_mumbleserver`.`dbus` = `mumble_mumble`.`dbus` + ); diff --git a/pyweb/mumble/conversionsql/mysql/21-schema-cleanup-mumble.sql b/pyweb/mumble/conversionsql/mysql/21-schema-cleanup-mumble.sql new file mode 100644 index 0000000..677cded --- /dev/null +++ b/pyweb/mumble/conversionsql/mysql/21-schema-cleanup-mumble.sql @@ -0,0 +1,29 @@ +-- Model: Mumble +ALTER TABLE `mumble_mumble` + DROP COLUMN `dbus`; +ALTER TABLE `mumble_mumble` + DROP COLUMN `url`; +ALTER TABLE `mumble_mumble` + DROP COLUMN `motd`; +ALTER TABLE `mumble_mumble` + DROP COLUMN `passwd`; +ALTER TABLE `mumble_mumble` + DROP COLUMN `supw`; +ALTER TABLE `mumble_mumble` + DROP COLUMN `users`; +ALTER TABLE `mumble_mumble` + DROP COLUMN `bwidth`; +ALTER TABLE `mumble_mumble` + DROP COLUMN `sslcrt`; +ALTER TABLE `mumble_mumble` + DROP COLUMN `sslkey`; +ALTER TABLE `mumble_mumble` + DROP COLUMN `obfsc`; +ALTER TABLE `mumble_mumble` + DROP COLUMN `player`; +ALTER TABLE `mumble_mumble` + DROP COLUMN `channel`; +ALTER TABLE `mumble_mumble` + DROP COLUMN `defchan`; +ALTER TABLE `mumble_mumble` + DROP COLUMN `booted`; diff --git a/pyweb/mumble/conversionsql/mysql/22-schema-cleanup-mumbleuser.sql b/pyweb/mumble/conversionsql/mysql/22-schema-cleanup-mumbleuser.sql new file mode 100644 index 0000000..a4c57c2 --- /dev/null +++ b/pyweb/mumble/conversionsql/mysql/22-schema-cleanup-mumbleuser.sql @@ -0,0 +1,3 @@ +-- Model: MumbleUser +ALTER TABLE `mumble_mumbleuser` + DROP COLUMN `isAdmin`;