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

31 行
836B

  1. <?php
  2. use yii\db\Migration;
  3. use yii\db\Schema;
  4. class m210303_081449_add_table_group_user extends Migration
  5. {
  6. public function up()
  7. {
  8. $this->createTable('user_group', [
  9. 'id' => 'pk',
  10. 'id_producer' => Schema::TYPE_INTEGER. ' NOT NULL',
  11. 'name' => Schema::TYPE_STRING . ' NOT NULL',
  12. ]);
  13. $this->createTable('user_user_group', [
  14. 'id' => 'pk',
  15. 'id_user' => Schema::TYPE_INTEGER. ' NOT NULL',
  16. 'id_user_group' => Schema::TYPE_INTEGER. ' NOT NULL',
  17. ]);
  18. }
  19. public function down()
  20. {
  21. $this->dropTable('user_group');
  22. $this->dropTable('user_user_group');
  23. }
  24. }