aws-samples / aws-database-migration-samples

A set of sample database and associated items to allow customers to among other things follow along with published database migration recipes.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Re-run PostgresSQL Script

melodyyangaws opened this issue · comments

For some reason, the installation script stops in the middle without exception. As a result, we find database objects are missing, such as generateticketactivity(), or null columns are not updated. This doesn't happen often, but it'd be great if we could have the re-install functionality.
Can you please modify the script to allow re-run ? We need to get the biggest table dms_sample.sporting_event_ticket dropped in the re-run as a higher priority, otherwise, it will keep growing and fill up the DB disk space quickly. Thanks.

Here are errors in the table drop at the moment:
psql:./schema/create-table.sql:35: ERROR: cannot drop table person because other objects depend on it
[ 14.989827] cloud-init[3218]: DETAIL: constraint set_person_id_997578592 on table sporting_event_ticket depends on table person
[ 14.990092] cloud-init[3218]: constraint tph_ticketholder_id_1077578877 on table ticket_purchase_hist depends on table person
[ 14.990355] cloud-init[3218]: constraint tph_transfer_from_id_1093578934 on table ticket_purchase_hist depends on table person
[ 14.990634] cloud-init[3218]: view sporting_event_ticket_info depends on table person
[ 14.990891] cloud-init[3218]: HINT: Use DROP ... CASCADE to drop the dependent objects too.
[ 15.001975] cloud-init[3218]: DROP TABLE
[ 15.017291] cloud-init[3218]: DROP TABLE
[ 15.022581] cloud-init[3218]: DROP TABLE
[ 15.023964] cloud-init[3218]: psql:./schema/create-table.sql:51: ERROR: cannot drop table sporting_event because other objects depend on it
[ 15.024147] cloud-init[3218]: DETAIL: view sporting_event_info depends on table sporting_event
[ 15.024351] cloud-init[3218]: view sporting_event_ticket_info depends on view sporting_event_info
[ 15.024631] cloud-init[3218]: HINT: Use DROP ... CASCADE to drop the dependent objects too.
[ 16.025992] cloud-init[3218]: psql:./schema/create-table.sql:55: ERROR: cannot drop table sporting_event_ticket because other objects depend on it
[ 16.026270] cloud-init[3218]: DETAIL: constraint tph_sport_event_tic_id_1061578820 on table ticket_purchase_hist depends on table sporting_event_ticket
[ 16.026403] cloud-init[3218]: view sporting_event_ticket_info depends on table sporting_event_ticket
[ 16.026546] cloud-init[3218]: HINT: Use DROP ... CASCADE to drop the dependent objects too.
[ 16.033511] cloud-init[3218]: DROP TABLE
[ 16.038725] cloud-init[3218]: DROP TABLE
[ 16.040107] cloud-init[3218]: psql:./schema/create-table.sql:67: ERROR: cannot drop table sport_location because other objects depend on it
[ 16.040258] cloud-init[3218]: DETAIL: constraint home_field_fk_565577053 on table sport_team depends on table sport_location
[ 16.040402] cloud-init[3218]: constraint se_location_id_fk_901578250 on table sporting_event depends on table sport_location
[ 16.040554] cloud-init[3218]: view sporting_event_info depends on table sport_location
[ 16.040697] cloud-init[3218]: view sporting_event_ticket_info depends on view sporting_event_info
[ 16.040864] cloud-init[3218]: HINT: Use DROP ... CASCADE to drop the dependent objects too.
[ 16.041383] cloud-init[3218]: psql:./schema/create-table.sql:71: ERROR: cannot drop table sport_team because other objects depend on it
[ 16.041649] cloud-init[3218]: DETAIL: constraint se_away_team_id_fk_885578193 on table sporting_event depends on table sport_team
[ 16.041780] cloud-init[3218]: constraint se_home_team_id_fk_869578136 on table sporting_event depends on table sport_team
[ 16.041959] cloud-init[3218]: view sporting_event_info depends on table sport_team
[ 16.042096] cloud-init[3218]: view sporting_event_ticket_info depends on view sporting_event_info
[ 16.042256] cloud-init[3218]: HINT: Use DROP ... CASCADE to drop the dependent objects too.
[ 16.042564] cloud-init[3218]: psql:./schema/create-table.sql:75: ERROR: cannot drop table sport_type because other objects depend on it
[ 16.042691] cloud-init[3218]: DETAIL: constraint st_sport_type_fk_581577110 on table sport_team depends on table sport_type
[ 16.042854] cloud-init[3218]: constraint se_sport_type_fk_853578079 on table sporting_event depends on table sport_type
[ 16.042988] cloud-init[3218]: HINT: Use DROP ... CASCADE to drop the dependent objects too.