Skip to content

Commit

Permalink
migration to update category name
Browse files Browse the repository at this point in the history
  • Loading branch information
tansaku committed Apr 23, 2015
1 parent 82ba854 commit 716993d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
2 changes: 1 addition & 1 deletion db/charity_classifications.csv
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ CharityCommissionID,CharityCommissionName,Name
201,CHILDREN/YOUNG PEOPLE,Youth
202,ELDERLY/OLD PEOPLE,Elderly
203,PEOPLE WITH DISABILITIES,People with disabilities
204,PEOPLE OF A PARTICULAR ETHNIC OR RACIAL ORIGIN,Ethnic
204,PEOPLE OF A PARTICULAR ETHNIC OR RACIAL ORIGIN,Ethnic Minorities
205,OTHER CHARITIES OR VOLUNTARY BODIES,Voluntary
206,OTHER DEFINED GROUPS,Other Groups
207,THE GENERAL PUBLIC/MANKIND,General Public
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class ChangeEthnicCategoryToEthnicMinorities < ActiveRecord::Migration
def change
ethnic = Category.find_by_name 'Ethnic'
if ethnic
ethnic.name = 'Ethnic Minorities'
ethnic.save
end
end
end
18 changes: 9 additions & 9 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,30 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20150125154920) do
ActiveRecord::Schema.define(version: 20150423160344) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"

create_table "categories", force: true do |t|
create_table "categories", force: :cascade do |t|
t.string "name"
t.integer "charity_commission_id"
t.string "charity_commission_name"
t.datetime "created_at"
t.datetime "updated_at"
end

create_table "categories_organisations", force: true do |t|
create_table "categories_organisations", force: :cascade do |t|
t.integer "category_id"
t.integer "organisation_id"
end

create_table "features", force: true do |t|
create_table "features", force: :cascade do |t|
t.string "name"
t.boolean "active", default: false
end

create_table "organisations", force: true do |t|
create_table "organisations", force: :cascade do |t|
t.string "name", default: "", null: false
t.string "address", default: "", null: false
t.string "postcode", default: "", null: false
Expand All @@ -54,7 +54,7 @@
t.datetime "deleted_at"
end

create_table "pages", force: true do |t|
create_table "pages", force: :cascade do |t|
t.string "name"
t.string "permalink"
t.text "content"
Expand All @@ -65,7 +65,7 @@

add_index "pages", ["permalink"], name: "index_pages_on_permalink", using: :btree

create_table "proposed_organisation_edits", force: true do |t|
create_table "proposed_organisation_edits", force: :cascade do |t|
t.integer "organisation_id"
t.string "name", default: "", null: false
t.string "address", default: "", null: false
Expand All @@ -86,7 +86,7 @@
add_index "proposed_organisation_edits", ["deleted_at"], name: "index_proposed_organisation_edits_on_deleted_at", using: :btree
add_index "proposed_organisation_edits", ["user_id"], name: "index_proposed_organisation_edits_on_user_id", using: :btree

create_table "users", force: true do |t|
create_table "users", force: :cascade do |t|
t.string "email", default: "", null: false
t.string "encrypted_password", default: ""
t.string "reset_password_token"
Expand Down Expand Up @@ -122,7 +122,7 @@
add_index "users", ["invited_by_id"], name: "index_users_on_invited_by_id", using: :btree
add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true, using: :btree

create_table "volunteer_ops", force: true do |t|
create_table "volunteer_ops", force: :cascade do |t|
t.string "title"
t.text "description"
t.integer "organisation_id"
Expand Down

0 comments on commit 716993d

Please sign in to comment.