1
0
mirror of https://github.com/flarum/core.git synced 2025-07-30 21:20:24 +02:00

Use new migration format

This commit is contained in:
Franz Liedke
2016-02-24 23:11:26 +09:00
parent 1abcfee960
commit 272d59c6d4
2 changed files with 16 additions and 26 deletions

View File

@@ -8,24 +8,19 @@
* file that was distributed with this source code.
*/
namespace Flarum\Approval\Migration;
use Flarum\Database\AbstractMigration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Schema\Builder;
class AddIsApprovedToDiscussions extends AbstractMigration
{
public function up()
{
$this->schema->table('discussions', function (Blueprint $table) {
return [
'up' => function (Builder $schema) {
$schema->table('discussions', function (Blueprint $table) {
$table->boolean('is_approved')->default(1);
});
}
},
public function down()
{
$this->schema->table('discussions', function (Blueprint $table) {
'down' => function (Builder $schema) {
$schema->table('discussions', function (Blueprint $table) {
$table->dropColumn('is_approved');
});
}
}
];

View File

@@ -8,24 +8,19 @@
* file that was distributed with this source code.
*/
namespace Flarum\Approval\Migration;
use Flarum\Database\AbstractMigration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Schema\Builder;
class AddIsApprovedToPosts extends AbstractMigration
{
public function up()
{
$this->schema->table('posts', function (Blueprint $table) {
return [
'up' => function (Builder $schema) {
$schema->table('posts', function (Blueprint $table) {
$table->boolean('is_approved')->default(1);
});
}
},
public function down()
{
$this->schema->table('posts', function (Blueprint $table) {
'down' => function (Builder $schema) {
$schema->table('posts', function (Blueprint $table) {
$table->dropColumn('is_approved');
});
}
}
];