2023-04-30 00:18:14 +00:00
|
|
|
<?php
|
2024-10-05 02:40:29 +00:00
|
|
|
use Index\Db\DbConnection;
|
|
|
|
use Index\Db\Migration\DbMigration;
|
2023-04-30 00:18:14 +00:00
|
|
|
|
2024-10-05 02:40:29 +00:00
|
|
|
final class CreateTopicRedirsTable_20230430_001226 implements DbMigration {
|
|
|
|
public function migrate(DbConnection $conn): void {
|
2023-04-30 00:18:14 +00:00
|
|
|
$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;
|
|
|
|
');
|
|
|
|
}
|
|
|
|
}
|