-
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add migrations that were missed for some reason
- Loading branch information
Showing
18 changed files
with
623 additions
and
0 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
database/migrations/2014_05_19_151759_create_forum_table_categories.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
|
||
class CreateForumTableCategories extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
if (!Schema::hasTable('forum_categories')) { | ||
Schema::create('forum_categories', function (Blueprint $table) { | ||
$table->increments('id'); | ||
$table->integer('parent_category')->unsigned(); | ||
$table->string('title'); | ||
$table->string('subtitle'); | ||
$table->integer('weight'); | ||
}); | ||
} | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::drop('forum_categories'); | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
database/migrations/2014_05_19_152425_create_forum_table_threads.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
|
||
class CreateForumTableThreads extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
if (!Schema::hasTable('forum_threads')) { | ||
Schema::create('forum_threads', function (Blueprint $table) { | ||
$table->increments('id'); | ||
$table->integer('parent_category')->unsigned(); | ||
$table->foreignIdFor(config('forum.integration.user_model'), 'author_id'); | ||
$table->string('title'); | ||
$table->boolean('pinned'); | ||
$table->boolean('locked'); | ||
|
||
$table->timestamps(); | ||
$table->softDeletes(); | ||
}); | ||
} | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::drop('forum_threads'); | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
database/migrations/2014_05_19_152611_create_forum_table_posts.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
|
||
class CreateForumTablePosts extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
if (!Schema::hasTable('forum_posts')) { | ||
Schema::create('forum_posts', function (Blueprint $table) { | ||
$table->increments('id'); | ||
$table->integer('parent_thread')->unsigned(); | ||
$table->foreignIdFor(config('forum.integration.user_model'), 'author_id'); | ||
$table->text('content'); | ||
|
||
$table->timestamps(); | ||
$table->softDeletes(); | ||
}); | ||
} | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::drop('forum_posts'); | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
database/migrations/2015_04_14_180344_create_forum_table_threads_read.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
|
||
class CreateForumTableThreadsRead extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
if (!Schema::hasTable('forum_threads_read')) { | ||
Schema::create('forum_threads_read', function (Blueprint $table) { | ||
$table->integer('thread_id')->unsigned(); | ||
$table->foreignIdFor(config('forum.integration.user_model'), 'user_id'); | ||
$table->timestamps(); | ||
}); | ||
} | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::drop('forum_threads_read'); | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
database/migrations/2015_07_22_181406_update_forum_table_categories.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
|
||
class UpdateForumTableCategories extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
Schema::table('forum_categories', function (Blueprint $table) { | ||
if (!Schema::hasColumn('forum_categories', 'category_id')) { | ||
$table->renameColumn('parent_category', 'category_id'); | ||
} | ||
if (!Schema::hasColumn('forum_categories', 'description')) { | ||
$table->renameColumn('subtitle', 'description'); | ||
} | ||
}); | ||
|
||
Schema::table('forum_categories', function (Blueprint $table) { | ||
$table->integer('category_id')->default(0)->change(); | ||
$table->string('description')->nullable()->change(); | ||
$table->integer('weight')->default(0)->change(); | ||
|
||
$table->boolean('enable_threads')->default(0); | ||
$table->boolean('private')->default(0); | ||
|
||
$table->timestamps(); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::table('forum_categories', function (Blueprint $table) { | ||
$table->renameColumn('category_id', 'parent_category'); | ||
$table->dropColumn(['created_at', 'updated_at', 'enable_threads', 'private']); | ||
$table->renameColumn('description', 'subtitle'); | ||
}); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
database/migrations/2015_07_22_181409_update_forum_table_threads.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
|
||
class UpdateForumTableThreads extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
Schema::table('forum_threads', function (Blueprint $table) { | ||
$table->renameColumn('parent_category', 'category_id'); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::table('forum_threads', function (Blueprint $table) { | ||
$table->renameColumn('category_id', 'parent_category'); | ||
}); | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
database/migrations/2015_07_22_181417_update_forum_table_posts.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
|
||
class UpdateForumTablePosts extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
Schema::table('forum_posts', function (Blueprint $table) { | ||
$table->renameColumn('parent_thread', 'thread_id'); | ||
$table->integer('post_id')->after('content')->unsigned()->nullable(); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::table('forum_posts', function (Blueprint $table) { | ||
$table->renameColumn('thread_id', 'parent_thread'); | ||
}); | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
database/migrations/2016_05_24_114302_add_defaults_to_forum_table_threads_columns.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
|
||
class AddDefaultsToForumTableThreadsColumns extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
Schema::table('forum_threads', function (Blueprint $table) { | ||
$table->boolean('pinned')->nullable()->default(0)->change(); | ||
$table->boolean('locked')->nullable()->default(0)->change(); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::table('forum_threads', function (Blueprint $table) { | ||
$table->boolean('pinned')->nullable(false)->default(null)->change(); | ||
$table->boolean('locked')->nullable(false)->default(null)->change(); | ||
}); | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
database/migrations/2016_07_09_111441_add_counts_to_categories_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
|
||
class AddCountsToCategoriesTable extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
Schema::table('forum_categories', function (Blueprint $table) { | ||
// Add increments to the thread and post counts on the categories table | ||
$table->integer('post_count')->after('enable_threads')->default(0); | ||
$table->integer('thread_count')->after('enable_threads')->default(0); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::table('forum_categories', function (Blueprint $table) { | ||
$table->dropColumn(['thread_count', 'post_count']); | ||
}); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
database/migrations/2016_07_09_122706_add_counts_to_threads_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
|
||
class AddCountsToThreadsTable extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
Schema::table('forum_threads', function (Blueprint $table) { | ||
$table->integer('reply_count')->after('locked')->default(0); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::table('forum_threads', function (Blueprint $table) { | ||
$table->dropColumn('reply_count'); | ||
}); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
database/migrations/2016_07_10_134700_add_sequence_to_posts_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
|
||
class AddSequenceToPostsTable extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
Schema::table('forum_posts', function (Blueprint $table) { | ||
$table->integer('sequence')->after('post_id')->unsigned()->default(0); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::table('forum_posts', function (Blueprint $table) { | ||
$table->dropColumn('sequence'); | ||
}); | ||
} | ||
} |
Oops, something went wrong.