diff options
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/088_public_body_machine_tags.rb | 18 | ||||
-rw-r--r-- | db/schema.rb | 4 |
2 files changed, 21 insertions, 1 deletions
diff --git a/db/migrate/088_public_body_machine_tags.rb b/db/migrate/088_public_body_machine_tags.rb new file mode 100644 index 000000000..0089607c6 --- /dev/null +++ b/db/migrate/088_public_body_machine_tags.rb @@ -0,0 +1,18 @@ +class PublicBodyMachineTags < ActiveRecord::Migration + def self.up + add_column :public_body_tags, :value, :text + + # MySQL cannot index text blobs like this + # XXX perhaps should change :name/:value to be a :string + if ActiveRecord::Base.connection.adapter_name != "MySQL" + add_index :public_body_tags, :name + end + end + + def self.down + raise "No reverse migration" + #remove_column :public_body_tags, :value + #remove_index :public_body_tags, :name + end +end + diff --git a/db/schema.rb b/db/schema.rb index e172a6e7e..b63c0d8cf 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -9,7 +9,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 87) do +ActiveRecord::Schema.define(:version => 88) do create_table "acts_as_xapian_jobs", :force => true do |t| t.string "model", :null => false @@ -173,9 +173,11 @@ ActiveRecord::Schema.define(:version => 87) do t.integer "public_body_id", :null => false t.text "name", :null => false t.datetime "created_at", :null => false + t.text "value" end add_index "public_body_tags", ["name", "public_body_id"], :name => "index_public_body_tags_on_public_body_id_and_name", :unique => true + add_index "public_body_tags", ["name"], :name => "index_public_body_tags_on_name" create_table "public_body_versions", :force => true do |t| t.integer "public_body_id" |