JasperFx / weasel

Database Development Made Easy for .Net
MIT License
65 stars 19 forks source link

Schema comparison fixes (Marten GH-1821) #26

Closed VilleHakli closed 3 years ago

VilleHakli commented 3 years ago

Fixes for schema validation failures original reported in JasperFx/marten#1821

I'm not 100% sure about the fix for index equality comparison as there might be cases where parenthesis are significant for equality. I couldn't come up with any examples off the top of my head, so went with the current solution. All tests in Weasel and Marten passed (at least on my machine ;))

This alone does not fully fix the bugs reported in JasperFx/marten#1821, but I will create PR for changes required in Marten.

While running tests, I found that ColumnExpression.DefaultValue(double value) generated invalid SQL if current culture used decimal separator other than ".", so fixed that one also.

VilleHakli commented 3 years ago

PR with changes required in Marten JasperFx/marten#1831

jeremydmiller commented 3 years ago

@VilleHakli I spent a couple hours doing a far, far more complex "fix" to introduce a new IndexDefinition.Parse() method. This is vastly simpler. I'm taking yours in and tossing out my work in progress.

jeremydmiller commented 3 years ago

@VilleHakli I hope you don't mind, but I threaded all the changes from this pull request into what I was doing against IndexDefinition, so I'm closing the PR, but all your code is making it in.

VilleHakli commented 3 years ago

@jeremydmiller fine by me :)