| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <?php
- use yii\db\Migration;
- /**
- * Class m230130_220056_redes
- */
- class m230130_220056_redes extends Migration {
- /**
- * {@inheritdoc}
- */
- public function safeUp() {
- $this->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');
- }
- }
|