From 2f8a9456b4d104497b99033a23121f19dea042cc Mon Sep 17 00:00:00 2001 From: flashwave Date: Tue, 23 Feb 2016 15:44:36 +0100 Subject: [PATCH] can't be fucked to do this --- libraries/Migration/IMigration.php | 27 --- .../2015_03_08_104200_initial_structure.php | 185 ------------------ ...2015_04_01_172649_info_pages_and_nulls.php | 48 ----- ...15_04_06_200332_rename_groups_to_ranks.php | 32 --- ...04_12_015057_tenshi_and_profile_fields.php | 41 ---- migrations/2015_04_19_125809_action_codes.php | 27 --- ...5_04_27_003820_add_profile_field_types.php | 28 --- .../2015_05_05_061836_faq_forum_and_socks.php | 110 ----------- .../2015_05_08_174736_notifications_table.php | 38 ---- .../2015_05_24_143425_bread_of_the_future.php | 14 -- 10 files changed, 550 deletions(-) delete mode 100644 libraries/Migration/IMigration.php delete mode 100644 migrations/2015_03_08_104200_initial_structure.php delete mode 100644 migrations/2015_04_01_172649_info_pages_and_nulls.php delete mode 100644 migrations/2015_04_06_200332_rename_groups_to_ranks.php delete mode 100644 migrations/2015_04_12_015057_tenshi_and_profile_fields.php delete mode 100644 migrations/2015_04_19_125809_action_codes.php delete mode 100644 migrations/2015_04_27_003820_add_profile_field_types.php delete mode 100644 migrations/2015_05_05_061836_faq_forum_and_socks.php delete mode 100644 migrations/2015_05_08_174736_notifications_table.php delete mode 100644 migrations/2015_05_24_143425_bread_of_the_future.php diff --git a/libraries/Migration/IMigration.php b/libraries/Migration/IMigration.php deleted file mode 100644 index a6d2efb..0000000 --- a/libraries/Migration/IMigration.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ -interface IMigration -{ - /** - * Upgrade the database to a newer version. - */ - public function up(); - - /** - * Downgrade the database to an older version. - */ - public function down(); -} diff --git a/migrations/2015_03_08_104200_initial_structure.php b/migrations/2015_03_08_104200_initial_structure.php deleted file mode 100644 index 9934540..0000000 --- a/migrations/2015_03_08_104200_initial_structure.php +++ /dev/null @@ -1,185 +0,0 @@ -execute(); - - // Create bans table - DB::prepare("CREATE TABLE `{prefix}bans` ( - `id` bigint(128) unsigned NOT NULL AUTO_INCREMENT, - `uid` bigint(128) unsigned NOT NULL, - `ip` varchar(255) COLLATE utf8_bin NOT NULL, - `type` tinyint(1) unsigned NOT NULL, - `timestamp` int(64) unsigned NOT NULL, - `bannedtill` int(64) unsigned NOT NULL, - `modid` bigint(128) unsigned NOT NULL, - `modip` varchar(255) COLLATE utf8_bin NOT NULL, - `reason` varchar(255) COLLATE utf8_bin DEFAULT NULL, - PRIMARY KEY (`id`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin") - ->execute(); - - // Create config table - DB::prepare("CREATE TABLE `{prefix}config` ( - `config_name` varchar(255) COLLATE utf8_bin NOT NULL, - `config_value` varchar(255) COLLATE utf8_bin NOT NULL - ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin") - ->execute(); - - // Create groups table - DB::prepare("CREATE TABLE `{prefix}groups` ( - `id` bigint(128) unsigned NOT NULL AUTO_INCREMENT, - `groupname` varchar(255) COLLATE utf8_bin NOT NULL, - `colour` varchar(255) COLLATE utf8_bin NOT NULL, - `description` text COLLATE utf8_bin NOT NULL', - PRIMARY KEY (`id`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin") - ->execute(); - - // Create messages table - DB::prepare("CREATE TABLE `{prefix}messages` ( - `id` bigint(128) unsigned NOT NULL AUTO_INCREMENT, - `fromUser` bigint(128) unsigned NOT NULL, - `toUsers` varchar(255) COLLATE utf8_bin NOT NULL, - `readBy` varchar(255) COLLATE utf8_bin NOT NULL, - `deletedBy` varchar(255) COLLATE utf8_bin NOT NULL, - `date` int(64) unsigned NOT NULL, - `title` varchar(255) COLLATE utf8_bin NOT NULL, - `content` text COLLATE utf8_bin NOT NULL, - PRIMARY KEY (`id`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin") - ->execute(); - - // Create news table - DB::prepare("CREATE TABLE `{prefix}news` ( - `id` bigint(128) unsigned NOT NULL AUTO_INCREMENT, - `uid` bigint(128) unsigned NOT NULL, - `date` int(64) unsigned NOT NULL, - `title` varchar(255) COLLATE utf8_bin NOT NULL, - `content` text COLLATE utf8_bin NOT NULL, - PRIMARY KEY (`id`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin") - ->execute(); - - // Create registration codes table - DB::prepare("CREATE TABLE `{prefix}regcodes` ( - `id` bigint(128) unsigned NOT NULL AUTO_INCREMENT, - `code` varchar(32) COLLATE utf8_bin NOT NULL, - `created_by` bigint(128) unsigned NOT NULL, - `used_by` bigint(128) unsigned NOT NULL, - `key_used` tinyint(1) unsigned NOT NULL, - PRIMARY KEY (`id`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin") - ->execute(); - - // Create sessions table - DB::prepare("CREATE TABLE `{prefix}sessions` ( - `id` bigint(128) unsigned NOT NULL AUTO_INCREMENT, - `userip` varchar(255) COLLATE utf8_bin NOT NULL, - `useragent` varchar(255) COLLATE utf8_bin DEFAULT NULL, - `userid` bigint(128) unsigned NOT NULL, - `skey` varchar(255) COLLATE utf8_bin NOT NULL, - `started` int(64) unsigned NOT NULL, - `expire` int(64) unsigned NOT NULL, - PRIMARY KEY (`id`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin") - ->execute(); - - // Create users table - DB::prepare("CREATE TABLE `{prefix}users` ( - `id` bigint(255) unsigned NOT NULL AUTO_INCREMENT, - `username` varchar(255) COLLATE utf8_bin NOT NULL, - `username_clean` varchar(255) COLLATE utf8_bin NOT NULL, - `password_hash` varchar(255) COLLATE utf8_bin NOT NULL, - `password_salt` varchar(255) COLLATE utf8_bin NOT NULL, - `password_algo` varchar(255) COLLATE utf8_bin NOT NULL, - `password_iter` int(16) unsigned NOT NULL, - `password_chan` int(16) unsigned NOT NULL, - `password_new` varchar(255) COLLATE utf8_bin DEFAULT NULL, - `email` varchar(32) COLLATE utf8_bin NOT NULL, - `group_main` mediumint(4) unsigned NOT NULL, - `groups` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT '0', - `name_colour` varchar(255) COLLATE utf8_bin DEFAULT NULL DEFAULT '[0]', - `register_ip` varchar(16) COLLATE utf8_bin NOT NULL, - `last_ip` varchar(16) COLLATE utf8_bin NOT NULL, - `usertitle` varchar(64) COLLATE utf8_bin NOT NULL, - `profile_md` text COLLATE utf8_bin, - `avatar_url` varchar(255) COLLATE utf8_bin NOT NULL, - `background_url` varchar(255) COLLATE utf8_bin NOT NULL, - `regdate` int(16) unsigned NOT NULL DEFAULT '0', - `lastdate` int(16) unsigned NOT NULL DEFAULT '0', - `lastunamechange` int(16) unsigned NOT NULL DEFAULT '0', - `birthday` varchar(16) COLLATE utf8_bin DEFAULT NULL, - `profile_data` text COLLATE utf8_bin NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `username_clean` (`username_clean`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin") - ->execute(); - - // Create warnings table - DB::prepare("CREATE TABLE `{prefix}warnings` ( - `id` bigint(128) unsigned NOT NULL AUTO_INCREMENT, - `uid` bigint(128) unsigned NOT NULL, - `mod` bigint(128) unsigned NOT NULL, - `issued` int(64) unsigned NOT NULL, - `expire` int(64) unsigned NOT NULL, - `reason` varchar(255) COLLATE utf8_bin DEFAULT NULL COMMENT 'Reason for the warning.', - PRIMARY KEY (`id`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin") - ->execute(); - } - - public function down() - { - // Drop API keys table - DB::prepare("DROP TABLE `{prefix}apikeys`") - ->execute(); - - // Drop bans table - DB::prepare("DROP TABLE `{prefix}bans`") - ->execute(); - - // Drop config table - DB::prepare("DROP TABLE `{prefix}config`") - ->execute(); - - // Drop groups table - DB::prepare("DROP TABLE `{prefix}groups`") - ->execute(); - - // Drop messages table - DB::prepare("DROP TABLE `{prefix}messages`") - ->execute(); - - // Drop news table - DB::prepare("DROP TABLE `{prefix}news`") - ->execute(); - - // Drop registration codes table - DB::prepare("DROP TABLE `{prefix}regcodes`") - ->execute(); - - // Drop sessions table - DB::prepare("DROP TABLE `{prefix}sessions`") - ->execute(); - - // Drop users table - DB::prepare("DROP TABLE `{prefix}users`") - ->execute(); - - // Drop warnings table - DB::prepare("DROP TABLE `{prefix}warnings`") - ->execute(); - } -} diff --git a/migrations/2015_04_01_172649_info_pages_and_nulls.php b/migrations/2015_04_01_172649_info_pages_and_nulls.php deleted file mode 100644 index 66ace20..0000000 --- a/migrations/2015_04_01_172649_info_pages_and_nulls.php +++ /dev/null @@ -1,48 +0,0 @@ -execute(); - - // Create info pages table - DB::prepare("CREATE TABLE `{prefix}infopages` ( - `shorthand` varchar(255) COLLATE utf8_bin NOT NULL, - `pagetitle` varchar(255) COLLATE utf8_bin NOT NULL, - `content` text COLLATE utf8_bin NOT NULL - ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin") - ->execute(); - - // Make certain fields in the users table nullable - DB::prepare('ALTER TABLE `{prefix}users` MODIFY `usertitle` DEFAULT NULL') - ->execute(); - DB::prepare('ALTER TABLE `{prefix}users` MODIFY `avatar_url` DEFAULT NULL') - ->execute(); - DB::prepare('ALTER TABLE `{prefix}users` MODIFY `background_url` DEFAULT NULL') - ->execute(); - } - - public function down() - { - // Drop the multi column from the groups table - DB::prepare("ALTER TABLE `{prefix}groups` DROP COLUMN `multi`") - ->execute(); - - // Drop info pages table - DB::prepare("DROP TABLE `{prefix}infopages`") - ->execute(); - - // Revert the null - DB::prepare('ALTER TABLE `{prefix}users` MODIFY `usertitle` NOT NULL') - ->execute(); - DB::prepare('ALTER TABLE `{prefix}users` MODIFY `avatar_url` NOT NULL') - ->execute(); - DB::prepare('ALTER TABLE `{prefix}users` MODIFY `background_url` NOT NULL') - ->execute(); - } -} diff --git a/migrations/2015_04_06_200332_rename_groups_to_ranks.php b/migrations/2015_04_06_200332_rename_groups_to_ranks.php deleted file mode 100644 index 4217e08..0000000 --- a/migrations/2015_04_06_200332_rename_groups_to_ranks.php +++ /dev/null @@ -1,32 +0,0 @@ -execute(); - - // Rename group* columns to rank* in the users table - DB::prepare('ALTER TABLE `{prefix}users` CHANGE `group_main` `rank_main` mediumint(4)') - ->execute(); - DB::prepare('ALTER TABLE `{prefix}users` CHANGE `groups` `ranks` varchar(255)') - ->execute(); - } - - public function down() - { - // Rename ranks table to groups - DB::prepare("RENAME TABLE `{prefix}ranks` TO `{prefix}groups`") - ->execute(); - - // Rename rank* columns to group* in the users table - DB::prepare('ALTER TABLE `{prefix}users` CHANGE `rank_main` `group_main` mediumint(4)') - ->execute(); - DB::prepare('ALTER TABLE `{prefix}users` CHANGE `ranks` `groups` varchar(255)') - ->execute(); - } -} diff --git a/migrations/2015_04_12_015057_tenshi_and_profile_fields.php b/migrations/2015_04_12_015057_tenshi_and_profile_fields.php deleted file mode 100644 index 6d6dfda..0000000 --- a/migrations/2015_04_12_015057_tenshi_and_profile_fields.php +++ /dev/null @@ -1,41 +0,0 @@ -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(); - } -} diff --git a/migrations/2015_04_19_125809_action_codes.php b/migrations/2015_04_19_125809_action_codes.php deleted file mode 100644 index 41cc150..0000000 --- a/migrations/2015_04_19_125809_action_codes.php +++ /dev/null @@ -1,27 +0,0 @@ -execute(); - } - - public function down() - { - // Drop the profile fields table - DB::prepare("DROP TABLE `{prefix}actioncodes`") - ->execute(); - } -} diff --git a/migrations/2015_04_27_003820_add_profile_field_types.php b/migrations/2015_04_27_003820_add_profile_field_types.php deleted file mode 100644 index 1275ae7..0000000 --- a/migrations/2015_04_27_003820_add_profile_field_types.php +++ /dev/null @@ -1,28 +0,0 @@ -execute(); - - // Add linkformat - DB::prepare("ALTER TABLE `{prefix}profilefields` ADD `linkformat` varchar(255) COLLATE utf8_bin NOT NULL") - ->execute(); - } - - public function down() - { - // Drop islink - DB::prepare("ALTER TABLE `{prefix}profilefields` DROP COLUMN `islink`") - ->execute(); - - // Drop linkformat - DB::prepare("ALTER TABLE `{prefix}profilefields` DROP COLUMN `linkformat`") - ->execute(); - } -} diff --git a/migrations/2015_05_05_061836_faq_forum_and_socks.php b/migrations/2015_05_05_061836_faq_forum_and_socks.php deleted file mode 100644 index c0f4256..0000000 --- a/migrations/2015_05_05_061836_faq_forum_and_socks.php +++ /dev/null @@ -1,110 +0,0 @@ -execute(); - - // Add forums table - DB::prepare("CREATE TABLE `{prefix}forums` ( - `forum_id` bigint(255) unsigned NOT NULL AUTO_INCREMENT, - `forum_name` varchar(255) COLLATE utf8_bin NOT NULL, - `forum_desc` text COLLATE utf8_bin NOT NULL, - `forum_link` varchar(255) COLLATE utf8_bin NOT NULL, - `forum_category` bigint(255) unsigned NOT NULL DEFAULT '0', - `forum_type` tinyint(4) unsigned NOT NULL DEFAULT '0', - `forum_posts` bigint(128) unsigned NOT NULL DEFAULT '0', - `forum_topics` bigint(255) unsigned NOT NULL DEFAULT '0', - `forum_last_post_id` bigint(255) unsigned NOT NULL DEFAULT '0', - `forum_last_poster_id` bigint(255) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`forum_id`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin") - ->execute(); - - // Add posts table - DB::prepare("CREATE TABLE `{prefix}posts` ( - `post_id` bigint(255) unsigned NOT NULL AUTO_INCREMENT, - `topic_id` bigint(255) unsigned NOT NULL DEFAULT '0', - `forum_id` bigint(255) unsigned NOT NULL DEFAULT '0', - `poster_id` bigint(255) unsigned NOT NULL DEFAULT '0', - `poster_ip` varchar(40) COLLATE utf8_bin NOT NULL, - `post_time` int(11) unsigned NOT NULL DEFAULT '0', - `enable_markdown` tinyint(1) unsigned NOT NULL DEFAULT '1', - `enable_sig` tinyint(1) unsigned NOT NULL DEFAULT '1', - `post_subject` varchar(255) COLLATE utf8_bin NOT NULL, - `post_text` text COLLATE utf8_bin NOT NULL, - `post_edit_time` int(11) unsigned NOT NULL DEFAULT '0', - `post_edit_reason` varchar(255) COLLATE utf8_bin NOT NULL, - `post_edit_user` int(255) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`post_id`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin") - ->execute(); - - // Add sock_perms table - DB::prepare("CREATE TABLE `{prefix}sock_perms` ( - `rid` bigint(128) unsigned NOT NULL DEFAULT '0', - `uid` bigint(255) unsigned NOT NULL DEFAULT '0', - `perms` varchar(128) COLLATE utf8_bin NOT NULL DEFAULT '1,0,0,0,0,0' - ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin") - ->execute(); - - // Add topics table - DB::prepare("CREATE TABLE `{prefix}topics` ( - `topic_id` bigint(255) unsigned NOT NULL AUTO_INCREMENT, - `forum_id` bigint(255) unsigned NOT NULL DEFAULT '0', - `topic_hidden` tinyint(1) unsigned NOT NULL DEFAULT '0', - `topic_title` varchar(255) COLLATE utf8_bin NOT NULL, - `topic_time` int(11) unsigned NOT NULL DEFAULT '0', - `topic_time_limit` int(11) unsigned NOT NULL DEFAULT '0', - `topic_last_reply` int(11) unsigned NOT NULL DEFAULT '0', - `topic_views` bigint(64) unsigned NOT NULL DEFAULT '0', - `topic_replies` bigint(128) unsigned NOT NULL DEFAULT '0', - `topic_status` tinyint(3) unsigned NOT NULL DEFAULT '0', - `topic_status_change` int(11) unsigned NOT NULL DEFAULT '0', - `topic_type` tinyint(3) unsigned NOT NULL DEFAULT '0', - `topic_first_post_id` bigint(255) unsigned NOT NULL DEFAULT '0', - `topic_first_poster_id` bigint(255) unsigned NOT NULL DEFAULT '0', - `topic_last_post_id` bigint(255) unsigned NOT NULL DEFAULT '0', - `topic_last_poster_id` bigint(255) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`topic_id`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin") - ->execute(); - - // Change mod to iid in warnings table - DB::prepare('ALTER TABLE `{prefix}warnings` CHANGE `mod` `iid` bigint(128)') - ->execute(); - } - - public function down() - { - // Drop the faq table - DB::prepare("DROP TABLE `{prefix}faq`")->execute(); - - // Drop the forums table - DB::prepare("DROP TABLE `{prefix}forums`")->execute(); - - // Drop the posts table - DB::prepare("DROP TABLE `{prefix}posts`")->execute(); - - // Drop the sock_perms table - DB::prepare("DROP TABLE `{prefix}sock_perms`")->execute(); - - // Drop the topics table - DB::prepare("DROP TABLE `{prefix}topics`")->execute(); - - // Change iid to mod in warnings table - DB::prepare('ALTER TABLE `{prefix}warnings` CHANGE `iid` `mod` bigint(128)') - ->execute(); - } -} diff --git a/migrations/2015_05_08_174736_notifications_table.php b/migrations/2015_05_08_174736_notifications_table.php deleted file mode 100644 index b1f94ec..0000000 --- a/migrations/2015_05_08_174736_notifications_table.php +++ /dev/null @@ -1,38 +0,0 @@ -execute(); - - // Change mod to iid in warnings table - DB::prepare('ALTER TABLE `{prefix}warnings` CHANGE `mod` `iid` bigint(128)') - ->execute(); - } - - public function down() - { - // Drop the notifications table - DB::prepare("DROP TABLE `{prefix}notifications`")->execute(); - - // Change iid to mod in warnings table - DB::prepare('ALTER TABLE `{prefix}warnings` CHANGE `iid` `mod` bigint(128)') - ->execute(); - } -} diff --git a/migrations/2015_05_24_143425_bread_of_the_future.php b/migrations/2015_05_24_143425_bread_of_the_future.php deleted file mode 100644 index 09f9f6f..0000000 --- a/migrations/2015_05_24_143425_bread_of_the_future.php +++ /dev/null @@ -1,14 +0,0 @@ -