1
0
mirror of https://github.com/flarum/core.git synced 2025-07-30 21:20:24 +02:00

Use the new migration shortcuts in most of core's migrations

This commit is contained in:
Franz Liedke
2016-02-25 00:50:54 +09:00
parent db7a03fbe5
commit 2b5dab73f9
18 changed files with 149 additions and 255 deletions

View File

@@ -8,26 +8,21 @@
* file that was distributed with this source code.
*/
use Flarum\Database\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Schema\Builder;
return [
'up' => function (Builder $schema) {
$schema->create('notifications', function (Blueprint $table) {
$table->increments('id');
$table->integer('user_id')->unsigned();
$table->integer('sender_id')->unsigned()->nullable();
$table->string('type', 100);
$table->string('subject_type', 200)->nullable();
$table->integer('subject_id')->unsigned()->nullable();
$table->binary('data')->nullable();
$table->dateTime('time');
$table->boolean('is_read')->default(0);
$table->boolean('is_deleted')->default(0);
});
},
'down' => function (Builder $schema) {
$schema->drop('notifications');
return Migration::createTable(
'notifications',
function (Blueprint $table) {
$table->increments('id');
$table->integer('user_id')->unsigned();
$table->integer('sender_id')->unsigned()->nullable();
$table->string('type', 100);
$table->string('subject_type', 200)->nullable();
$table->integer('subject_id')->unsigned()->nullable();
$table->binary('data')->nullable();
$table->dateTime('time');
$table->boolean('is_read')->default(0);
$table->boolean('is_deleted')->default(0);
}
];
);