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

sea-query statements should qualify schema name #338

Closed
nahuakang opened this issue May 25, 2022 · 1 comment · Fixed by #385
Closed

sea-query statements should qualify schema name #338

nahuakang opened this issue May 25, 2022 · 1 comment · Fixed by #385

Comments

@nahuakang
Copy link
Contributor

nahuakang commented May 25, 2022

Motivation

Linked to sea-orm issue 521: sea-orm-cli migrate should respect the DATABASE_SCHEMA for Postgres in the specified in a project's .env file. This is currently not respected and the migration is done on the public schema.

Proposed Solutions

Update all statement types in sea-query to quantify the schema name for Postgres. Check all stmt in the link below and see if any table reference is of Iden type, it should be changed to TableRef.

Also, some statement support schema scope, for example, type name could have schema prefix e.g. in Postgres. We can update it from Iden to IdenList.

https://github.com/SeaQL/sea-orm/blob/183639dc8c817fbd3211a87c67bcb983db4050ed/sea-orm-migration/src/manager.rs#L37-L89

Additional Information

See discussion here

@billy1624
Copy link
Member

Hey @nahuakang, let me know if you need help :)

@billy1624 billy1624 moved this from Triage to Next Up in SeaQL Dev Tracker Jun 28, 2022
@billy1624 billy1624 moved this to Triage in SeaQL Dev Tracker Jun 28, 2022
@nahuakang nahuakang changed the title sea-query statements should quantify schema name sea-query statements should qualify schema name Jul 23, 2022
@billy1624 billy1624 moved this from Next Up to Done in SeaQL Dev Tracker Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants