diff options
author | Thomas Lange <code@nerdmind.de> | 2021-06-17 22:00:39 +0200 |
---|---|---|
committer | Thomas Lange <code@nerdmind.de> | 2021-06-17 22:00:39 +0200 |
commit | 5555624546ea48d6327700f32b80848e0662dc90 (patch) | |
tree | 47d61fb756a6cb008aaf33586d292fcfe43da2a1 /core/db/migrations | |
parent | 91d8a28c664afa5378735bcd0efe068dd74d589f (diff) | |
parent | 0a2614cb69fc732c2115ef2f0c356f39f602d311 (diff) | |
download | blog-5555624546ea48d6327700f32b80848e0662dc90.tar.gz blog-5555624546ea48d6327700f32b80848e0662dc90.tar.xz blog-5555624546ea48d6327700f32b80848e0662dc90.zip |
Merge branch 'master' into 'optimization'optimization
Diffstat (limited to 'core/db/migrations')
-rw-r--r-- | core/db/migrations/1.sql | 3 | ||||
-rw-r--r-- | core/db/migrations/2.sql | 3 | ||||
-rw-r--r-- | core/db/migrations/3.sql | 6 | ||||
-rw-r--r-- | core/db/migrations/4.sql | 3 | ||||
-rw-r--r-- | core/db/migrations/5.sql | 3 |
5 files changed, 18 insertions, 0 deletions
diff --git a/core/db/migrations/1.sql b/core/db/migrations/1.sql new file mode 100644 index 0000000..a875d13 --- /dev/null +++ b/core/db/migrations/1.sql @@ -0,0 +1,3 @@ +ALTER TABLE `page` ADD `argv` VARCHAR(100) NULL DEFAULT NULL AFTER `body`; +ALTER TABLE `post` ADD `argv` VARCHAR(100) NULL DEFAULT NULL AFTER `body`; +ALTER TABLE `user` ADD `argv` VARCHAR(100) NULL DEFAULT NULL AFTER `body`; diff --git a/core/db/migrations/2.sql b/core/db/migrations/2.sql new file mode 100644 index 0000000..525b768 --- /dev/null +++ b/core/db/migrations/2.sql @@ -0,0 +1,3 @@ +ALTER TABLE `page` ADD UNIQUE KEY `time_insert` (`time_insert`); +ALTER TABLE `post` ADD UNIQUE KEY `time_insert` (`time_insert`); +ALTER TABLE `user` ADD UNIQUE KEY `time_insert` (`time_insert`); diff --git a/core/db/migrations/3.sql b/core/db/migrations/3.sql new file mode 100644 index 0000000..ae46ed0 --- /dev/null +++ b/core/db/migrations/3.sql @@ -0,0 +1,6 @@ +ALTER TABLE `post` ENGINE=InnoDB; +ALTER TABLE `post` DROP INDEX `body`; +ALTER TABLE `page` ADD FULLTEXT KEY `search` (`name`, `body`); +ALTER TABLE `post` ADD FULLTEXT KEY `search` (`name`, `body`); +ALTER TABLE `post` ADD CONSTRAINT `post_user` FOREIGN KEY (`user`) + REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; diff --git a/core/db/migrations/4.sql b/core/db/migrations/4.sql new file mode 100644 index 0000000..4a26c48 --- /dev/null +++ b/core/db/migrations/4.sql @@ -0,0 +1,3 @@ +ALTER TABLE `page` MODIFY `argv` VARCHAR(250); +ALTER TABLE `post` MODIFY `argv` VARCHAR(250); +ALTER TABLE `user` MODIFY `argv` VARCHAR(250); diff --git a/core/db/migrations/5.sql b/core/db/migrations/5.sql new file mode 100644 index 0000000..a3c8e5a --- /dev/null +++ b/core/db/migrations/5.sql @@ -0,0 +1,3 @@ +CREATE TABLE `migration` (`schema_version` smallint(4) NOT NULL) + ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +INSERT INTO `migration` (`schema_version`) VALUES (5); |