This repository has been archived on 2024-06-26. You can view files and clone it, but cannot push or open issues or pull requests.
sakura/migrations/2015_04_12_015057_tenshi_and_profile_fields.php
2016-02-19 22:49:00 +01:00

41 lines
1.3 KiB
PHP

<?php
use Sakura\Migration\IMigration;
use Sakura\DB;
class TenshiAndProfileFields implements IMigration
{
public function up()
{
// Create the profile fields table
DB::prepare("CREATE TABLE `{prefix}profilefields` (
`id` int(64) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_bin NOT NULL,
`formtype` varchar(255) COLLATE utf8_bin NOT NULL,
`description` varchar(255) COLLATE utf8_bin NOT NULL,
`additional` varchar(255) COLLATE utf8_bin NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin")
->execute();
// Create the tenshi table
DB::prepare("CREATE TABLE `{prefix}tenshi` (
`id` bigint(255) unsigned NOT NULL AUTO_INCREMENT,
`uid` bigint(255) unsigned NOT NULL,
`startdate` int(64) unsigned NOT NULL,
`expiredate` int(64) unsigned NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin")
->execute();
}
public function down()
{
// Drop the profile fields table
DB::prepare("DROP TABLE `{prefix}profilefields`")
->execute();
// Drop the tenshi table
DB::prepare("DROP TABLE `{prefix}tenshi`")
->execute();
}
}