Преглед изворни кода

Merge branch 'master' of git.audiovalid.com:yager/yager-api

Hugo Quijada пре 3 година
родитељ
комит
f25477859d
1 измењених фајлова са 39 додато и 0 уклоњено
  1. 39 0
      migrations/m230130_184544_tabla_grupos_eventos.php

+ 39 - 0
migrations/m230130_184544_tabla_grupos_eventos.php

@@ -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');
+	}
+
+}