mirror of
https://github.com/flarum/core.git
synced 2025-08-08 01:16:52 +02:00
Use new shortcuts for migrations
This commit is contained in:
@@ -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']);
|
||||
}
|
||||
];
|
||||
);
|
||||
|
Reference in New Issue
Block a user