Skip to content

Instantly share code, notes, and snippets.

@apolishch
Last active August 12, 2019 23:22
Show Gist options
  • Save apolishch/5f4409e4e146c841229687b9509802bd to your computer and use it in GitHub Desktop.
Save apolishch/5f4409e4e146c841229687b9509802bd to your computer and use it in GitHub Desktop.
policy_migration2.js
export const up = (db, callback) => db.runSql(`
ALTER TABLE flock_payments.payments
DROP CONSTRAINT payments_fkey;
ALTER TABLE flock_policies.policies
ALTER COLUMN id TYPE INT;
ALTER TABLE flock_payments.payments
ALTER COLUMN policy_id TYPE INT;
ALTER TABLE flock_payments.payments
ADD CONSTRAINT (payments_fkey)
FOREIGN KEY policy_id
REFERENCES flock_policies.policies (id);
`, callback)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment