increments('id'); $table->timestamps(); $table->unsignedInteger('ancestor_id')->index()->nullable(); // parent revision $table->unsignedInteger('proposal_id')->index()->nullable(); // parent revision $table->unsignedInteger('row_count'); // cached nbr of rows // 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'); } }