Added ability to add redirects to deleted topic ids.
This commit is contained in:
parent
01c43e38d8
commit
c798ce5d61
11 changed files with 275 additions and 24 deletions
23
database/2023_04_30_001226_create_topic_redirs_table.php
Normal file
23
database/2023_04_30_001226_create_topic_redirs_table.php
Normal file
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
use Index\Data\IDbConnection;
|
||||
use Index\Data\Migration\IDbMigration;
|
||||
|
||||
final class CreateTopicRedirsTable_20230430_001226 implements IDbMigration {
|
||||
public function migrate(IDbConnection $conn): void {
|
||||
$conn->execute('
|
||||
CREATE TABLE msz_forum_topics_redirects (
|
||||
topic_id INT(10) UNSIGNED NOT NULL,
|
||||
user_id INT(10) UNSIGNED NULL DEFAULT NULL,
|
||||
topic_redir_url VARCHAR(255) NOT NULL,
|
||||
topic_redir_created TIMESTAMP NOT NULL DEFAULT current_timestamp(),
|
||||
PRIMARY KEY (topic_id),
|
||||
KEY topics_redirs_user_foreign (user_id),
|
||||
CONSTRAINT topics_redirs_user_foreign
|
||||
FOREIGN KEY (user_id)
|
||||
REFERENCES msz_users (user_id)
|
||||
ON DELETE SET NULL
|
||||
ON UPDATE CASCADE
|
||||
) ENGINE=InnoDB COLLATE=utf8mb4_bin;
|
||||
');
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue