createTable('Campana', [ "id" => $this->string(36), "idMedia" => $this->string(36), "nombre" => $this->string(), "descripcion" => $this->string(550), "activo" => $this->boolean()->defaultValue(false), "fechaInicio" => $this->timestamp()->append(" with time zone"), "fechaFin" => $this->timestamp()->append(" with time zone"), "creado" => $this->timestamp()->append(" with time zone"), "modificado" => $this->timestamp()->append(" with time zone"), "eliminado" => $this->timestamp()->append(" with time zone"), ]); $this->addPrimaryKey('CampanaPK', 'Campana', 'id'); $this->addForeignKey('CampanaMediaFK', 'Campana', 'idMedia', 'Media', 'id'); $this->createTable('Banner', [ "id" => $this->string(36), "idCampana" => $this->string(36), "idMedia" => $this->string(36), "nombre" => $this->string(), "tamano" => $this->string(), "descripcion" => $this->text(), "activo" => $this->boolean()->defaultValue(false), "fechaInicio" => $this->timestamp()->append("with time zone"), "fechaFin" => $this->timestamp()->append("with time zone"), "creado" => $this->timestamp()->append("with time zone"), "modificado" => $this->timestamp()->append("with time zone"), "eliminado" => $this->timestamp()->append("with time zone") ]); $this->addPrimaryKey('BannerPK', 'Banner', 'id'); $this->addForeignKey('BannerCampanaFK', 'Banner', 'idCampana', 'Campana', 'id'); } public function safeDown() { $this->dropForeignKey('BannerCampanaFK', 'Banner'); $this->dropForeignKey('CampanaMediaFK', 'Campana'); $this->dropTable('Banner'); $this->dropTable('Campana'); } }