mirror of
https://github.com/flarum/framework.git
synced 2025-02-21 09:11:40 +08:00
Use new migration format
This commit is contained in:
parent
1abcfee960
commit
272d59c6d4
@ -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');
|
||||
});
|
||||
}
|
||||
}
|
||||
];
|
||||
|
@ -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');
|
||||
});
|
||||
}
|
||||
}
|
||||
];
|
||||
|
Loading…
x
Reference in New Issue
Block a user