hasTable("PresentationActionType")) { $builder->create('PresentationActionType', function (Table $table) { $table->integer("ID", true, false); $table->primary("ID"); $table->timestamp('Created'); $table->timestamp('LastEdited'); $table->string('ClassName')->setDefault("PresentationActionType"); $table->string('Label')->setNotnull(true)->setLength(255); $table->integer('Order')->setDefault(1); // FK $table->integer("SummitID", false, false)->setNotnull(false)->setDefault('NULL'); $table->index("SummitID", "SummitID"); $table->foreign("Summit", "SummitID", "ID", ["onDelete" => "CASCADE"]); $table->unique(["SummitID", "Label"]); }); } if(!$schema->hasTable("PresentationAction")) { $builder->create('PresentationAction', function (Table $table) { $table->integer("ID", true, false); $table->primary("ID"); $table->timestamp('Created'); $table->timestamp('LastEdited'); $table->string('ClassName')->setDefault("PresentationAction"); $table->boolean('IsCompleted')->setDefault(false); // FK $table->integer("TypeID", false, false)->setNotnull(false)->setDefault('NULL'); $table->index("TypeID", "TypeID"); $table->foreign("PresentationActionType", "TypeID", "ID", ["onDelete" => "CASCADE"]); $table->integer("PresentationID", false, false)->setNotnull(false)->setDefault('NULL'); $table->index("PresentationID", "PresentationID"); $table->foreign("Presentation", "PresentationID", "ID", ["onDelete" => "CASCADE"]); $table->integer("CreatedByID", false, false)->setNotnull(false)->setDefault('NULL'); $table->index("CreatedByID", "CreatedByID"); $table->foreign("Member", "CreatedByID", "ID", ["onDelete" => "SET NULL"]); $table->integer("UpdateByID", false, false)->setNotnull(false)->setDefault('NULL'); $table->index("UpdateByID", "UpdateByID"); $table->foreign("Member", "UpdateByID", "ID", ["onDelete" => "SET NULL"]); $table->unique(["PresentationID", "TypeID"]); }); } } /** * @param Schema $schema */ public function down(Schema $schema) { } }