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.
44 lines
1.2 KiB
44 lines
1.2 KiB
<?php
|
|
|
|
use Illuminate\Support\Facades\Schema;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Database\Migrations\Migration;
|
|
|
|
class CreateDataTablesTable extends Migration
|
|
{
|
|
/**
|
|
* Run the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function up()
|
|
{
|
|
Schema::create('data_tables', function (Blueprint $table) {
|
|
$table->increments('id');
|
|
$table->timestamps();
|
|
$table->unsignedInteger('owner_id');
|
|
$table->unsignedInteger('precursor_id')->nullable(); // fork source
|
|
$table->unsignedInteger('revision'); // incremented with each applied changeset
|
|
$table->string('title')->index(); // indexable
|
|
$table->text('description');
|
|
$table->text('license');
|
|
$table->text('source_link');
|
|
|
|
$table->foreign('owner_id')->references('id')->on('users')
|
|
->onDelete('cascade');
|
|
|
|
$table->foreign('parent_table_id')->references('id')->on('data_tables')
|
|
->onDelete('set null');
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
Schema::dropIfExists('data_tables');
|
|
}
|
|
}
|
|
|