aboutsummaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
Diffstat (limited to 'db')
-rw-r--r--db/migrations/6.2.3_add_short_urls.php34
1 files changed, 34 insertions, 0 deletions
diff --git a/db/migrations/6.2.3_add_short_urls.php b/db/migrations/6.2.3_add_short_urls.php
new file mode 100644
index 0000000..eea9548
--- /dev/null
+++ b/db/migrations/6.2.3_add_short_urls.php
@@ -0,0 +1,34 @@
+<?php
+
+/**
+ * Description of class.
+ * Second line
+ */
+final class AddShortUrls extends Migration
+{
+ public function description()
+ {
+ return 'Adds the short_urls table.';
+ }
+
+ public function up()
+ {
+ DBManager::get()->exec(
+ "CREATE TABLE IF NOT EXISTS short_urls (
+ id INT PRIMARY KEY NOT NULL AUTO_INCREMENT,
+ alias VARCHAR(255) UNIQUE NOT NULL,
+ path VARCHAR(255) NOT NULL,
+ title VARCHAR(255) NOT NULL,
+ user_id VARCHAR(32) COLLATE latin1_bin NOT NULL,
+ mkdate INT(11) UNSIGNED NOT NULL,
+ chdate INT(11) UNSIGNED NOT NULL
+ )"
+ );
+ }
+
+
+ public function down()
+ {
+ DBManager::get()->exec("DROP TABLE short_urls");
+ }
+}