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:
parent
7a059a5e90
commit
bf8e7f3393
13 changed files with 190 additions and 4 deletions
database/migrations
|
@ -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');
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue