Fixed collections on the ENUM columns.

This commit is contained in:
flash 2025-02-08 21:27:50 +00:00
parent 31d89a08bf
commit d1173c6e0f

View file

@ -0,0 +1,28 @@
<?php
use Index\Db\DbConnection;
use Index\Db\Migration\DbMigration;
final class FixedCollationsOnNewlyAddedColumns_20250208_212359 implements DbMigration {
public function migrate(DbConnection $conn): void {
$conn->execute(<<<SQL
ALTER TABLE msz_forum_posts
CHANGE COLUMN post_text_format post_text_format ENUM('','bb','md') NOT NULL DEFAULT '' COLLATE 'ascii_general_ci' AFTER post_text;
SQL);
$conn->execute(<<<SQL
ALTER TABLE msz_messages
CHANGE COLUMN msg_body_format msg_body_format ENUM('','bb','md') NOT NULL DEFAULT '' COLLATE 'ascii_general_ci' AFTER msg_body;
SQL);
$conn->execute(<<<SQL
ALTER TABLE msz_profile_backgrounds
CHANGE COLUMN bg_attach bg_attach ENUM('cover','stretch','tile','contain') NOT NULL COLLATE 'ascii_general_ci' AFTER user_id;
SQL);
$conn->execute(<<<SQL
ALTER TABLE msz_users
CHANGE COLUMN user_about_content_format user_about_content_format ENUM('','bb','md') NOT NULL DEFAULT '' COLLATE 'ascii_general_ci' AFTER user_about_content,
CHANGE COLUMN user_signature_content_format user_signature_content_format ENUM('','bb','md') NOT NULL DEFAULT '' COLLATE 'ascii_general_ci' AFTER user_signature_content;
SQL);
}
}