Made login attempts functions OOP.

This commit is contained in:
flash 2020-05-25 14:15:17 +00:00
parent efee8cb67b
commit 174d25d40f
11 changed files with 196 additions and 106 deletions

View file

@ -0,0 +1,21 @@
<?php
namespace Misuzu\DatabaseMigrations\LoginAttemptsTableFixes;
use PDO;
function migrate_up(PDO $conn): void {
$conn->exec("
ALTER TABLE `msz_login_attempts`
DROP COLUMN `attempt_id`,
ADD INDEX `login_attempts_created_index` (`attempt_created`);
");
}
function migrate_down(PDO $conn): void {
$conn->exec("
ALTER TABLE `msz_login_attempts`
ADD COLUMN `attempt_id` INT UNSIGNED NOT NULL AUTO_INCREMENT FIRST,
DROP INDEX `login_attempts_created_index`,
ADD PRIMARY KEY (`attempt_id`);
");
}