mirror of
https://github.com/flarum/core.git
synced 2025-08-09 09:57:06 +02:00
Revamp migration structure
They are now simply files that return an array of closures, for running the named "up" and "down" actions, respectively. Related to #732.
This commit is contained in:
@@ -8,26 +8,21 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Flarum\Core\Migration;
|
||||
|
||||
use Flarum\Database\AbstractMigration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Schema\Builder;
|
||||
|
||||
class CreateGroupsTable extends AbstractMigration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$this->schema->create('groups', function (Blueprint $table) {
|
||||
return [
|
||||
'up' => function (Builder $schema) {
|
||||
$schema->create('groups', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('name_singular', 100);
|
||||
$table->string('name_plural', 100);
|
||||
$table->string('color', 20)->nullable();
|
||||
$table->string('icon', 100)->nullable();
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->schema->drop('groups');
|
||||
'down' => function (Builder $schema) {
|
||||
$schema->drop('groups');
|
||||
}
|
||||
}
|
||||
];
|
||||
|
Reference in New Issue
Block a user