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

Fix unique key constraint in assets table #287

Closed
guggero opened this issue Mar 7, 2023 · 1 comment
Closed

Fix unique key constraint in assets table #287

guggero opened this issue Mar 7, 2023 · 1 comment

Comments

@guggero
Copy link
Member

guggero commented Mar 7, 2023

Currently the UNIQUE constraint in the assets is broken, since adding the primary key of the table to the UNIQUE constraint basically makes it useless: https://github.com/lightninglabs/taro-private/blob/main/tarodb/sqlc/migrations/000002_assets.up.sql#L177

AFAIK the constraint was changed to allow multiple assets with the NUMS script key.
Instead we could use NULL as the script_key_id, interpret that as being the NUMS point and turn the unique constraint into a CHECK function that checks different uniqueness levels, depending on whether the script_key_id is null or not.

@guggero
Copy link
Member Author

guggero commented Mar 5, 2024

Duplicate of #691.

@guggero guggero closed this as completed Mar 5, 2024
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

1 participant