createTable('{{%user_tg_bot_token}}', [ 'id' => $this->primaryKey(), 'user_id' => $this->integer(), 'token' => $this->string()->notNull()->unique(), 'created_at' => $this->dateTime(), 'updated_at' => $this->dateTime(), 'expired_at' => $this->dateTime(), ]); $this->addForeignKey('user_user_tg_bot_token', 'user_tg_bot_token', 'user_id', 'user', 'id'); } /** * {@inheritdoc} */ public function safeDown() { $this->dropTable('user_tg_bot_token'); } }