m240806_212252_tabla_tipoauto.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. use yii\db\Migration;
  3. /**
  4. * Class m240806_212252_tabla_tipoauto
  5. */
  6. class m240806_212252_tabla_tipoauto extends Migration
  7. {
  8. /**
  9. * {@inheritdoc}
  10. */
  11. public function safeUp()
  12. {
  13. // Crear la tabla Marca
  14. $this->createTable('TipoAuto', [
  15. "id" => $this->string(36),
  16. "clave" => $this->string(100)->notNull(),
  17. "tipo" => $this->string(100)->notNull(),
  18. "descripcion" => $this->string(100)->notNull(),
  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->addPrimaryKey('TipoAutoPK', 'TipoAuto', 'id');
  24. }
  25. /**
  26. * {@inheritdoc}
  27. */
  28. public function safeDown()
  29. {
  30. $this->dropTable("TipoAuto");
  31. }
  32. /*
  33. // Use up()/down() to run migration code without a transaction.
  34. public function up()
  35. {
  36. }
  37. public function down()
  38. {
  39. echo "m240806_212252_tabla_tipoauto cannot be reverted.\n";
  40. return false;
  41. }
  42. */
  43. }