You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
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. }