CreateUserTable.php 527 B

123456789101112131415161718192021222324
  1. <?php
  2. namespace fphammerle\yii2\auth\clientcert\tests\migrations;
  3. use fphammerle\yii2\auth\clientcert\tests\models\User;
  4. class CreateUserTable extends \yii\db\Migration
  5. {
  6. public function safeUp()
  7. {
  8. $this->createTable(
  9. User::tableName(),
  10. [
  11. 'id' => $this->primaryKey(),
  12. 'username' => $this->string(16)->notNull()->unique(),
  13. ]
  14. );
  15. }
  16. public function safeDown()
  17. {
  18. $this->dropTable(User::tableName());
  19. }
  20. }