-
-
Notifications
You must be signed in to change notification settings - Fork 461
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
SQL Generation via marten-patch finds difference in partitions #3603
Comments
@DeJerre It was technically correct to make this issue in Weasel, but I don't monitor Weasel's issue list nearly as closely as I do Marten, so I just saw this today. I think this has already been addressed by recent changes to Weasel & Marten, but I'll verify that soon. Sorry for the delay here. |
The soft deleted partition problem was fixed, but in testing this w/ Marten, I found an additional issue with foreign keys when using the partitioning |
Weirder, this only fails in the command line. I would have sworn up and down there's no difference in functionality between the CLI and directly using IDocumentStore.Storage |
Ugh, ugh, ugh. Weasel is "finding" the existing foreign key that's really attached to the partition table and thinking that exists on the parent table. That's the culprit. Ick, ick, ick. |
Got it! It's going to take a Weasel upgrade to finish this off, but it's on the way. |
Registering a class via
options.Schema.For<ClassName>.DatabaseSchemaName("customschema").SoftDeletedWithPartitioningAndIndex()
and running
marten-patch
via the oakton commands results in a SQL file being created with the following content:CREATE TABLE customschema.mt_doc_class_name_deleted partition of customschema.mt_doc_class_name for values in (TRUE)
Applying these created scripts via Grate results in the tables and partition being created in PostgreSQL with the following partition expression
FOR VALUES IN (true)
During a refresh of the table structure via
marten-patch
a difference in partition definition is found. The expected partition definition isFOR VALUES IN (TRUE)
and the retrieved value isFOR VALUES IN (true)
In
PartitionExtensions.cs:28
theFormatSqlValue<T>
does anToUpperInvariant()
in the case of a bool value. InListPartition.cs:32
theParse()
method reads the current value stored in the PostgreSQL instance containing the lower-case value. InListPartitioning.cs:96
theIPartitionStrategy.CreateDelta()
method checks ifother._partitions.Any(x=> !partitions.Containx(x))
resulting in a Rebuild of the parition that does exist with a different casing on the parition values.Tested via docker database with version
postgres:16.3
The text was updated successfully, but these errors were encountered: