mirror of
https://github.com/flarum/framework.git
synced 2024-11-30 05:13:37 +08:00
Use new shortcuts for migrations
This commit is contained in:
parent
ec0054cace
commit
d240d4c0ff
|
@ -8,19 +8,14 @@
|
|||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use Flarum\Database\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Schema\Builder;
|
||||
|
||||
return [
|
||||
'up' => function (Builder $schema) {
|
||||
$schema->create('discussions_tags', function (Blueprint $table) {
|
||||
return Migration::createTable(
|
||||
'discussions_tags',
|
||||
function (Blueprint $table) {
|
||||
$table->integer('discussion_id')->unsigned();
|
||||
$table->integer('tag_id')->unsigned();
|
||||
$table->primary(['discussion_id', 'tag_id']);
|
||||
});
|
||||
},
|
||||
|
||||
'down' => function (Builder $schema) {
|
||||
$schema->drop('discussions_tags');
|
||||
}
|
||||
];
|
||||
);
|
||||
|
|
|
@ -8,21 +8,16 @@
|
|||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use Flarum\Database\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Schema\Builder;
|
||||
|
||||
return [
|
||||
'up' => function (Builder $schema) {
|
||||
$schema->create('users_tags', function (Blueprint $table) {
|
||||
return Migration::createTable(
|
||||
'users_tags',
|
||||
function (Blueprint $table) {
|
||||
$table->integer('user_id')->unsigned();
|
||||
$table->integer('tag_id')->unsigned();
|
||||
$table->dateTime('read_time')->nullable();
|
||||
$table->boolean('is_hidden')->default(0);
|
||||
$table->primary(['user_id', 'tag_id']);
|
||||
});
|
||||
},
|
||||
|
||||
'down' => function (Builder $schema) {
|
||||
$schema->drop('users_tags');
|
||||
}
|
||||
];
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue
Block a user