mirror of
https://github.com/flarum/framework.git
synced 2025-04-14 15:10:35 +08:00
Use new migration format
This commit is contained in:
parent
b782e0e2fd
commit
3188e2119e
@ -8,24 +8,19 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Flarum\Akismet\Migration;
|
||||
|
||||
use Flarum\Database\AbstractMigration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Schema\Builder;
|
||||
|
||||
class AddIsSpamToPosts 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_spam')->default(0);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->schema->table('posts', function (Blueprint $table) {
|
||||
'down' => function (Builder $schema) {
|
||||
$schema->table('posts', function (Blueprint $table) {
|
||||
$table->dropColumn('is_spam');
|
||||
});
|
||||
}
|
||||
}
|
||||
];
|
||||
|
Loading…
x
Reference in New Issue
Block a user