From 87686848bccd1745f659fb358bc758c9e4b10599 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Fri, 13 Feb 2015 15:39:44 +1100 Subject: [PATCH] make group contact fields not null --- ...0121030627_add_web_conact_to_enterprise_groups.rb | 10 ---------- ...121030627_add_web_contact_to_enterprise_groups.rb | 10 ++++++++++ db/schema.rb | 12 ++++++------ 3 files changed, 16 insertions(+), 16 deletions(-) delete mode 100644 db/migrate/20150121030627_add_web_conact_to_enterprise_groups.rb create mode 100644 db/migrate/20150121030627_add_web_contact_to_enterprise_groups.rb diff --git a/db/migrate/20150121030627_add_web_conact_to_enterprise_groups.rb b/db/migrate/20150121030627_add_web_conact_to_enterprise_groups.rb deleted file mode 100644 index 1aca6a0e16..0000000000 --- a/db/migrate/20150121030627_add_web_conact_to_enterprise_groups.rb +++ /dev/null @@ -1,10 +0,0 @@ -class AddWebConactToEnterpriseGroups < ActiveRecord::Migration - def change - add_column :enterprise_groups, :email, :string - add_column :enterprise_groups, :website, :string - add_column :enterprise_groups, :facebook, :string - add_column :enterprise_groups, :instagram, :string - add_column :enterprise_groups, :linkedin, :string - add_column :enterprise_groups, :twitter, :string - end -end diff --git a/db/migrate/20150121030627_add_web_contact_to_enterprise_groups.rb b/db/migrate/20150121030627_add_web_contact_to_enterprise_groups.rb new file mode 100644 index 0000000000..afea2dbeea --- /dev/null +++ b/db/migrate/20150121030627_add_web_contact_to_enterprise_groups.rb @@ -0,0 +1,10 @@ +class AddWebContactToEnterpriseGroups < ActiveRecord::Migration + def change + add_column :enterprise_groups, :email, :string, null: false, default: '' + add_column :enterprise_groups, :website, :string, null: false, default: '' + add_column :enterprise_groups, :facebook, :string, null: false, default: '' + add_column :enterprise_groups, :instagram, :string, null: false, default: '' + add_column :enterprise_groups, :linkedin, :string, null: false, default: '' + add_column :enterprise_groups, :twitter, :string, null: false, default: '' + end +end diff --git a/db/schema.rb b/db/schema.rb index c92989be2f..fe9d3f8ca2 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -198,12 +198,12 @@ ActiveRecord::Schema.define(:version => 20150202000203) do t.integer "logo_file_size" t.datetime "logo_updated_at" t.integer "address_id" - t.string "email" - t.string "website" - t.string "facebook" - t.string "instagram" - t.string "linkedin" - t.string "twitter" + t.string "email", :default => "", :null => false + t.string "website", :default => "", :null => false + t.string "facebook", :default => "", :null => false + t.string "instagram", :default => "", :null => false + t.string "linkedin", :default => "", :null => false + t.string "twitter", :default => "", :null => false t.integer "owner_id" end