insert into transactions_new(profile_id, ledger_id, description, year, month, day, comment, data_hash, generation)
select p.id, t.id, t.description, t.year, t.month, t.day, t.comment, t.data_hash, t.generation
from transactions t
insert into transactions_new(profile_id, ledger_id, description, year, month, day, comment, data_hash, generation)
select p.id, t.id, t.description, t.year, t.month, t.day, t.comment, t.data_hash, t.generation
from transactions t