Migrate from lockbox to ActiveRecord encryption (1/2)
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
class AddLndhubPasswordToUsers < ActiveRecord::Migration[8.0]
|
||||
def change
|
||||
add_column :users, :lndhub_username, :string
|
||||
add_column :users, :lndhub_password, :text
|
||||
end
|
||||
end
|
||||
11
db/migrate/20250506125947_migrate_lockbox_data.rb
Normal file
11
db/migrate/20250506125947_migrate_lockbox_data.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
class MigrateLockboxData < ActiveRecord::Migration[8.0]
|
||||
def up
|
||||
User.find_each do |user|
|
||||
ln_account = user.ln_account
|
||||
ln_password = user.ln_password
|
||||
user.lndhub_username = ln_account
|
||||
user.lndhub_password = ln_password
|
||||
user.save!
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user