mirror of
https://github.com/flarum/core.git
synced 2025-08-05 07:57:46 +02:00
Use new shortcuts for migrations
This commit is contained in:
@@ -8,17 +8,8 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Schema\Builder;
|
||||
use Flarum\Database\Migration;
|
||||
|
||||
return [
|
||||
'up' => function (Builder $schema) {
|
||||
$schema->table('users', function (Blueprint $table) {
|
||||
$table->dateTime('flags_read_time')->nullable();
|
||||
});
|
||||
},
|
||||
|
||||
'down' => function (Builder $schema) {
|
||||
$schema->drop('flags_read_time');
|
||||
}
|
||||
];
|
||||
return Migration::addColumns('users', [
|
||||
'flags_read_time' => ['dateTime', 'nullable' => true]
|
||||
]);
|
||||
|
@@ -8,23 +8,18 @@
|
||||
* 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('flags', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('post_id')->unsigned();
|
||||
$table->string('type');
|
||||
$table->integer('user_id')->unsigned()->nullable();
|
||||
$table->string('reason')->nullable();
|
||||
$table->string('reason_detail')->nullable();
|
||||
$table->dateTime('time');
|
||||
});
|
||||
},
|
||||
|
||||
'down' => function (Builder $schema) {
|
||||
$schema->drop('flags');
|
||||
return Migration::createTable(
|
||||
'flags',
|
||||
function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('post_id')->unsigned();
|
||||
$table->string('type');
|
||||
$table->integer('user_id')->unsigned()->nullable();
|
||||
$table->string('reason')->nullable();
|
||||
$table->string('reason_detail')->nullable();
|
||||
$table->dateTime('time');
|
||||
}
|
||||
];
|
||||
);
|
||||
|
Reference in New Issue
Block a user