Pivot scaffolding and new views for adding beers
This commit is contained in:
@@ -14,7 +14,7 @@ class CreateBeersTable extends Migration
|
||||
public function up()
|
||||
{
|
||||
Schema::create('beers', function (Blueprint $table) {
|
||||
$table->unsignedBigInteger('id');
|
||||
$table->id();
|
||||
$table->string('beer');
|
||||
$table->integer('rating');
|
||||
$table->string('country');
|
||||
|
||||
@@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class ListBeersPivotTable extends Migration
|
||||
class BeerListPivot extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
@@ -13,10 +13,10 @@ class ListBeersPivotTable extends Migration
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('list_beers_pivot', function (Blueprint $table) {
|
||||
$table->unsignedBigInteger('id');
|
||||
$table->unsignedBigInteger('beer_id');
|
||||
$table->unsignedBigInteger('list_id');
|
||||
Schema::create('beer_list_pivot', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('beer_id')->constrained();
|
||||
$table->foreignId('list_id')->constrained();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -27,6 +27,6 @@ class ListBeersPivotTable extends Migration
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('list_beers_pivot');
|
||||
//
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user