aboutsummaryrefslogtreecommitdiffstats
path: root/db
diff options
context:
space:
mode:
Diffstat (limited to 'db')
-rw-r--r--db/migrate/094_remove_old_tags_foreign_key.rb7
-rw-r--r--db/seeds.rb7
2 files changed, 11 insertions, 3 deletions
diff --git a/db/migrate/094_remove_old_tags_foreign_key.rb b/db/migrate/094_remove_old_tags_foreign_key.rb
index 1a87b97c2..839f76334 100644
--- a/db/migrate/094_remove_old_tags_foreign_key.rb
+++ b/db/migrate/094_remove_old_tags_foreign_key.rb
@@ -4,10 +4,11 @@ class RemoveOldTagsForeignKey < ActiveRecord::Migration
execute "ALTER TABLE has_tag_string_tags DROP CONSTRAINT fk_public_body_tags_public_body"
end
- remove_index :public_body_tags, [:public_body_id, :name, :value]
- remove_index :public_body_tags, :name
+ # This table was already removed in the previous migration
+ # remove_index :public_body_tags, [:public_body_id, :name, :value]
+ # remove_index :public_body_tags, :name
- add_index :has_tag_string_tags, [:model, :model_id, :name, :value]
+ add_index :has_tag_string_tags, [:model, :model_id, :name, :value], :name => 'by_model_and_model_id_and_name_and_value'
add_index :has_tag_string_tags, :name
end
diff --git a/db/seeds.rb b/db/seeds.rb
new file mode 100644
index 000000000..664d8c74c
--- /dev/null
+++ b/db/seeds.rb
@@ -0,0 +1,7 @@
+# This file should contain all the record creation needed to seed the database with its default values.
+# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
+#
+# Examples:
+#
+# cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }])
+# Mayor.create(:name => 'Daley', :city => cities.first)