From 7437e19de5c4dbb698f64c2e3931e6b8956ab0a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=91cze=20Bence?= Date: Sun, 23 Apr 2023 20:50:45 +0200 Subject: [PATCH] RVRNEXT-5 add migration for currency exchange rates --- .../20230423_2022_currency_exchange_rates.sql | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 database/migrations/structure/20230423_2022_currency_exchange_rates.sql diff --git a/database/migrations/structure/20230423_2022_currency_exchange_rates.sql b/database/migrations/structure/20230423_2022_currency_exchange_rates.sql new file mode 100644 index 0000000..e37020c --- /dev/null +++ b/database/migrations/structure/20230423_2022_currency_exchange_rates.sql @@ -0,0 +1,10 @@ +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;