mirror of
https://github.com/flarum/framework.git
synced 2025-02-21 08:22:41 +08:00
Use new shortcuts for migrations
This commit is contained in:
parent
861ff6e910
commit
af76eff949
@ -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('posts_likes', function (Blueprint $table) {
|
||||
$table->integer('post_id')->unsigned();
|
||||
$table->integer('user_id')->unsigned();
|
||||
$table->primary(['post_id', 'user_id']);
|
||||
});
|
||||
},
|
||||
|
||||
'down' => function (Builder $schema) {
|
||||
$schema->drop('posts_likes');
|
||||
return Migration::createTable(
|
||||
'posts_likes',
|
||||
function (Blueprint $table) {
|
||||
$table->integer('post_id')->unsigned();
|
||||
$table->integer('user_id')->unsigned();
|
||||
$table->primary(['post_id', 'user_id']);
|
||||
}
|
||||
];
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user