네트워크 이력 DB 저장 전환
This commit is contained in:
@@ -589,6 +589,31 @@ function bootstrap_db(): void
|
||||
COLLATE=utf8mb4_unicode_ci
|
||||
");
|
||||
|
||||
$pdo->exec("
|
||||
CREATE TABLE IF NOT EXISTS network_usage_logs (
|
||||
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
recorded_at DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
|
||||
iface VARCHAR(32) NOT NULL,
|
||||
|
||||
rx_bytes BIGINT UNSIGNED NOT NULL,
|
||||
tx_bytes BIGINT UNSIGNED NOT NULL,
|
||||
rx_packets BIGINT UNSIGNED NOT NULL,
|
||||
tx_packets BIGINT UNSIGNED NOT NULL,
|
||||
|
||||
rx_mbps DECIMAL(12,4) NULL,
|
||||
tx_mbps DECIMAL(12,4) NULL,
|
||||
rx_pps DECIMAL(12,2) NULL,
|
||||
tx_pps DECIMAL(12,2) NULL,
|
||||
|
||||
create_ip VARCHAR(64) NULL,
|
||||
|
||||
INDEX idx_recorded_at (recorded_at),
|
||||
INDEX idx_iface_recorded_at (iface, recorded_at)
|
||||
) ENGINE=InnoDB
|
||||
DEFAULT CHARSET=utf8mb4
|
||||
COLLATE=utf8mb4_unicode_ci
|
||||
");
|
||||
|
||||
$pdo->exec("
|
||||
CREATE TABLE IF NOT EXISTS remember_tokens (
|
||||
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
|
||||
Reference in New Issue
Block a user