CreateSubjectTable.php 474 B

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