misuzu/database/2024_09_16_205613_add_role_id_string.php

13 lines
468 B
PHP

<?php
use Index\Data\IDbConnection;
use Index\Data\Migration\IDbMigration;
final class AddRoleIdString_20240916_205613 implements IDbMigration {
public function migrate(IDbConnection $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);
}
}