M221102091748ChangeSmartformAddonsLinksStatus.php 865 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. namespace addons\SmartForm\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M221102091748ChangeSmartformLinkCategoryStatus
  6. */
  7. class M221102091748ChangeSmartformAddonsLinksStatus extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $this->update('{{%addons_links}}', ['status' => -1], 'addons_name = :name', [':name' => 'SmartForm']);
  15. }
  16. /**
  17. * {@inheritdoc}
  18. */
  19. public function safeDown()
  20. {
  21. $this->update('{{%addons_links}}', ['status' => 1], 'addons_name = :name', [':name' => 'SmartForm']);
  22. }
  23. /*
  24. // Use up()/down() to run migration code without a transaction.
  25. public function up()
  26. {
  27. }
  28. public function down()
  29. {
  30. echo "M221102091748ChangeSmartformLinkCategoryStatus cannot be reverted.\n";
  31. return false;
  32. }
  33. */
  34. }