Skip to content

feat: add a unique constraint for fluxstd#32

Merged
monodera merged 1 commit into
mainfrom
u/monodera/OBSPROC-40
Apr 21, 2023
Merged

feat: add a unique constraint for fluxstd#32
monodera merged 1 commit into
mainfrom
u/monodera/OBSPROC-40

Conversation

@monodera
Copy link
Copy Markdown
Contributor

Unique constraint is set by (obj_id, input_catalog_id, version).

Before applying the modification by alembic, I removed duplicate entries with the following query:

DELETE FROM fluxstd
WHERE fluxstd_id IN (
  SELECT b.fluxstd_id
  FROM fluxstd a
  JOIN fluxstd b ON a.obj_id = b.obj_id
                AND a.input_catalog_id = b.input_catalog_id
                AND a.version = b.version
                AND a.fluxstd_id < b.fluxstd_id
);

DELETE 99887

Unique constraint is set by (obj_id, input_catalog_id, version).

Before applying the modification by alembic, I removed duplicate entries with the following query:

```sql
DELETE FROM fluxstd
WHERE fluxstd_id IN (
  SELECT b.fluxstd_id
  FROM fluxstd a
  JOIN fluxstd b ON a.obj_id = b.obj_id
                AND a.input_catalog_id = b.input_catalog_id
                AND a.version = b.version
                AND a.fluxstd_id < b.fluxstd_id
);

DELETE 99887
```
@monodera monodera merged commit 4cac5d4 into main Apr 21, 2023
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

Successfully merging this pull request may close these issues.

1 participant