2016-07-26 23:02:42 +00:00
|
|
|
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
|
|
use Illuminate\Database\Schema\Blueprint;
|
2016-07-29 19:31:36 +00:00
|
|
|
use Sakura\DB;
|
2016-07-26 23:02:42 +00:00
|
|
|
|
|
|
|
// this is based on what is in the live flashii table at the
|
|
|
|
// moment this migration was created to avoid merge conflicts.
|
|
|
|
|
|
|
|
class BaseTables extends Migration
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Run the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function up()
|
|
|
|
{
|
2016-07-29 19:31:36 +00:00
|
|
|
$schema = DB::getSchemaBuilder();
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$schema->create('actioncodes', function (Blueprint $table) {
|
|
|
|
$table->string('code_action', 255);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->integer('user_id')
|
|
|
|
->unsigned();
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->string('action_code', 255);
|
2016-07-26 23:02:42 +00:00
|
|
|
});
|
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$schema->create('comment_votes', function (Blueprint $table) {
|
|
|
|
$table->integer('vote_comment')
|
|
|
|
->unsigned();
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->integer('vote_user')
|
|
|
|
->unsigned();
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->tinyInteger('vote_state')
|
|
|
|
->unsigned();
|
2016-07-26 23:02:42 +00:00
|
|
|
});
|
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$schema->create('comments', function (Blueprint $table) {
|
|
|
|
$table->increments('comment_id');
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->string('comment_category', 32);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->integer('comment_timestamp')
|
|
|
|
->unsigned();
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->integer('comment_poster')
|
|
|
|
->unsigned();
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->integer('comment_reply_to')
|
2016-07-26 23:02:42 +00:00
|
|
|
->unsigned()
|
2016-07-29 19:31:36 +00:00
|
|
|
->default(0);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->text('comment_text', 255);
|
2016-07-26 23:02:42 +00:00
|
|
|
});
|
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$schema->create('emoticons', function (Blueprint $table) {
|
|
|
|
$table->string('emote_string', 255);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->string('emote_path', 255);
|
2016-07-26 23:02:42 +00:00
|
|
|
});
|
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$schema->create('error_log', function (Blueprint $table) {
|
|
|
|
$table->string('error_id', 32);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->string('error_timestamp', 128);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->integer('error_revision')
|
|
|
|
->unsigned();
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->integer('error_type')
|
|
|
|
->unsigned();
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->integer('error_line')
|
|
|
|
->unsigned();
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->string('error_string', 512);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->string('error_file', 512);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->text('error_backtrace');
|
2016-07-26 23:02:42 +00:00
|
|
|
});
|
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$schema->create('faq', function (Blueprint $table) {
|
|
|
|
$table->increments('faq_id');
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->string('faq_shorthand', 255);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->string('faq_question', 255);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->text('faq_answer');
|
2016-07-26 23:02:42 +00:00
|
|
|
});
|
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$schema->create('forum_permissions', function (Blueprint $table) {
|
|
|
|
$table->integer('forum_id')
|
|
|
|
->unsigned();
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->integer('rank_id')
|
2016-07-30 13:48:09 +00:00
|
|
|
->unsigned()
|
|
|
|
->default(0);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->integer('user_id')
|
2016-07-30 13:48:09 +00:00
|
|
|
->unsigned()
|
|
|
|
->default(0);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->string('forum_perms', 255);
|
2016-07-26 23:02:42 +00:00
|
|
|
});
|
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$schema->create('forums', function (Blueprint $table) {
|
|
|
|
$table->increments('forum_id');
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->integer('forum_order')
|
|
|
|
->unsigned();
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->string('forum_name', 255);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-30 13:48:09 +00:00
|
|
|
$table->text('forum_desc')
|
|
|
|
->nullable()
|
|
|
|
->default(null);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-30 13:48:09 +00:00
|
|
|
$table->string('forum_link', 255)
|
|
|
|
->nullable()
|
|
|
|
->default(null);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->integer('forum_category')
|
2016-07-26 23:02:42 +00:00
|
|
|
->unsigned()
|
2016-07-29 19:31:36 +00:00
|
|
|
->default(0);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->tinyInteger('forum_type')
|
2016-07-26 23:02:42 +00:00
|
|
|
->unsigned()
|
2016-07-29 19:31:36 +00:00
|
|
|
->default(0);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-30 13:48:09 +00:00
|
|
|
$table->string('forum_icon', 255)
|
|
|
|
->nullable()
|
|
|
|
->default(null);
|
2016-07-26 23:02:42 +00:00
|
|
|
});
|
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$schema->create('friends', function (Blueprint $table) {
|
|
|
|
$table->integer('user_id')
|
|
|
|
->unsigned();
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->integer('friend_id')
|
|
|
|
->unsigned();
|
2016-07-26 23:02:42 +00:00
|
|
|
|
|
|
|
$table->integer('friend_timestamp', 11)
|
2016-07-29 19:31:36 +00:00
|
|
|
->unsigned();
|
2016-07-26 23:02:42 +00:00
|
|
|
});
|
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$schema->create('login_attempts', function (Blueprint $table) {
|
|
|
|
$table->increments('attempt_id');
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->tinyInteger('attempt_success')
|
|
|
|
->unsigned();
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->integer('attempt_timestamp')
|
|
|
|
->unsigned();
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-31 22:11:13 +00:00
|
|
|
$table->binary('attempt_ip');
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->integer('user_id')
|
|
|
|
->unsigned();
|
2016-07-26 23:02:42 +00:00
|
|
|
});
|
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$schema->create('news', function (Blueprint $table) {
|
|
|
|
$table->increments('news_id');
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->string('news_category', 255);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->integer('user_id')
|
|
|
|
->unsigned();
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->integer('news_timestamp')
|
|
|
|
->unsigned();
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->string('news_title', 255);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->text('news_content');
|
2016-07-26 23:02:42 +00:00
|
|
|
});
|
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$schema->create('notifications', function (Blueprint $table) {
|
|
|
|
$table->increments('alert_id');
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->integer('user_id')
|
2016-07-26 23:02:42 +00:00
|
|
|
->unsigned()
|
2016-07-29 19:31:36 +00:00
|
|
|
->default(0);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->integer('alert_timestamp')
|
2016-07-26 23:02:42 +00:00
|
|
|
->unsigned()
|
2016-07-29 19:31:36 +00:00
|
|
|
->default(0);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->tinyInteger('alert_read')
|
2016-07-26 23:02:42 +00:00
|
|
|
->unsigned()
|
2016-07-29 19:31:36 +00:00
|
|
|
->default(0);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->tinyInteger('alert_sound')
|
2016-07-26 23:02:42 +00:00
|
|
|
->unsigned()
|
2016-07-29 19:31:36 +00:00
|
|
|
->default(0);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->string('alert_title', 255);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->string('alert_text', 255);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->string('alert_link', 255);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->string('alert_img', 255);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->integer('alert_timeout')
|
2016-07-26 23:02:42 +00:00
|
|
|
->unsigned()
|
2016-07-29 19:31:36 +00:00
|
|
|
->default(0);
|
2016-07-26 23:02:42 +00:00
|
|
|
});
|
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$schema->create('optionfields', function (Blueprint $table) {
|
2016-07-26 23:02:42 +00:00
|
|
|
$table->string('option_id', 255)
|
2016-07-29 19:31:36 +00:00
|
|
|
->unique();
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->string('option_name', 255);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->string('option_description', 255);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->string('option_type', 255);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->string('option_permission', 255);
|
2016-07-26 23:02:42 +00:00
|
|
|
});
|
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$schema->create('permissions', function (Blueprint $table) {
|
|
|
|
$table->integer('rank_id')
|
2016-07-26 23:02:42 +00:00
|
|
|
->unsigned()
|
2016-07-29 19:31:36 +00:00
|
|
|
->default(0);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->integer('user_id')
|
2016-07-26 23:02:42 +00:00
|
|
|
->unsigned()
|
2016-07-29 19:31:36 +00:00
|
|
|
->default(0);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
|
|
|
$table->string('permissions_site', 255)
|
2016-07-29 19:31:36 +00:00
|
|
|
->default(0);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
|
|
|
$table->string('permissions_manage', 255)
|
2016-07-29 19:31:36 +00:00
|
|
|
->default(0);
|
2016-07-26 23:02:42 +00:00
|
|
|
});
|
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$schema->create('posts', function (Blueprint $table) {
|
|
|
|
$table->increments('post_id');
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->integer('topic_id')
|
2016-07-26 23:02:42 +00:00
|
|
|
->unsigned()
|
2016-07-29 19:31:36 +00:00
|
|
|
->default(0);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->integer('forum_id')
|
2016-07-26 23:02:42 +00:00
|
|
|
->unsigned()
|
2016-07-29 19:31:36 +00:00
|
|
|
->default(0);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->integer('poster_id')
|
2016-07-26 23:02:42 +00:00
|
|
|
->unsigned()
|
2016-07-29 19:31:36 +00:00
|
|
|
->default(0);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-31 22:11:13 +00:00
|
|
|
$table->binary('poster_ip');
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->integer('post_time')
|
2016-07-26 23:02:42 +00:00
|
|
|
->unsigned()
|
2016-07-29 19:31:36 +00:00
|
|
|
->default(0);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->string('post_subject', 255);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->text('post_text');
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->integer('post_edit_time')
|
2016-07-26 23:02:42 +00:00
|
|
|
->unsigned()
|
2016-07-29 19:31:36 +00:00
|
|
|
->default(0);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-31 01:32:37 +00:00
|
|
|
$table->string('post_edit_reason', 255)
|
|
|
|
->nullable()
|
|
|
|
->default(null);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->integer('post_edit_user')
|
2016-07-26 23:02:42 +00:00
|
|
|
->unsigned()
|
2016-07-29 19:31:36 +00:00
|
|
|
->default(0);
|
2016-07-26 23:02:42 +00:00
|
|
|
});
|
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$schema->create('premium', function (Blueprint $table) {
|
|
|
|
$table->integer('user_id')
|
2016-07-26 23:02:42 +00:00
|
|
|
->unsigned()
|
2016-07-29 19:31:36 +00:00
|
|
|
->unique();
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->integer('premium_start')
|
|
|
|
->unsigned();
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->integer('premium_expire')
|
|
|
|
->unsigned();
|
2016-07-26 23:02:42 +00:00
|
|
|
});
|
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$schema->create('profilefields', function (Blueprint $table) {
|
|
|
|
$table->increments('field_id')
|
|
|
|
->unsigned();
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->string('field_name', 255);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->string('field_type', 255);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->tinyInteger('field_link')
|
|
|
|
->unsigned();
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->string('field_linkformat', 255);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->string('field_description', 255);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->string('field_additional', 255);
|
2016-07-26 23:02:42 +00:00
|
|
|
});
|
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$schema->create('ranks', function (Blueprint $table) {
|
|
|
|
$table->increments('rank_id');
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->integer('rank_hierarchy')
|
|
|
|
->unsigned();
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->string('rank_name', 255);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
|
|
|
$table->string('rank_multiple', 10)
|
|
|
|
->nullable()
|
2016-07-29 19:31:36 +00:00
|
|
|
->default(null);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->tinyInteger('rank_hidden')
|
2016-07-26 23:02:42 +00:00
|
|
|
->unsigned()
|
2016-07-29 19:31:36 +00:00
|
|
|
->default(0);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-30 13:48:09 +00:00
|
|
|
$table->string('rank_colour', 255)
|
|
|
|
->nullable()
|
|
|
|
->default(null);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->text('rank_description');
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->string('rank_title', 64);
|
2016-07-26 23:02:42 +00:00
|
|
|
});
|
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$schema->create('sessions', function (Blueprint $table) {
|
|
|
|
$table->increments('session_id');
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->integer('user_id')
|
|
|
|
->unsigned();
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-31 22:11:13 +00:00
|
|
|
$table->binary('user_ip');
|
2016-07-26 23:02:42 +00:00
|
|
|
|
|
|
|
$table->string('user_agent', 255)
|
|
|
|
->nullable()
|
2016-07-29 19:31:36 +00:00
|
|
|
->default(null);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->string('session_key', 255);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->integer('session_start')
|
|
|
|
->unsigned();
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->integer('session_expire')
|
|
|
|
->unsigned();
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->tinyInteger('session_remember')
|
2016-07-26 23:02:42 +00:00
|
|
|
->unsigned()
|
2016-07-29 19:31:36 +00:00
|
|
|
->default(0);
|
2016-07-26 23:02:42 +00:00
|
|
|
});
|
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$schema->create('topics', function (Blueprint $table) {
|
|
|
|
$table->increments('topic_id');
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->integer('forum_id')
|
2016-07-26 23:02:42 +00:00
|
|
|
->unsigned()
|
2016-07-29 19:31:36 +00:00
|
|
|
->default(0);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->tinyInteger('topic_hidden')
|
2016-07-26 23:02:42 +00:00
|
|
|
->unsigned()
|
2016-07-29 19:31:36 +00:00
|
|
|
->default(0);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->string('topic_title', 255);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->integer('topic_time')
|
2016-07-26 23:02:42 +00:00
|
|
|
->unsigned()
|
2016-07-29 19:31:36 +00:00
|
|
|
->default(0);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->integer('topic_time_limit')
|
2016-07-26 23:02:42 +00:00
|
|
|
->unsigned()
|
2016-07-29 19:31:36 +00:00
|
|
|
->default(0);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->integer('topic_views')
|
2016-07-26 23:02:42 +00:00
|
|
|
->unsigned()
|
2016-07-29 19:31:36 +00:00
|
|
|
->default(0);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->tinyInteger('topic_status')
|
2016-07-26 23:02:42 +00:00
|
|
|
->unsigned()
|
2016-07-29 19:31:36 +00:00
|
|
|
->default(0);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->integer('topic_status_change')
|
2016-07-26 23:02:42 +00:00
|
|
|
->unsigned()
|
2016-07-29 19:31:36 +00:00
|
|
|
->default(0);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->tinyInteger('topic_type')
|
2016-07-26 23:02:42 +00:00
|
|
|
->unsigned()
|
2016-07-29 19:31:36 +00:00
|
|
|
->default(0);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->integer('topic_last_reply')
|
2016-07-26 23:02:42 +00:00
|
|
|
->unsigned()
|
2016-07-29 19:31:36 +00:00
|
|
|
->default(0);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->integer('topic_old_forum')
|
2016-07-26 23:02:42 +00:00
|
|
|
->unsigned()
|
2016-07-29 19:31:36 +00:00
|
|
|
->default(0);
|
2016-07-26 23:02:42 +00:00
|
|
|
});
|
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$schema->create('topics_track', function (Blueprint $table) {
|
|
|
|
$table->integer('user_id')
|
|
|
|
->unsigned();
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->integer('topic_id')
|
|
|
|
->unsigned();
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->integer('forum_id')
|
|
|
|
->unsigned();
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->integer('mark_time')
|
2016-07-26 23:02:42 +00:00
|
|
|
->unsigned()
|
2016-07-29 19:31:36 +00:00
|
|
|
->default(0);
|
2016-07-26 23:02:42 +00:00
|
|
|
});
|
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$schema->create('uploads', function (Blueprint $table) {
|
|
|
|
$table->increments('file_id');
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->integer('user_id')
|
|
|
|
->unsigned();
|
2016-07-26 23:02:42 +00:00
|
|
|
|
|
|
|
// this one's actually longblob
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->binary('file_data');
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->string('file_name', 255);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->string('file_mime', 255);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->integer('file_time')
|
|
|
|
->unsigned();
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->integer('file_expire')
|
|
|
|
->unsigned();
|
2016-07-26 23:02:42 +00:00
|
|
|
});
|
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$schema->create('user_optionfields', function (Blueprint $table) {
|
|
|
|
$table->integer('user_id')
|
|
|
|
->unsigned();
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->string('field_name', 255);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->string('field_value', 255);
|
2016-07-26 23:02:42 +00:00
|
|
|
});
|
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$schema->create('user_profilefields', function (Blueprint $table) {
|
|
|
|
$table->integer('user_id')
|
|
|
|
->unsigned();
|
2016-07-26 23:02:42 +00:00
|
|
|
|
|
|
|
$table->string('field_name', 255)
|
|
|
|
->comment('Identifier of the field');
|
|
|
|
|
|
|
|
$table->string('field_value', 255)
|
|
|
|
->comment('Value of the field');
|
|
|
|
});
|
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$schema->create('user_ranks', function (Blueprint $table) {
|
|
|
|
$table->integer('user_id')
|
2016-07-26 23:02:42 +00:00
|
|
|
->unsigned();
|
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->integer('rank_id')
|
2016-07-26 23:02:42 +00:00
|
|
|
->unsigned();
|
|
|
|
});
|
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$schema->create('username_history', function (Blueprint $table) {
|
|
|
|
$table->increments('change_id');
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->integer('change_time')
|
|
|
|
->unsigned();
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->integer('user_id')
|
|
|
|
->unsigned();
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->string('username_new', 255);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->string('username_new_clean', 255);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->string('username_old', 255);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->string('username_old_clean', 255);
|
2016-07-26 23:02:42 +00:00
|
|
|
});
|
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$schema->create('users', function (Blueprint $table) {
|
|
|
|
$table->increments('user_id');
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->string('username', 255);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
|
|
|
$table->string('username_clean', 255)
|
2016-07-29 19:31:36 +00:00
|
|
|
->unique();
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->string('password', 60)
|
|
|
|
->nullable()
|
|
|
|
->default(null);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->string('email', 255);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->mediumInteger('rank_main')
|
2016-07-26 23:02:42 +00:00
|
|
|
->unsigned()
|
2016-07-29 19:31:36 +00:00
|
|
|
->default(0);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
|
|
|
$table->string('user_colour', 255)
|
|
|
|
->nullable()
|
2016-07-29 19:31:36 +00:00
|
|
|
->default(null);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-31 22:11:13 +00:00
|
|
|
$table->binary('register_ip');
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-31 22:11:13 +00:00
|
|
|
$table->binary('last_ip');
|
2016-07-26 23:02:42 +00:00
|
|
|
|
|
|
|
$table->string('user_title', 64)
|
|
|
|
->nullable()
|
2016-07-29 19:31:36 +00:00
|
|
|
->default(null);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->integer('user_registered')
|
2016-07-26 23:02:42 +00:00
|
|
|
->unsigned()
|
2016-07-29 19:31:36 +00:00
|
|
|
->default(0);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->integer('user_last_online')
|
2016-07-26 23:02:42 +00:00
|
|
|
->unsigned()
|
2016-07-29 19:31:36 +00:00
|
|
|
->default(0);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
|
|
|
$table->date('user_birthday')
|
2016-07-31 21:58:36 +00:00
|
|
|
->nullable()
|
|
|
|
->default(null);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
|
|
|
$table->char('user_country', 2)
|
2016-07-29 19:31:36 +00:00
|
|
|
->default('XX');
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->integer('user_avatar')
|
2016-07-26 23:02:42 +00:00
|
|
|
->unsigned()
|
2016-07-29 19:31:36 +00:00
|
|
|
->default(0);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->integer('user_background')
|
2016-07-26 23:02:42 +00:00
|
|
|
->unsigned()
|
2016-07-29 19:31:36 +00:00
|
|
|
->default(0);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
$table->integer('user_header')
|
2016-07-26 23:02:42 +00:00
|
|
|
->unsigned()
|
2016-07-29 19:31:36 +00:00
|
|
|
->default(0);
|
2016-07-26 23:02:42 +00:00
|
|
|
|
|
|
|
$table->longText('user_page')
|
2016-07-29 19:31:36 +00:00
|
|
|
->nullable();
|
2016-07-26 23:02:42 +00:00
|
|
|
|
|
|
|
$table->text('user_signature')
|
2016-07-29 19:31:36 +00:00
|
|
|
->nullable();
|
2016-07-26 23:02:42 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reverse the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function down()
|
|
|
|
{
|
2016-07-29 19:31:36 +00:00
|
|
|
$schema = DB::getSchemaBuilder();
|
|
|
|
|
|
|
|
$schema->drop('actioncodes');
|
|
|
|
$schema->drop('comment_votes');
|
|
|
|
$schema->drop('comments');
|
|
|
|
$schema->drop('emoticons');
|
2016-07-31 01:32:37 +00:00
|
|
|
$schema->drop('error_log');
|
2016-07-29 19:31:36 +00:00
|
|
|
$schema->drop('faq');
|
|
|
|
$schema->drop('forum_permissions');
|
|
|
|
$schema->drop('forums');
|
|
|
|
$schema->drop('friends');
|
|
|
|
$schema->drop('login_attempts');
|
|
|
|
$schema->drop('news');
|
|
|
|
$schema->drop('notifications');
|
|
|
|
$schema->drop('optionfields');
|
|
|
|
$schema->drop('permissions');
|
|
|
|
$schema->drop('posts');
|
|
|
|
$schema->drop('premium');
|
|
|
|
$schema->drop('profilefields');
|
|
|
|
$schema->drop('ranks');
|
|
|
|
$schema->drop('sessions');
|
|
|
|
$schema->drop('topics');
|
|
|
|
$schema->drop('topics_track');
|
|
|
|
$schema->drop('uploads');
|
|
|
|
$schema->drop('user_optionfields');
|
|
|
|
$schema->drop('user_profilefields');
|
|
|
|
$schema->drop('user_ranks');
|
|
|
|
$schema->drop('username_history');
|
|
|
|
$schema->drop('users');
|
2016-07-26 23:02:42 +00:00
|
|
|
}
|
|
|
|
}
|