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:
@@ -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);
|
||||
}
|
||||
];
|
||||
);
|
||||
|
Reference in New Issue
Block a user