Skip to content

Commit

Permalink
Fix created_at null error running CreateSpreeProductsStores migration (
Browse files Browse the repository at this point in the history
…#11595)

In #11363 there was an attempt to fix this issue. At that time the fix
only covered the case in which the `created_at` column already existed,
but it did not add a default value for timestamps in the `create_table`
block so that it is taken into account when the table does not exist at
all. This patch provides a default value also in that case.
  • Loading branch information
albertoalmagro committed Jan 9, 2022
1 parent 759a342 commit 446bbe8
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def up
create_table :spree_products_stores do |t|
t.references :product, index: true
t.references :store, index: true
t.timestamps
t.timestamps default: Time.current

t.index [:product_id, :store_id], unique: true
end
Expand Down

0 comments on commit 446bbe8

Please sign in to comment.