got rid of proposal-column references
This commit is contained in:
@@ -19,8 +19,8 @@ class CreateRevisionsTable extends Migration
|
||||
$table->unsignedInteger('refs'); // used for reference counting
|
||||
$table->unsignedInteger('ancestor_id')->index()->nullable(); // parent revision
|
||||
|
||||
// a column that can be used as the primary key for a table; possibly a composite column if using a comma
|
||||
$table->string('index_column')->nullable();
|
||||
// a column that can be used as the primary key for a table; possibly a composite column, if using a comma
|
||||
$table->string('index_column');
|
||||
|
||||
// author's note describing what has been changed
|
||||
$table->text('note');
|
||||
|
||||
@@ -25,6 +25,8 @@ class CreateProposalsTable extends Migration
|
||||
|
||||
$table->text('note');
|
||||
|
||||
$table->jsonb('changes'); // the actual meat of the changeset is stored here
|
||||
|
||||
// block the delete - we must first decrement Row refs and then the proposals manually
|
||||
$table->foreign('revision_id')->references('id')->on('revisions')
|
||||
->onDelete('restrict');
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateProposalRemoveRowPivotTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('proposal_remove_row_pivot', function (Blueprint $table) {
|
||||
$table->unsignedInteger('proposal_id')->index();
|
||||
$table->unsignedInteger('row_id')->index();
|
||||
|
||||
$table->foreign('proposal_id')->references('id')->on('proposals')
|
||||
->onDelete('cascade');
|
||||
|
||||
$table->foreign('row_id')->references('id')->on('rows')
|
||||
->onDelete('cascade');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('proposal_remove_row_pivot');
|
||||
}
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateProposalAddRowPivotTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('proposal_add_row_pivot', function (Blueprint $table) {
|
||||
$table->unsignedInteger('proposal_id')->index();
|
||||
$table->unsignedInteger('row_id')->index();
|
||||
|
||||
$table->foreign('proposal_id')->references('id')->on('proposals')
|
||||
->onDelete('cascade');
|
||||
|
||||
$table->foreign('row_id')->references('id')->on('rows')
|
||||
->onDelete('cascade');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('proposal_add_row_pivot');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user