0
0
Fork 0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-05-08 18:10:08 +00:00

Started addition of favourite system

This commit is contained in:
Dan Brown 2021-05-16 00:29:56 +01:00
parent 7a059a5e90
commit bf8e7f3393
No known key found for this signature in database
GPG key ID: 46D9F943C24A2EF9
13 changed files with 190 additions and 4 deletions

View file

@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateFavouritesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('favourites', function (Blueprint $table) {
$table->increments('id');
$table->integer('user_id')->index();
$table->integer('favouritable_id');
$table->string('favouritable_type', 100);
$table->timestamps();
$table->index(['favouritable_id', 'favouritable_type'], 'favouritable_index');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('favourites');
}
}