From fccc6eb9f0581a3ae299f4a11e5a38fac8cc573e Mon Sep 17 00:00:00 2001 From: Artur Beljajev Date: Wed, 28 Feb 2018 09:02:23 +0200 Subject: [PATCH] Change `invoices.vat_rate` DB column type #623 --- db/migrate/20180228070102_change_invoices_vat_rate_type.rb | 5 +++++ db/structure.sql | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20180228070102_change_invoices_vat_rate_type.rb diff --git a/db/migrate/20180228070102_change_invoices_vat_rate_type.rb b/db/migrate/20180228070102_change_invoices_vat_rate_type.rb new file mode 100644 index 000000000..2c0790a18 --- /dev/null +++ b/db/migrate/20180228070102_change_invoices_vat_rate_type.rb @@ -0,0 +1,5 @@ +class ChangeInvoicesVatRateType < ActiveRecord::Migration + def change + change_column :invoices, :vat_rate, :decimal, precision: 4, scale: 3 + end +end diff --git a/db/structure.sql b/db/structure.sql index cb47a50c0..3f890fcd9 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -1127,7 +1127,7 @@ CREATE TABLE invoices ( currency character varying NOT NULL, description character varying, reference_no character varying, - vat_rate numeric(10,2) NOT NULL, + vat_rate numeric(4,3) NOT NULL, paid_at timestamp without time zone, seller_id integer, seller_name character varying NOT NULL, @@ -5117,3 +5117,5 @@ INSERT INTO schema_migrations (version) VALUES ('20180228055259'); INSERT INTO schema_migrations (version) VALUES ('20180228064342'); +INSERT INTO schema_migrations (version) VALUES ('20180228070102'); +