misuzu/database/2024_09_16_205613_add_role_id_string.php

14 lines
460 B
PHP
Raw Permalink Normal View History

<?php
2024-10-05 02:40:29 +00:00
use Index\Db\DbConnection;
use Index\Db\Migration\DbMigration;
2024-10-05 02:40:29 +00:00
final class AddRoleIdString_20240916_205613 implements DbMigration {
public function migrate(DbConnection $conn): void {
$conn->execute(<<<SQL
ALTER TABLE msz_roles
ADD COLUMN role_string VARCHAR(20) NULL DEFAULT NULL COLLATE 'ascii_general_ci' AFTER role_id,
ADD UNIQUE INDEX roles_string_unique (role_string);
SQL);
}
}