mirror of
https://github.com/flarum/core.git
synced 2025-07-29 04:30:56 +02:00
Use new migration format
This commit is contained in:
@@ -8,24 +8,19 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Flarum\Suspend\Migration;
|
|
||||||
|
|
||||||
use Flarum\Database\AbstractMigration;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Database\Schema\Builder;
|
||||||
|
|
||||||
class AddSuspendedUntilToUsersTable 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('suspended_until')->nullable();
|
$table->dateTime('suspended_until')->nullable();
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
|
|
||||||
public function down()
|
'down' => function (Builder $schema) {
|
||||||
{
|
$schema->table('users', function (Blueprint $table) {
|
||||||
$this->schema->table('users', function (Blueprint $table) {
|
|
||||||
$table->dropColumn('suspended_until');
|
$table->dropColumn('suspended_until');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
];
|
||||||
|
@@ -8,24 +8,19 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Flarum\Suspend\Migration;
|
|
||||||
|
|
||||||
use Flarum\Database\AbstractMigration;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Database\Schema\Builder;
|
||||||
|
|
||||||
class RenameSuspendedUntilColumn extends AbstractMigration
|
return [
|
||||||
{
|
'up' => function (Builder $schema) {
|
||||||
public function up()
|
$schema->table('users', function (Blueprint $table) {
|
||||||
{
|
|
||||||
$this->schema->table('users', function (Blueprint $table) {
|
|
||||||
$table->renameColumn('suspended_until', 'suspend_until');
|
$table->renameColumn('suspended_until', 'suspend_until');
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
|
|
||||||
public function down()
|
'down' => function (Builder $schema) {
|
||||||
{
|
$schema->table('users', function (Blueprint $table) {
|
||||||
$this->schema->table('users', function (Blueprint $table) {
|
|
||||||
$table->renameColumn('suspend_until', 'suspended_until');
|
$table->renameColumn('suspend_until', 'suspended_until');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
];
|
||||||
|
Reference in New Issue
Block a user