feat: add apilayer as provider for fixer api (#127)

feat: add apilayer as provider for fixer api
feat: update exchange rate when saving api key
This commit is contained in:
Miguel Ribeiro
2024-02-20 00:37:38 +01:00
committed by GitHub
parent e726b5c0bf
commit 0f19dd688f
17 changed files with 142 additions and 31 deletions
+12
View File
@@ -0,0 +1,12 @@
<?php
// This migration adds a "provider" column to the fixer table and sets all values to 0.
// It allows the user to chose a different provider for their fixer api keys.
/** @noinspection PhpUndefinedVariableInspection */
$columnQuery = $db->query("SELECT * FROM pragma_table_info('fixer') where name='provider'");
$columnRequired = $columnQuery->fetchArray(SQLITE3_ASSOC) === false;
if ($columnRequired) {
$db->exec('ALTER TABLE fixer ADD COLUMN provider INT DEFAULT 0');
$db->exec('UPDATE fixer SET provider = 0');
}