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