diff --git a/src/sql/base.sql b/src/sql/base.sql index 4211301..34c5507 100644 --- a/src/sql/base.sql +++ b/src/sql/base.sql @@ -1,5 +1,3 @@ -SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; -SET AUTOCOMMIT = 0; START TRANSACTION; -- -------------------------------------------------------- diff --git a/src/sql/migrations/down/0000.sql b/src/sql/migrations/down/0000.sql index f0b9d6d..848c101 100644 --- a/src/sql/migrations/down/0000.sql +++ b/src/sql/migrations/down/0000.sql @@ -1,3 +1,5 @@ -ALTER TABLE `server` DROP `language`; - +BEGIN; ALTER TABLE `profile` DROP `language`; + +ALTER TABLE `server` DROP `language`; +COMMIT; diff --git a/src/sql/migrations/down/0002.sql b/src/sql/migrations/down/0002.sql index 14ec73d..7b6113e 100644 --- a/src/sql/migrations/down/0002.sql +++ b/src/sql/migrations/down/0002.sql @@ -1,3 +1,5 @@ -ALTER table `profile` DROP KEY `language` (`language`); +BEGIN; +ALTER table `profile` DROP KEY `language`; -ALTER table `server` DROP KEY `language` (`language`); +ALTER table `server` DROP KEY `language`; +COMMIT; diff --git a/src/sql/migrations/up/0001.sql b/src/sql/migrations/up/0001.sql index edec795..cddf66e 100644 --- a/src/sql/migrations/up/0001.sql +++ b/src/sql/migrations/up/0001.sql @@ -1,3 +1,5 @@ -ALTER TABLE `server` ADD `language` VARCHAR(30) NULL AFTER `name`; - +BEGIN; ALTER TABLE `profile` ADD `language` VARCHAR(30) NULL AFTER `account_type`; + +ALTER TABLE `server` ADD `language` VARCHAR(30) NULL AFTER `name`; +COMMIT; diff --git a/src/sql/migrations/up/0002.sql b/src/sql/migrations/up/0002.sql index 85dc9ed..252cf08 100644 --- a/src/sql/migrations/up/0002.sql +++ b/src/sql/migrations/up/0002.sql @@ -1,2 +1,4 @@ +BEGIN; ALTER table `profile` DROP INDEX `profile-ft`; ALTER table `profile` ADD FULLTEXT KEY `profile-ft` (`name`, `pdesc`, `profile_url`, `locality`, `region`, `country`, `tags`); +COMMIT; diff --git a/src/sql/migrations/up/0003.sql b/src/sql/migrations/up/0003.sql index f42e7f1..e4c07e9 100644 --- a/src/sql/migrations/up/0003.sql +++ b/src/sql/migrations/up/0003.sql @@ -1,3 +1,5 @@ +BEGIN; ALTER table `profile` ADD KEY `language` (`language`); ALTER table `server` ADD KEY `language` (`language`); +COMMIT;