bety
bety copied to clipboard
covariates: Finish making key
- [x] Fix rows with NULL trait_id
- [ ] Add not-NULL constraints
(trait_id, variable_id) is constrained to be unique, but the constituent columns should be constrained to be non-NULL.
Currently, 9 rows have NULL in the trait_id column.
The constraint to add are:
ALTER TABLE covariates ALTER COLUMN trait_id SET NOT NULL;
ALTER TABLE covariates ALTER COLUMN variable_id SET NOT NULL;
I removed the rows with trait_id = null
delete from covariates where trait_id is null