Skip to content

Commit

Permalink
Fix DB migration
Browse files Browse the repository at this point in the history
  • Loading branch information
westonganger committed Oct 17, 2023
1 parent 10f6859 commit 5efeda5
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ def change
t.string :identifier, index: true
t.index [:identifier, :item_id, :item_type], unique: true

t.<%= ActiveSnapshot.config.storage_method == 'native_json' ? 'json' : 'text' %> :metadata, null: false
if ActiveSnapshot.config.storage_method == 'native_json'
t.json :metadata, null: false
else
t.text :metadata, null: false
end

t.datetime :created_at, null: false
end
Expand All @@ -17,7 +21,11 @@ def change
t.belongs_to :snapshot, null: false, index: true
t.belongs_to :item, polymorphic: true, null: false, unique: [:snapshot_id], index: true

t.<%= ActiveSnapshot.config.storage_method == 'native_json' ? 'json' : 'text' %> :object, null: false
if ActiveSnapshot.config.storage_method == 'native_json'
t.json :object, null: false
else
t.text :object, null: false
end

t.datetime :created_at, null: false
t.string :child_group_name
Expand Down

0 comments on commit 5efeda5

Please sign in to comment.