m240806_184222_tabla_marca.php 898 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. use yii\db\Migration;
  3. /**
  4. * Class m240806_184222_tabla_marca
  5. */
  6. class m240806_184222_tabla_marca extends Migration
  7. {
  8. /**
  9. * {@inheritdoc}
  10. */
  11. public function safeUp()
  12. {
  13. // Crear la tabla Marca
  14. $this->createTable('Marca', [
  15. "id" => $this->string(36),
  16. "clave" => $this->string(100)->notNull(),
  17. "marca" => $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('MarcaPK', 'Marca', 'id');
  24. }
  25. /**
  26. * {@inheritdoc}
  27. */
  28. public function safeDown()
  29. {
  30. $this->dropTable("Marca");
  31. }
  32. }