createTable('Red', [ 'idEvento' => $this->integer(), 'key' => $this->string(50), 'url' => $this->string(500), 'redSocial' => $this->string(250) ]); $this->addPrimaryKey('RedPK', 'Red', ['idEvento', 'url']); $this->addForeignKey('RedEventoFK', 'Red', 'idEvento', 'Evento', 'id'); $this->addColumn('Evento', 'ciudad', $this->string(100)); $this->createTable('EventoAccion', [ 'idEvento' => $this->integer(), 'accion' => $this->string(10) ]); $this->addPrimaryKey('EventoAccionPK', 'EventoAccion', ['idEvento', 'accion']); $this->addForeignKey('EventoAccionEventoFK', 'EventoAccion', 'idEvento', 'Evento', 'id'); $this->alterColumn('Usuario', 'email', $this->string(100)); } /** * {@inheritdoc} */ public function safeDown() { $this->alterColumn('Usuario', 'email', $this->string(100)->notNull()); $this->dropTable('EventoAccion'); $this->dropForeignKey('EventoAccionEventoFK', 'EventoAccion'); $this->dropPrimaryKey('EventoAccionPK', 'EventoAccion'); $this->dropColumn('Evento', 'ciudad'); $this->dropForeignKey('RedEventoFK', 'Red'); $this->dropPrimaryKey('RedPK', 'Red'); $this->dropTable('Red'); } }