m240925_164317_Creacion_de_Tabla_Modulo.php 1.0 KB

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