Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

third step of 835 for payment_instructions #4062

Merged
merged 1 commit into from
Jun 17, 2016

Conversation

chadwhitacre
Copy link
Contributor

@chadwhitacre chadwhitacre commented Jun 16, 2016

Drops the old non-id columns.
#835

@chadwhitacre
Copy link
Contributor Author

Blocking on #4061.

@chadwhitacre
Copy link
Contributor Author

Here's the diff between this PR and #4046, showing scant differences between the result of the one-shot version and the zero-downtime version of the migration, apart from the fixes in #4060 (which are included on the latter but not the former):

https://gist.github.com/whit537/b80dc73755d155d6f1784b65adf955a2

@rohitpaulk
Copy link
Contributor

Rebased on master (@9afc3319d9fa53d0841a6476bfc279037c89bdd4), previous head - @cfbdaf1e586385d1efbf7ad0dc614b1f914cbf68

@@ -0,0 +1,17 @@
BEGIN;

DROP VIEW current_payment_instructions;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, why do we have to rebuild the view here? (It made sense in the second step (#4061))

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The view includes the participant and team columns (SELECT [...] *), so if we don't drop those columns here then the next steps will fail.

[gratipay] $ psql gratipay-test
Null display is "¤".
Line style is unicode.
Border style is 2.
psql (9.4.5, server 9.3.2)
Type "help" for help.

gratipay-test=# alter table payment_instructions drop column participant;
ERROR:  cannot drop table payment_instructions column participant because other objects depend on it
DETAIL:  view current_payment_instructions depends on table payment_instructions column participant
HINT:  Use DROP ... CASCADE to drop the dependent objects too.
gratipay-test=#

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aha! Cool.

@rohitpaulk rohitpaulk merged commit bbf79ca into master Jun 17, 2016
@chadwhitacre chadwhitacre deleted the 835-payment_instructions-3 branch June 17, 2016 10:54
@rohitpaulk
Copy link
Contributor

Note to deploy: Run sql/branch.sql after code.

@rohitpaulk
Copy link
Contributor

I can't deploy right now - I'll do it in 2 hours if no one else gets to it first

@chadwhitacre
Copy link
Contributor Author

Okay, I can deploy ...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants