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

Add topological sorting for dumped views using TSort #416

Merged
merged 4 commits into from
May 15, 2024

Conversation

calebhearth
Copy link
Contributor

Co-authored-by: Mykhaylo Sorochan [email protected]
Co-authored-by: Edward Loveall [email protected]

calebhearth and others added 4 commits May 2, 2024 08:56
Also remove ~>0.19 constraint on pg gem, which conflicts with ~>1.1
constraint in Gemfile
Upcoming changes like [topological sorting][1] have the potential to
write views to `db/schema.rb` in an order that does not respect
dependencies. This adds a test to ensure that views in all schemas are
both included, and in the correct dependency order.

[1]: #398
Co-authored-by: Mykhaylo Sorochan <[email protected]>
Co-authored-by: Edward Loveall <[email protected]>
@calebhearth calebhearth merged commit 7e32921 into main May 15, 2024
5 checks passed
@calebhearth calebhearth deleted the new-views-ordering branch May 15, 2024 01:21
@cdinger
Copy link

cdinger commented Jun 29, 2024

Should this postgres-specific code live in the postgres adpater? I think this will break the other adapters unless they monkey-patch Scenic::SchemaDumper to override the postgres query and assumptions around what Scenic.database.execute returns.

I've started looking at this for the Oracle adapter and this is the only solution I've come up with.

@calebhearth
Copy link
Contributor Author

No I think you're right, this should have been part of an adapter.

calebhearth added a commit that referenced this pull request Nov 20, 2024
This is Postgres-specific code, and it shouldn't have been here.

#416 (comment)
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

Successfully merging this pull request may close these issues.

4 participants