Removed leftovers from chat token system.
This commit is contained in:
parent
4a3a28629b
commit
fb77a936f5
5 changed files with 28 additions and 121 deletions
26
database/2022_01_13_005600_nuke_chat_tokens_table.php
Normal file
26
database/2022_01_13_005600_nuke_chat_tokens_table.php
Normal file
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
namespace Misuzu\DatabaseMigrations\NukeChatTokensTable;
|
||||
|
||||
use PDO;
|
||||
|
||||
function migrate_up(PDO $conn): void {
|
||||
$conn->exec("DROP TABLE `msz_user_chat_tokens`");
|
||||
}
|
||||
|
||||
function migrate_down(PDO $conn): void {
|
||||
$conn->exec("
|
||||
CREATE TABLE `msz_user_chat_tokens` (
|
||||
`user_id` INT(10) UNSIGNED NOT NULL,
|
||||
`token_string` CHAR(64) NOT NULL,
|
||||
`token_created` TIMESTAMP NOT NULL DEFAULT current_timestamp(),
|
||||
UNIQUE INDEX `user_chat_token_string_unique` (`token_string`),
|
||||
INDEX `user_chat_token_user_foreign` (`user_id`),
|
||||
INDEX `user_chat_token_created_key` (`token_created`),
|
||||
CONSTRAINT `user_chat_token_user_foreign`
|
||||
FOREIGN KEY (`user_id`)
|
||||
REFERENCES `msz_users` (`user_id`)
|
||||
ON UPDATE CASCADE
|
||||
ON DELETE CASCADE
|
||||
) COLLATE='utf8mb4_bin' ENGINE=InnoDB;
|
||||
");
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue