m240926_211958_Ajuste_campos_partida_unidad_de_medida.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. use yii\db\Migration;
  3. /**
  4. * Class m240926_211958_Ajuste_campos_partida_unidad_de_medida
  5. */
  6. class m240926_211958_Ajuste_campos_partida_unidad_de_medida extends Migration
  7. {
  8. /**
  9. * {@inheritdoc}
  10. */
  11. public function safeUp()
  12. {
  13. $this->alterColumn('UnidadMedida', 'nombre', $this->string(100)->null());
  14. $this->alterColumn('UnidadMedida', 'descripcion', $this->string(100)->null());
  15. $this->alterColumn('Partida', 'nombre', $this->string(100)->null());
  16. $this->alterColumn('Partida', 'descripcion', $this->string(100)->null());
  17. }
  18. /**
  19. * {@inheritdoc}
  20. */
  21. public function safeDown()
  22. {
  23. $this->alterColumn('UnidadMedida', 'nombre', $this->string(100)->notNull());
  24. $this->alterColumn('UnidadMedida', 'descripcion', $this->string(100)->notNull());
  25. $this->alterColumn('Partida', 'nombre', $this->string(100)->notNull());
  26. $this->alterColumn('Partida', 'descripcion', $this->string(100)->notNull());
  27. }
  28. /*
  29. // Use up()/down() to run migration code without a transaction.
  30. public function up()
  31. {
  32. }
  33. public function down()
  34. {
  35. echo "m240926_211958_Ajuste_campos_partida_unidad_de_medida cannot be reverted.\n";
  36. return false;
  37. }
  38. */
  39. }