123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <?php
- use yii\db\Migration;
- /**
- * Class m241015_210755_Tabla_Conceptos_Obra
- */
- class m241015_210755_Tabla_Conceptos_Obra extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- $this->createTable('ConceptoObra', [
- "id" => $this->string(36),
- "idPartida" => $this->string(36),
- "concepto" => $this->string(100),
- "descripcion" => $this->string(100),
- "estatus"=>$this->string(36),
- "creado" => $this->timestamp()->append(" with time zone"),
- "modificado" => $this->timestamp()->append(" with time zone"),
- "eliminado" => $this->timestamp()->append(" with time zone"),
- ]);
- $this->addForeignKey("ConceptoObraPartidaFK", "ConceptoObra", "idPartida", "Partida", "id");
- $this->addPrimaryKey('ConceptoObraPK', 'ConceptoObra', 'id');
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- $this->dropForeignKey("ConceptoObraPartidaFK", "ConceptoObra");
- $this->dropTable('ConceptoObra');
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "m241015_210755_Tabla_Conceptos_Obra cannot be reverted.\n";
- return false;
- }
- */
- }
|