Hi, why isn't user_id unique, only user_id CHAR(3...
# general
w
Hi, why isn't user_id unique, only user_id CHAR(36) NOT NULL ?
r
The unique constraint is added by the all_auth users table
And these are UUIDs
But yea. We could make them unique in the db
w
Do you mean: CREATE TABLE IF NOT EXISTS all_auth_recipe_users( user_id CHAR(36) NOT NULL, recipe_id VARCHAR(128) NOT NULL, time_joined BIGINT NOT NULL, CONSTRAINT all_auth_recipe_users_pkey PRIMARY KEY (user_id) ); CREATE INDEX all_auth_recipe_users_pagination_index ON all_auth_recipe_users (time_joined DESC, user_id DESC); ? And if I add to user_id in tables UNIQUE, there can ba a problems?
r
There won’t be a problem
w
I see. And first question is 'Yes' or 'No'?
r
yes
w
I see and is index adding "UNIQUE"?
r
bi
no*
CONSTRAINT all_auth_recipe_users_pkey PRIMARY KEY (user_id)
is adding unique
w
ah right xd
thanks 🙂
2 Views