Added counters table for storing numbers of things statically.
This commit is contained in:
parent
35598a01a8
commit
cb40f1efce
12 changed files with 310 additions and 258 deletions
16
database/2023_07_28_212101_create_counters_table.php
Normal file
16
database/2023_07_28_212101_create_counters_table.php
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
use Index\Data\IDbConnection;
|
||||
use Index\Data\Migration\IDbMigration;
|
||||
|
||||
final class CreateCountersTable_20230728_212101 implements IDbMigration {
|
||||
public function migrate(IDbConnection $conn): void {
|
||||
$conn->execute('
|
||||
CREATE TABLE msz_counters (
|
||||
counter_name VARBINARY(64) NOT NULL,
|
||||
counter_value BIGINT(20) NOT NULL DEFAULT "0",
|
||||
counter_updated TIMESTAMP NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
|
||||
PRIMARY KEY (counter_name)
|
||||
) ENGINE=InnoDB COLLATE=utf8mb4_bin
|
||||
');
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue