m241015_210755_Tabla_Conceptos_Obra.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. use yii\db\Migration;
  3. /**
  4. * Class m241015_210755_Tabla_Conceptos_Obra
  5. */
  6. class m241015_210755_Tabla_Conceptos_Obra extends Migration
  7. {
  8. /**
  9. * {@inheritdoc}
  10. */
  11. public function safeUp()
  12. {
  13. $this->createTable('ConceptoObra', [
  14. "id" => $this->string(36),
  15. "idPartida" => $this->string(36),
  16. "concepto" => $this->string(100),
  17. "descripcion" => $this->string(100),
  18. "estatus"=>$this->string(36),
  19. "creado" => $this->timestamp()->append(" with time zone"),
  20. "modificado" => $this->timestamp()->append(" with time zone"),
  21. "eliminado" => $this->timestamp()->append(" with time zone"),
  22. ]);
  23. $this->addForeignKey("ConceptoObraPartidaFK", "ConceptoObra", "idPartida", "Partida", "id");
  24. $this->addPrimaryKey('ConceptoObraPK', 'ConceptoObra', 'id');
  25. }
  26. /**
  27. * {@inheritdoc}
  28. */
  29. public function safeDown()
  30. {
  31. $this->dropForeignKey("ConceptoObraPartidaFK", "ConceptoObra");
  32. $this->dropTable('ConceptoObra');
  33. }
  34. /*
  35. // Use up()/down() to run migration code without a transaction.
  36. public function up()
  37. {
  38. }
  39. public function down()
  40. {
  41. echo "m241015_210755_Tabla_Conceptos_Obra cannot be reverted.\n";
  42. return false;
  43. }
  44. */
  45. }