django-sharding
django-sharding copied to clipboard
I've tried migrated 32-bit id field to PostgresShardForeignKey
I've tried migrated 32-bit id field to PostgresShardForeignKey And got error:
django.db.utils.ProgrammingError: syntax error at or near "DEFAULT"
LINE 1: ...sages_conversation" ALTER COLUMN "id" TYPE bigint DEFAULT ne...
Here is what manage.py sqlmigrate
command shows:
ALTER TABLE "messages_messagesending"
ALTER COLUMN "id" TYPE bigint DEFAULT next_sharded_id()
USING "id"::bigint
-- What's this for?
DEFAULT next_sharded_id();
Are you sure it was that one, PostgresShardGeneratedIDAutoField
uses that default but PostgresShardForeignKey
doesn't use that from what I can see.
It's been 2 months since this issue was created =) I don't even remember where I caught it. But I guess you are right, as tables' id field is shown in the query, not foreign key to sharding model.
Sorry about that, did a bunch of my other maintainer stuff this past weekend so I'll see what I can do for this one maybe this weekend.