From 60840278395f356133d241a9b38f1367cfe42cc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=91cze=20Bence?= Date: Sun, 23 Apr 2023 19:56:33 +0200 Subject: [PATCH] fixup! RVRNEXT-5 add migration for currencies --- .../structure/20230421_2234_currencies.sql | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/database/migrations/structure/20230421_2234_currencies.sql b/database/migrations/structure/20230421_2234_currencies.sql index cc99218..70a0bb4 100644 --- a/database/migrations/structure/20230421_2234_currencies.sql +++ b/database/migrations/structure/20230421_2234_currencies.sql @@ -1,22 +1,10 @@ CREATE TABLE `currencies` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `community_id` int(10) unsigned NOT NULL, - `currency` varchar(3) NOT NULL, + `code` varchar(3) NOT NULL, `round_digits` tinyint(1) unsigned NOT NULL, PRIMARY KEY (`id`), - UNIQUE KEY `unique_currency_for_community` (`community_id`, `currency`), + UNIQUE KEY `unique_currency_for_community` (`community_id`, `code`), KEY `community_id` (`community_id`), - KEY `currency` (`currency`), CONSTRAINT `currencies_community_id` FOREIGN KEY (`community_id`) REFERENCES `communities` (`id`) ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4; - -CREATE TABLE `currency_exchange_rates` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `currency_id` int(10) unsigned NOT NULL, - `exchange_rate` decimal(19,9) unsigned NOT NULL, - `valid_from` timestamp NOT NULL DEFAULT current_timestamp(), - PRIMARY KEY (`id`), - KEY `currency_id` (`currency_id`), - INDEX `valid_from` (`valid_from`), - CONSTRAINT `currency_exchange_rates_currency_id` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`) -) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4;