Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move MDS table schema #87

Open
hunterowens opened this issue Oct 29, 2019 · 5 comments
Open

move MDS table schema #87

hunterowens opened this issue Oct 29, 2019 · 5 comments
Assignees

Comments

@hunterowens
Copy link
Contributor

current the schema for all the MDS is the default public schema. Let's switch this to mds or transportation

the existing mds schema has some loaded data from an attempt to get mds-provider-services package from the City of SM working that is not ideal for our usage.

@ian-r-rose
Copy link
Contributor

Some documentation: https://www.postgresql.org/docs/current/sql-altertable.html

Action items:

  1. Remove old/bad tables from the current mds schema.
  2. Move trips and status_changes to mds.

Question: can mds-provider be configured to insert into a schema?

@RMK0110
Copy link
Contributor

RMK0110 commented Dec 2, 2019

The ALTER TABLE...SET SCHEMA command will move tables, data, index, contraints and sequences to the 'mds' schema, but not the trigger functions: route_process( ) and status_change_processor ( ). The triggers need to be added using ALTER FUNCTION....SET SCHEMA.

@hunterowens
Copy link
Contributor Author

The script for the triggers is here if you need to recreate them.

For change management, we will need to modify dependent users of the tables. Which I believe are the scooter-stat DAG, some of the neighborhood-scoots notebooks from @ian-r-rose, and @paultsan's dashboards. LMK if I missed anything.

@ian-r-rose
Copy link
Contributor

I have no problem updating my notebooks and DAGs to point to the new tables.

@RMK0110
Copy link
Contributor

RMK0110 commented Dec 2, 2019

https://gist.github.com/RMK0110/e18d2b877e5169f208a4ff33c4806424
A gist showing the script for sending the tables and triggers to a new schema.

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

No branches or pull requests

3 participants