m240803_012148_agregando_nivel_a_condicionante.php 693 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. use yii\db\Migration;
  3. /**
  4. * Class m240803_012148_agregando_nivel_a_condicionante
  5. */
  6. class m240803_012148_agregando_nivel_a_condicionante extends Migration {
  7. /**
  8. * {@inheritdoc}
  9. */
  10. public function safeUp() {
  11. $this->addColumn('Condicionante', 'idNivel', $this->string(36));
  12. $this->addForeignKey(
  13. 'fk_Condicionante_Nivel',
  14. 'Condicionante',
  15. 'idNivel',
  16. 'Nivel',
  17. 'id',
  18. );
  19. }
  20. /**
  21. * {@inheritdoc}
  22. */
  23. public function safeDown() {
  24. $this->dropForeignKey('fk_Condicionante_Nivel', 'Condicionante');
  25. $this->dropColumn('Condicionante', 'idNivel');
  26. }
  27. }