Skip to content

Commit

Permalink
Merge pull request #1762 from sharetribe/migrate-listingsids-oldoptse…
Browse files Browse the repository at this point in the history
…lections

Populate listing id to previously created option selections
  • Loading branch information
ovan committed Feb 23, 2016
2 parents 3faa955 + 0bf7b75 commit 2d37560
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -8,6 +8,10 @@ This file follows the best practices from [keepachangelog.com](http://keepachang

## [Unreleased]

### Changed

- Add listing id to option selections table: [#1761](https://github.com/sharetribe/sharetribe/pull/1761) and [#1762](https://github.com/sharetribe/sharetribe/pull/1762)

## [5.4.0] - 2016-02-22

### Changed
Expand Down
@@ -0,0 +1,12 @@
class MigrateListingIdsToCustomFieldOptionSelections < ActiveRecord::Migration

# Run this population script after all the code changes are deployed first
def up
execute("
UPDATE custom_field_option_selections os, custom_field_values cfv
SET os.listing_id = cfv.listing_id
WHERE cfv.id = os.custom_field_value_id;
")
end

end

0 comments on commit 2d37560

Please sign in to comment.