-
Notifications
You must be signed in to change notification settings - Fork 293
How to support partitioning using Postgres, atlas and ent #1579
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
Comments
Hey @manttila74 👋 |
Thanks for quick reply. Here is a simplified version of it: func (Anons) Fields() []ent.Field { func (Anons) Edges() []ent.Edge { func (Anons) Indexes() []ent.Index { In ent there is no way of defining multicolumn PKs unless it's an edge schema, see (ent/ent#1949). When the partitioning is removed from the migration file, the following diff will be produced. There the dropping of PK can be seen, which I suspect is the problem. Basically there's two problems here:
-- drop index "anons_sequence_number" from table: "anons" In HCL the reverse-engineer schema looks like this: table "anons" { |
Any updates on this? Looking for a solution. |
Hi,
I have a problem supporting partitioned tables using Postgres, atlas and ent.
I haven't been able to model the partitioned table correctly in ent schema and therefore the atlas migrate lint and migration file generation produce this error:
Error: partition key cannot be added to "xxx" (drop and add is required)
exit status 1
Basically, I think it's because of the multicolumn PK not modeled accordingly. It should contain the partition key with some other fields, one of them being a timestamp.
Any ideas how to solve this?
Thanks,
-Manu
The text was updated successfully, but these errors were encountered: