datatable.directory codebase https://datatable.directory/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
datatable.directory/database/migrations/2018_07_08_193600_create_re...

45 lines
1.2 KiB

<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateRevisionsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('revisions', function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
$table->unsignedInteger('ancestor_id')->index()->nullable(); // parent revision
$table->unsignedInteger('proposal_id')->index()->nullable(); // parent revision
$table->unsignedInteger('row_count'); // cached nbr of rows
// columns specification
// array with: {name, title, type}
$table->jsonb('columns');
// author's note describing what has been changed
$table->text('note')->nullable();
$table->foreign('ancestor_id')->references('id')->on('revisions')
->onDelete('set null');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('revisions');
}
}