您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

m231113_073008_add_column_feature_position.php 465B

12345678910111213141516171819202122232425
  1. <?php
  2. use yii\db\Migration;
  3. /**
  4. * Class m231113_073008_add_column_feature_position
  5. */
  6. class m231113_073008_add_column_feature_position extends Migration
  7. {
  8. /**
  9. * {@inheritdoc}
  10. */
  11. public function safeUp()
  12. {
  13. $this->addColumn('feature', 'position', $this->integer()->notNull()->defaultValue(0));
  14. }
  15. /**
  16. * {@inheritdoc}
  17. */
  18. public function safeDown()
  19. {
  20. $this->dropColumn('feature', 'position');
  21. }
  22. }