fix(migration): correct SQL syntax for traffic_log index creation

Change ALTER TABLE ADD INDEX IF NOT EXISTS to CREATE INDEX IF NOT EXISTS
to comply with MySQL syntax requirements. The IF NOT EXISTS clause is
only supported with CREATE INDEX statement, not with ALTER TABLE ADD INDEX.
This commit is contained in:
EUForest 2026-02-10 00:25:40 +08:00
parent 0883fb9370
commit bacdf2f301

View File

@ -1,2 +1,2 @@
ALTER TABLE traffic_log ADD INDEX IF NOT EXISTS idx_timestamp (timestamp);
CREATE INDEX IF NOT EXISTS idx_timestamp ON traffic_log (timestamp);