increments('id'); $table->timestamps(); $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(); // author's note describing what has been changed $table->text('note'); $table->foreign('ancestor_id')->references('id')->on('revisions') ->onDelete('set null'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('revisions'); } }