This repository has been archived on 2025-01-28. You can view files and clone it, but cannot push or open issues or pull requests.
misuzu-interim/database/2020_05_25_152331_sessions_table_fixes.php

14 lines
482 B
PHP
Raw Normal View History

2022-09-13 15:14:49 +02:00
<?php
namespace Misuzu\DatabaseMigrations\SessionsTableFixes;
use PDO;
function migrate_up(PDO $conn): void {
$conn->exec("
ALTER TABLE `msz_sessions`
CHANGE COLUMN `session_key` `session_key` BINARY(64) NOT NULL AFTER `user_id`,
CHANGE COLUMN `session_expires` `session_expires` TIMESTAMP NOT NULL DEFAULT DATE_ADD(NOW(), INTERVAL 1 MONTH) AFTER `session_country`,
ADD INDEX `sessions_created_index` (`session_created`);
");
}