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 unique constraint for column activity.ap_id #1878

Closed
Nutomic opened this issue Nov 4, 2021 · 2 comments
Closed

Add unique constraint for column activity.ap_id #1878

Nutomic opened this issue Nov 4, 2021 · 2 comments

Comments

@Nutomic
Copy link
Member

Nutomic commented Nov 4, 2021

Then remove function is_activity_already_known(). No need to make a separate query and check in Rust, when we can simply rely on db constraints. The migration needs to delete any existing, duplicate values first.

@dessalines
Copy link
Member

I think this already exists:

Indexes:
    "activity_pkey" PRIMARY KEY, btree (id)
    "idx_activity_unique_apid" UNIQUE, btree ((data ->> 'id'::text))

@Nutomic
Copy link
Member Author

Nutomic commented Nov 5, 2021

I tried and was able to insert duplicate values without any problem.

Btw, another thing I would like to do is change community.public_key into String (instead of Option<String>). Same for person.public_key.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants