Built redirector service into Misuzu.
This commit is contained in:
parent
a83cfdc595
commit
f2233c5390
18 changed files with 612 additions and 2 deletions
28
database/2025_01_29_002819_create_redirect_tables.php
Normal file
28
database/2025_01_29_002819_create_redirect_tables.php
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
use Index\Db\DbConnection;
|
||||
use Index\Db\Migration\DbMigration;
|
||||
|
||||
final class CreateRedirectTables_20250129_002819 implements DbMigration {
|
||||
public function migrate(DbConnection $conn): void {
|
||||
$conn->execute(<<<SQL
|
||||
CREATE TABLE msz_redirects_named (
|
||||
redir_id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
redir_vanity VARCHAR(255) NOT NULL COLLATE 'ascii_general_ci',
|
||||
redir_url VARCHAR(255) NOT NULL COLLATE 'ascii_bin',
|
||||
redir_clicks BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
|
||||
redir_created TIMESTAMP NOT NULL DEFAULT current_timestamp(),
|
||||
PRIMARY KEY (redir_id),
|
||||
UNIQUE INDEX redirects_vanity_unique (redir_vanity)
|
||||
) ENGINE=InnoDB COLLATE='utf8mb4_bin'
|
||||
SQL);
|
||||
|
||||
$conn->execute(<<<SQL
|
||||
CREATE TABLE msz_redirects_incremental (
|
||||
redir_id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
redir_url VARCHAR(255) NOT NULL COLLATE 'utf8mb4_bin',
|
||||
redir_created TIMESTAMP NOT NULL DEFAULT current_timestamp(),
|
||||
PRIMARY KEY (redir_id)
|
||||
) ENGINE=InnoDB COLLATE='utf8mb4_bin'
|
||||
SQL);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue