diff options
Diffstat (limited to 'db/migrations/6.2.1_add_short_urls.php')
| -rw-r--r-- | db/migrations/6.2.1_add_short_urls.php | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/db/migrations/6.2.1_add_short_urls.php b/db/migrations/6.2.1_add_short_urls.php new file mode 100644 index 0000000..2b58734 --- /dev/null +++ b/db/migrations/6.2.1_add_short_urls.php @@ -0,0 +1,33 @@ +<?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 short_urls ( + id int PRIMARY KEY NOT NULL AUTO_INCREMENT, + alias VARCHAR(256) UNIQUE NOT NULL, + path VARCHAR(256) NOT NULL, + user_id VARCHAR(32) NOT NULL, + mkdate INT(11) UNSIGNED NOT NULL, + chdate INT(11) UNSIGNED NOT NULL + )" + ); + } + + + public function down() + { + DBManager::get()->exec("DROP TABLE short_urls"); + } +} |
