scenic icon indicating copy to clipboard operation
scenic copied to clipboard

Add topological sorting for dumped views using TSort

Open msorc opened this issue 3 years ago • 2 comments

This introduces topological sorting (https://ruby-doc.org/stdlib-2.6.8/libdoc/tsort/rdoc/TSort.html#method-i-tsort) for views in dumps which will sort views alphabetically and in case of dependencies between views will use a topological sorting. That provides a consistent views ordering in database dumps and prevents of having occasional diffs in schema dumps.

Based on discussion here https://github.com/scenic-views/scenic/issues/263 and code samples https://github.com/scenic-views/scenic/issues/263#issuecomment-679167557 and https://github.com/scenic-views/scenic/issues/263#issuecomment-875009521

msorc avatar Sep 24 '21 14:09 msorc

Not sure how do you deal with the Hound so made a separate commit to satisfy it

msorc avatar Sep 24 '21 14:09 msorc

This is great, thank you @msorc this one saved us a bunch of time. Any thoughts on merging this one @derekprior @calebhearth, as it relates to #263. Anvyl would be happy to help QA a pre-release version.

nedcampion avatar Sep 16 '22 15:09 nedcampion

Anyone please merge this to clean up the schema diffs :(

gr8bit avatar Feb 08 '23 22:02 gr8bit

I've rebased this in #398 (but would be fine closing that if @msorc hasn't gotten fed up with me and wants to rebase this themselves) and plan to test this out now that I have an app that sees this issue, which I'm very excited about.

calebhearth avatar Oct 25 '23 15:10 calebhearth

No, I don't want to rebase it myself :) @calebhearth please proceed whichever way to finally merge it.

msorc avatar Oct 25 '23 15:10 msorc

Check my comments above - schema_dumper.rb needs schema on lines 73-74. We are using fork with those changes for almost year without issues.

Unknown-Guy avatar Oct 25 '23 18:10 Unknown-Guy

superseded by #398

derekprior avatar Jan 17 '24 22:01 derekprior