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 functionality to allow custom indexes with multiple fields including meta data #3557

Open
Martin-Kleinbooi-AbsaAfrica opened this issue Nov 19, 2024 · 1 comment

Comments

@Martin-Kleinbooi-AbsaAfrica

Hi there

It would be nice to have the ability to able to have the control over creating indexes with custom columns which includes meta data and table definition data.

Currently one can only specify either table definition data or meta data indexes.

Reason for this would for e.g. be on partitioning. When a partition is created unique indexes logic breaks because it requires both the mt_deleted field + table definition columns.

  • MessageText: unique constraint on partitioned table must include all partitioning columns
  • Detail: UNIQUE constraint on table "mt_doc_permission" lacks column "mt_deleted" which is part of the partition key.
@jeremydmiller
Copy link
Member

You could do this today if the API just gave you access to the full IndexDefinition model. I think I'd rather make Marten smart enough to "know" what fields are required for partitioned tables and adds those to unique indexes automatically

Happy to have a pull request if you wanna take on the easier first suggestion up there

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

No branches or pull requests

2 participants