mirror of
https://github.com/flarum/framework.git
synced 2025-03-27 01:25:11 +08:00
Use new shortcuts for migrations
This commit is contained in:
parent
751afe218c
commit
badd2abff4
@ -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');
|
||||
}
|
||||
];
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user