|
@@ -0,0 +1,39 @@
|
|
|
|
|
+<?php
|
|
|
|
|
+
|
|
|
|
|
+use yii\db\Migration;
|
|
|
|
|
+
|
|
|
|
|
+/**
|
|
|
|
|
+ * Class m230130_184544_tabla_grupos_eventos
|
|
|
|
|
+ */
|
|
|
|
|
+class m230130_184544_tabla_grupos_eventos extends Migration {
|
|
|
|
|
+ /**
|
|
|
|
|
+ * {@inheritdoc}
|
|
|
|
|
+ */
|
|
|
|
|
+ public function safeUp() {
|
|
|
|
|
+
|
|
|
|
|
+ $this->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");
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * {@inheritdoc}
|
|
|
|
|
+ */
|
|
|
|
|
+ public function safeDown() {
|
|
|
|
|
+
|
|
|
|
|
+ $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');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+}
|