From 845077d2a03fc90c32f7c799c8d44fbc15287442 Mon Sep 17 00:00:00 2001 From: Aldarien Date: Fri, 19 Mar 2021 23:19:23 -0300 Subject: [PATCH] Migrations for sources --- .../20210315235815_create_values.php | 4 +- .../20210320020631_create_sources.php | 58 +++++++++++++++++++ 2 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 db/migrations/20210320020631_create_sources.php diff --git a/db/migrations/20210315235815_create_values.php b/db/migrations/20210315235815_create_values.php index 651321f..02d4c21 100644 --- a/db/migrations/20210315235815_create_values.php +++ b/db/migrations/20210315235815_create_values.php @@ -43,7 +43,7 @@ class CreateValues extends Phinx\Migration\AbstractMigration 'unique' => false, ]) ->create(); - $this->table('currencies', [ + /*$this->table('currencies', [ 'id' => false, 'primary_key' => ['id'], 'engine' => 'InnoDB', @@ -72,6 +72,6 @@ class CreateValues extends Phinx\Migration\AbstractMigration 'encoding' => 'utf8mb4', 'after' => 'code', ]) - ->create(); + ->create();*/ } } diff --git a/db/migrations/20210320020631_create_sources.php b/db/migrations/20210320020631_create_sources.php new file mode 100644 index 0000000..1d45a2a --- /dev/null +++ b/db/migrations/20210320020631_create_sources.php @@ -0,0 +1,58 @@ +table('sources', [ + 'id' => false, + 'primary_key' => ['id'], + 'engine' => 'InnoDB', + 'encoding' => 'utf8mb4', + 'collation' => 'utf8mb4_general_ci', + 'comment' => '', + 'row_format' => 'DYNAMIC', + ]) + ->addColumn('id', 'integer', [ + 'null' => false, + 'limit' => '10', + 'signed' => false, + 'identity' => 'enable', + ]) + ->addColumn('currency_id', 'integer', [ + 'null' => false, + 'limit' => '10', + 'signed' => false, + 'after' => 'id', + ]) + ->addColumn('url', 'string', [ + 'null' => false, + 'limit' => 255, + 'collation' => 'utf8mb4_general_ci', + 'encoding' => 'utf8mb4', + 'after' => 'currency_id', + ]) + ->addColumn('frecuency', 'string', [ + 'null' => false, + 'limit' => 100, + 'collation' => 'utf8mb4_general_ci', + 'encoding' => 'utf8mb4', + 'after' => 'url', + ]) + ->create(); + } +}