1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <?php
- use yii\db\Migration;
- /**
- * Class m240926_165247_Tabla_Permiso_Creacion
- */
- class m240926_165247_Tabla_Permiso_Creacion extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- $this->createTable('Permiso', [
- "id" => $this->string(36),
- "nombre" => $this->string(100),
- "idModulo" => $this->string(36),
- "clave" => $this->string(100),
- "descripcion"=> $this->string(100),
- "creado" => $this->timestamp()->append(" with time zone"),
- "modificado" => $this->timestamp()->append(" with time zone"),
- "eliminado" => $this->timestamp()->append(" with time zone"),
- ]);
- $this->addForeignKey("PermisosModuloFK", "Permiso", "idModulo", "Modulo", "id");
- $this->addPrimaryKey('PermisoPK', 'Permiso', 'id');
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- $this->dropForeignKey("PermisosModuloFK", "Permiso");
- $this->dropTable('Permiso');
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "m240926_165247_Tabla_Permiso_Creacion cannot be reverted.\n";
- return false;
- }
- */
- }
|