mirror of
https://github.com/flarum/framework.git
synced 2025-01-21 00:57:31 +08:00
Use new migration format
This commit is contained in:
parent
d30a0a7d59
commit
e62dd6a3a1
|
@ -8,22 +8,17 @@
|
|||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Flarum\Flags\Migration;
|
||||
|
||||
use Flarum\Database\AbstractMigration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Schema\Builder;
|
||||
|
||||
class AddFlagsReadTimeToUsersTable extends AbstractMigration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$this->schema->table('users', function (Blueprint $table) {
|
||||
return [
|
||||
'up' => function (Builder $schema) {
|
||||
$schema->table('users', function (Blueprint $table) {
|
||||
$table->dateTime('flags_read_time')->nullable();
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->schema->drop('flags_read_time');
|
||||
'down' => function (Builder $schema) {
|
||||
$schema->drop('flags_read_time');
|
||||
}
|
||||
}
|
||||
];
|
||||
|
|
|
@ -8,16 +8,12 @@
|
|||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Flarum\Flags\Migration;
|
||||
|
||||
use Flarum\Database\AbstractMigration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Schema\Builder;
|
||||
|
||||
class CreateFlagsTable extends AbstractMigration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$this->schema->create('flags', function (Blueprint $table) {
|
||||
return [
|
||||
'up' => function (Builder $schema) {
|
||||
$schema->create('flags', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('post_id')->unsigned();
|
||||
$table->string('type');
|
||||
|
@ -26,10 +22,9 @@ class CreateFlagsTable extends AbstractMigration
|
|||
$table->string('reason_detail')->nullable();
|
||||
$table->dateTime('time');
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->schema->drop('flags');
|
||||
'down' => function (Builder $schema) {
|
||||
$schema->drop('flags');
|
||||
}
|
||||
}
|
||||
];
|
||||
|
|
Loading…
Reference in New Issue
Block a user