From cc0a6c229fefadc7ff7230cc63e010fb3e1bb251 Mon Sep 17 00:00:00 2001 From: Artur Beljajev Date: Fri, 24 Aug 2018 13:33:39 +0300 Subject: [PATCH] Eliminate three-state boolean --- .../20180824102834_change_notifications_read_to_not_null.rb | 5 +++++ db/structure.sql | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20180824102834_change_notifications_read_to_not_null.rb diff --git a/db/migrate/20180824102834_change_notifications_read_to_not_null.rb b/db/migrate/20180824102834_change_notifications_read_to_not_null.rb new file mode 100644 index 000000000..916a32b28 --- /dev/null +++ b/db/migrate/20180824102834_change_notifications_read_to_not_null.rb @@ -0,0 +1,5 @@ +class ChangeNotificationsReadToNotNull < ActiveRecord::Migration + def change + change_column_null :notifications, :read, false + end +end diff --git a/db/structure.sql b/db/structure.sql index cc4f2e29c..cc1019f47 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -2002,7 +2002,7 @@ CREATE TABLE public.notifications ( text character varying NOT NULL, attached_obj_type character varying, attached_obj_id integer, - read boolean, + read boolean NOT NULL, created_at timestamp without time zone, updated_at timestamp without time zone, creator_str character varying, @@ -4767,3 +4767,5 @@ INSERT INTO schema_migrations (version) VALUES ('20180823174331'); INSERT INTO schema_migrations (version) VALUES ('20180823212823'); +INSERT INTO schema_migrations (version) VALUES ('20180824102834'); +