createTable("EventoGrupo", [ "idEvento" => $this->integer(), "idGrupo" => $this->integer(), ]); $this->addPrimaryKey('EventoGrupoPK', 'EventoGrupo', ['idEvento', 'idGrupo']); $this->alterColumn("Evento", "nombre", $this->string(255)->notNull()); $this->alterColumn("Evento", "descripcion", $this->text()); $this->dropColumn("Evento", "idGrupo"); $this->addForeignKey('EventoGrupoIdEventoFK', 'EventoGrupo', 'idEvento', 'Evento', 'id'); $this->addForeignKey('EventoGrupoIdGrupoFK', 'EventoGrupo', 'idGrupo', 'Grupo', 'id'); } /** * {@inheritdoc} */ public function safeDown() { $this->dropForeignKey("EventoGrupoIdGrupoFK", "EventoGrupo"); $this->dropForeignKey("EventoGrupoIdEventoFK", "EventoGrupo"); $this->addColumn("Evento", "idGrupo", $this->integer()); $this->alterColumn("Evento", "descripcion", $this->string(255)); $this->alterColumn("Evento", "nombre", $this->string(100)->notNull()); $this->dropPrimaryKey("EventoGrupoPK", "EventoGrupo"); $this->dropTable('EventoGrupo'); } }