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'); } }