From 560f2ff538a02520f56d6ba42ab367e886600135 Mon Sep 17 00:00:00 2001 From: Dan Rice Date: Sat, 2 Mar 2013 03:02:05 -0500 Subject: [PATCH] Give the Context.state column a default value of 'active' SQLite does not permit a NOT NULL column to have default value NULL. --- db/migrate/20130227205845_add_state_to_context.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/migrate/20130227205845_add_state_to_context.rb b/db/migrate/20130227205845_add_state_to_context.rb index 6bc888a0..b5f8b085 100644 --- a/db/migrate/20130227205845_add_state_to_context.rb +++ b/db/migrate/20130227205845_add_state_to_context.rb @@ -4,7 +4,7 @@ class AddStateToContext < ActiveRecord::Migration end def up - add_column :contexts, :state, :string, :limit => 20, :null => false + add_column :contexts, :state, :string, :limit => 20, :null => false, :default => 'active' Context.reset_column_information Context.all.each do |c| c.state = c.hide ? 'hidden' : 'active'