ALTER TABLE rna_seq_result DROP is_public;

ALTER TABLE exome_seq_result DROP FOREIGN KEY exome_seq_result_FK_dataset;
ALTER TABLE exome_seq_result DROP INDEX exome_seq_result_INDEX_dataset;
ALTER TABLE exome_seq_result DROP dataset_id;
ALTER TABLE exome_seq_result DROP is_public;

ALTER TABLE dataset DROP public_status;

ALTER TABLE project DROP is_public;
ALTER TABLE project ADD public_status VARCHAR(31) NOT NULL;


UPDATE project
SET public_status = CASE
                        WHEN owner_id IS NULL THEN 'PUBLIC'
                        WHEN owner_id IS NOT NULL THEN 'PRIVATE'
    END
WHERE public_status = ''
   OR public_status IS NULL;

DELETE FROM flyway_schema_history where version = 34;
