1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-02-20 14:54:15 +01:00

[bug] migration 20160704095606 cannot run due to GDPR refactoring

This commit is contained in:
Sylvain 2020-04-08 15:00:22 +02:00
parent 4b9e1322d6
commit 422e3c6236

View File

@ -9,9 +9,12 @@ class CreateWallets < ActiveRecord::Migration[4.2]
t.timestamps null: false
end
User.includes(:invoicing_profile).each do |u|
Wallet.create(invoicing_profile: u.invoicing_profile.id)
end
# create all wallets
execute <<-SQL
INSERT INTO wallets (user, amount, created_at, updated_at)
SELECT users.id, 0, #{DateTime.current.iso8601}, #{DateTime.current.iso8601}
FROM users
SQL
end
def down