diff --git a/database/2023_11_06_004121_initial_structure.php b/database/2023_11_06_004121_initial_structure.php deleted file mode 100644 index e1b2848..0000000 --- a/database/2023_11_06_004121_initial_structure.php +++ /dev/null @@ -1,24 +0,0 @@ -query('SHOW TABLES'); - while($result->next()) - $existingTables[] = $result->getString(0); - - if(!in_array('exchange-rates', $existingTables)) - $conn->execute(' - CREATE TABLE `exchange-rates` ( - rate_from BINARY(3) NOT NULL, - rate_to BINARY(3) NOT NULL, - rate_value DECIMAL(20,6) NOT NULL, - rate_stored TIMESTAMP NOT NULL DEFAULT current_timestamp(), - PRIMARY KEY (rate_from, rate_to), - KEY rate_stored (rate_stored) - ) ENGINE=InnoDB COLLATE="utf8mb4_bin" - '); - } -} diff --git a/tools/migrate b/tools/migrate deleted file mode 100755 index 09eaacf..0000000 --- a/tools/migrate +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env php -getDatabase(); - - echo 'Creating migration manager...' . PHP_EOL; - $manager = $db->createMigrationManager(); - - echo 'Preparing to run migrations...' . PHP_EOL; - $manager->init(); - - echo 'Creating migration repository...' . PHP_EOL; - $repo = $db->createMigrationRepo(); - - echo 'Running migrations...' . PHP_EOL; - $completed = $manager->processMigrations($repo); - - if(empty($completed)) { - echo 'There were no migrations to run!' . PHP_EOL; - } else { - echo 'The following migrations have been completed:' . PHP_EOL; - foreach($completed as $migration) - echo ' - ' . $migration . PHP_EOL; - } - - echo PHP_EOL; -} finally { - unlink(SAT_ROOT . '/.migrating'); -} diff --git a/tools/new-migration b/tools/new-migration deleted file mode 100755 index c30ca8d..0000000 --- a/tools/new-migration +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env php -getDatabase(); -$repo = $db->createMigrationRepo(); -if(!($repo instanceof FsDbMigrationRepo)) { - echo 'Migration repository type does not support creation of templates.' . PHP_EOL; - return; -} - -$baseName = implode(' ', array_slice($argv, 1)); -$manager = $db->createMigrationManager(); - -try { - $names = $manager->createNames($baseName); -} catch(InvalidArgumentException $ex) { - echo $ex->getMessage() . PHP_EOL; - return; -} - -$repo->saveMigrationTemplate($names->name, $manager->template($names->className)); - -echo "Template for '{$names->className}' has been saved to {$names->name}.php." . PHP_EOL;