m231017_071711_reaction_button.php 753 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. use yii\db\Schema;
  3. use yii\db\Migration;
  4. class m231017_071711_reaction_button extends Migration
  5. {
  6. public function init()
  7. {
  8. $this->db = 'db';
  9. parent::init();
  10. }
  11. public function safeUp()
  12. {
  13. $tableOptions = 'ENGINE=InnoDB';
  14. $this->createTable(
  15. '{{%reaction_button}}',
  16. [
  17. 'id'=> $this->primaryKey()->unsigned(),
  18. 'counter'=> $this->text()->notNull()->comment('Счётчики json'),
  19. 'type'=> $this->string(32)->notNull()->comment('Метка для разных разделов'),
  20. ],$tableOptions
  21. );
  22. }
  23. public function safeDown()
  24. {
  25. $this->dropTable('{{%reaction_button}}');
  26. }
  27. }