aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/db/migrations/1.sql3
-rw-r--r--core/db/migrations/2.sql3
-rw-r--r--core/db/migrations/3.sql6
-rw-r--r--core/db/migrations/4.sql3
-rw-r--r--core/db/migrations/5.sql3
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);