From 791e34e6c2dada2068a974e1ab8a484bc2e34abe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Bonal?= Date: Thu, 31 Aug 2017 18:19:01 +0200 Subject: [PATCH] Added a default_value for Product#reading_cache column. --- ...ct.rb => 20170831180835_add_reading_cache_to_product.rb} | 2 +- db/structure.sql | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) rename db/migrate/{20170718143557_add_reading_cache_to_product.rb => 20170831180835_add_reading_cache_to_product.rb} (56%) diff --git a/db/migrate/20170718143557_add_reading_cache_to_product.rb b/db/migrate/20170831180835_add_reading_cache_to_product.rb similarity index 56% rename from db/migrate/20170718143557_add_reading_cache_to_product.rb rename to db/migrate/20170831180835_add_reading_cache_to_product.rb index 2f09b0cab6..9ace6f34cd 100644 --- a/db/migrate/20170718143557_add_reading_cache_to_product.rb +++ b/db/migrate/20170831180835_add_reading_cache_to_product.rb @@ -1,5 +1,5 @@ class AddReadingCacheToProduct < ActiveRecord::Migration def change - add_column :products, :reading_cache, :jsonb + add_column :products, :reading_cache, :jsonb, default: {} end end diff --git a/db/structure.sql b/db/structure.sql index 61ec35f840..0e9516408c 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -5888,7 +5888,7 @@ CREATE TABLE products ( end_of_life_reason character varying, originator_id integer, codes jsonb, - reading_cache jsonb + reading_cache jsonb DEFAULT '{}'::jsonb ); @@ -17863,7 +17863,7 @@ INSERT INTO schema_migrations (version) VALUES ('20170530002312'); INSERT INTO schema_migrations (version) VALUES ('20170602144753'); -INSERT INTO schema_migrations (version) VALUES ('20170718143557'); - INSERT INTO schema_migrations (version) VALUES ('20170804101025'); +INSERT INTO schema_migrations (version) VALUES ('20170831180835'); +