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

I've tried migrated 32-bit id field to PostgresShardForeignKey #72

Open
M1ha-Shvn opened this issue Dec 13, 2017 · 3 comments
Open

I've tried migrated 32-bit id field to PostgresShardForeignKey #72

M1ha-Shvn opened this issue Dec 13, 2017 · 3 comments

Comments

@M1ha-Shvn
Copy link

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();
@JBKahn
Copy link
Owner

JBKahn commented Feb 11, 2018

Are you sure it was that one, PostgresShardGeneratedIDAutoField uses that default but PostgresShardForeignKey doesn't use that from what I can see.

@M1ha-Shvn
Copy link
Author

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.

@JBKahn
Copy link
Owner

JBKahn commented Feb 12, 2018

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.

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