From 093ddba28f430f7954e97323f1c7be13d1362023 Mon Sep 17 00:00:00 2001 From: Adrien Poly Date: Thu, 15 Feb 2024 01:48:35 +0100 Subject: [PATCH] Update database migrations and strengthen db smoke tests (#462) --- .github/workflows/ci.yml | 2 +- db/migrate/20240206031739_replace_money_field.rb | 2 +- db/migrate/20240209174912_redo_money_storage.rb | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9d92bb91442..a78dd2a7f69 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -96,7 +96,7 @@ jobs: env: RAILS_ENV: test DATABASE_URL: postgres://postgres:postgres@localhost:5432 - run: bin/rails db:reset + run: bin/rails db:drop db:create db:migrate db:seed - name: Keep screenshots from failed system tests uses: actions/upload-artifact@v4 diff --git a/db/migrate/20240206031739_replace_money_field.rb b/db/migrate/20240206031739_replace_money_field.rb index 48e4d188cfa..c89c2cb9872 100644 --- a/db/migrate/20240206031739_replace_money_field.rb +++ b/db/migrate/20240206031739_replace_money_field.rb @@ -1,6 +1,6 @@ class ReplaceMoneyField < ActiveRecord::Migration[7.2] def change - add_column :accounts, :balance_cents + add_column :accounts, :balance_cents, :integer change_column :accounts, :balance_cents, :integer, limit: 8 Account.reset_column_information diff --git a/db/migrate/20240209174912_redo_money_storage.rb b/db/migrate/20240209174912_redo_money_storage.rb index 8550373ce1f..19255c47f87 100644 --- a/db/migrate/20240209174912_redo_money_storage.rb +++ b/db/migrate/20240209174912_redo_money_storage.rb @@ -6,7 +6,6 @@ def change add_column :accounts, :converted_currency, :string, default: "USD" remove_column :accounts, :balance_cents - remove_column :accounts, :balance_currency remove_column :accounts, :currency end end