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.
43 lines
1.1 KiB
43 lines
1.1 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('refs'); // used for reference counting
|
|
$table->unsignedInteger('ancestor_id')->index()->nullable(); // parent revision
|
|
|
|
// 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');
|
|
}
|
|
}
|
|
|