awaki/database/2023_01_07_191402_initial_structure.php

19 lines
729 B
PHP
Raw Permalink Normal View History

2023-01-07 21:16:49 +00:00
<?php
use Index\Data\IDbConnection;
use Index\Data\Migration\IDbMigration;
final class InitialStructure_20230107_191402 implements IDbMigration {
public function migrate(IDbConnection $conn): void {
$conn->execute('
CREATE TABLE awk_redirects (
redir_id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
redir_vanity VARCHAR(255) DEFAULT NULL,
redir_url VARCHAR(255) NOT NULL,
redir_created TIMESTAMP NOT NULL DEFAULT current_timestamp(),
PRIMARY KEY (redir_id),
UNIQUE KEY awk_redir_vanity_unique (redir_vanity)
) ENGINE=InnoDB COLLATE=utf8mb4_bin;
');
}
}