is temporarily down for maintenance” page, run the migration, restart Unicorn, then remove the downtime page. Same as it ever was." https://github.com/blog/517-unicorn
the new name 2. Change Rails model to write data to both columns 3. Exclude the old column from the column cache 4. Deploy the changed code 5. Migrate data 6. Remove old column
triggers to keep data in sync and migrates the data in a transaction 2. Run the migration 3. Deploy the new code (no hacks necessary!) 4. Run a migration that removes now unnecessary triggers
EACH ROW EXECUTE PROCEDURE copy_transaction_to_entry(); ! CREATE TRIGGER replicate_plutus_transaction_id BEFORE INSERT ON plutus_amounts FOR EACH ROW EXECUTE PROCEDURE copy_transaction_id_to_entry_id(); TRIGGERS
id NOT IN (SELECT id FROM plutus_entries); ! SELECT setval('plutus_entries_id_seq', nextval('plutus_transactions_id_seq'), false); ! UPDATE plutus_amounts SET entry_id = transaction_id; MIGRATEDATA