fix: currency/exchange_rate DDL 加 utf8mb4_unicode_ci 防止 collation mismatch
This commit is contained in:
parent
8f09fc43df
commit
f9cb644e07
@ -11,7 +11,7 @@ CREATE TABLE IF NOT EXISTS accounting.currency (
|
|||||||
decimal_places SMALLINT DEFAULT 2,
|
decimal_places SMALLINT DEFAULT 2,
|
||||||
is_base VARCHAR(1) DEFAULT '0',
|
is_base VARCHAR(1) DEFAULT '0',
|
||||||
status VARCHAR(16) DEFAULT 'active'
|
status VARCHAR(16) DEFAULT 'active'
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||||
|
|
||||||
INSERT IGNORE INTO accounting.currency (id, name, symbol, decimal_places, is_base, status) VALUES
|
INSERT IGNORE INTO accounting.currency (id, name, symbol, decimal_places, is_base, status) VALUES
|
||||||
('CNY', '人民币', '¥', 2, '1', 'active'),
|
('CNY', '人民币', '¥', 2, '1', 'active'),
|
||||||
@ -29,7 +29,7 @@ CREATE TABLE IF NOT EXISTS accounting.exchange_rate (
|
|||||||
effective_date DATE NOT NULL,
|
effective_date DATE NOT NULL,
|
||||||
updated_at DATETIME DEFAULT NULL,
|
updated_at DATETIME DEFAULT NULL,
|
||||||
UNIQUE KEY idx_pair_date (from_currency, to_currency, effective_date)
|
UNIQUE KEY idx_pair_date (from_currency, to_currency, effective_date)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||||
|
|
||||||
INSERT IGNORE INTO accounting.exchange_rate (id, from_currency, to_currency, buy_rate, sell_rate, mid_rate, effective_date) VALUES
|
INSERT IGNORE INTO accounting.exchange_rate (id, from_currency, to_currency, buy_rate, sell_rate, mid_rate, effective_date) VALUES
|
||||||
('er_usd_cny', 'USD', 'CNY', 7.150000, 7.250000, 7.200000, '2025-01-01'),
|
('er_usd_cny', 'USD', 'CNY', 7.150000, 7.250000, 7.200000, '2025-01-01'),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user