add Telegram bot id dialogs table and API methods

This commit is contained in:
iIronside
2023-10-25 14:37:29 +03:00
parent da08bcf1b2
commit 5df755ff8b
16 changed files with 450 additions and 33 deletions

View File

@ -0,0 +1,32 @@
<?php
use yii\db\Migration;
/**
* Handles the creation of table `{{%user_tg_bot_dialog}}`.
*/
class m231024_132757_create_user_tg_bot_dialog_table extends Migration
{
/**
* {@inheritdoc}
*/
public function safeUp()
{
$this->createTable('{{%user_tg_bot_dialog}}', [
'id' => $this->primaryKey(),
'user_id' => $this->integer(),
'dialog_id' => $this->integer()->notNull()->unique(),
'created_at' => $this->dateTime(),
'updated_at' => $this->dateTime(),
]);
$this->addForeignKey('user_user_tg_bot_dialog', 'user_tg_bot_dialog', 'user_id', 'user', 'id');
}
/**
* {@inheritdoc}
*/
public function safeDown()
{
$this->dropTable('{{%user_tg_bot_dialog}}');
}
}