aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/models/public_body.rb2
-rw-r--r--db/migrate/20140408145616_add_default_short_name_to_public_bodies.rb11
2 files changed, 12 insertions, 1 deletions
diff --git a/app/models/public_body.rb b/app/models/public_body.rb
index 161bc435d..c1868b32c 100644
--- a/app/models/public_body.rb
+++ b/app/models/public_body.rb
@@ -6,7 +6,7 @@
#
# id :integer not null, primary key
# name :text not null
-# short_name :text not null
+# short_name :text default(""), not null
# request_email :text not null
# version :integer not null
# last_edit_editor :string(255) not null
diff --git a/db/migrate/20140408145616_add_default_short_name_to_public_bodies.rb b/db/migrate/20140408145616_add_default_short_name_to_public_bodies.rb
new file mode 100644
index 000000000..5fb239ebd
--- /dev/null
+++ b/db/migrate/20140408145616_add_default_short_name_to_public_bodies.rb
@@ -0,0 +1,11 @@
+class AddDefaultShortNameToPublicBodies < ActiveRecord::Migration
+
+ def up
+ change_column_default(:public_bodies, :short_name, '')
+ end
+
+ def down
+ change_column_default(:public_bodies, :short_name, nil)
+ end
+
+end