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