From fb35ec5cbb6dbc2ea9848733923447165c591ec8 Mon Sep 17 00:00:00 2001 From: Artur Beljajev Date: Tue, 13 Mar 2018 14:49:36 +0200 Subject: [PATCH] Require `invoices.total` #623 --- .../20180313124751_change_invoices_total_to_not_null.rb | 5 +++++ db/structure.sql | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20180313124751_change_invoices_total_to_not_null.rb diff --git a/db/migrate/20180313124751_change_invoices_total_to_not_null.rb b/db/migrate/20180313124751_change_invoices_total_to_not_null.rb new file mode 100644 index 000000000..fb31f4084 --- /dev/null +++ b/db/migrate/20180313124751_change_invoices_total_to_not_null.rb @@ -0,0 +1,5 @@ +class ChangeInvoicesTotalToNotNull < ActiveRecord::Migration + def change + change_column_null :invoices, :total, false + end +end diff --git a/db/structure.sql b/db/structure.sql index 6df03a91a..32a7b3891 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -1036,7 +1036,7 @@ CREATE TABLE invoices ( updator_str character varying, number integer, cancelled_at timestamp without time zone, - total numeric(10,2), + total numeric(10,2) NOT NULL, in_directo boolean DEFAULT false ); @@ -4716,3 +4716,5 @@ INSERT INTO schema_migrations (version) VALUES ('20180310142630'); INSERT INTO schema_migrations (version) VALUES ('20180313090437'); +INSERT INTO schema_migrations (version) VALUES ('20180313124751'); +