--ABS-126551 Gender fields in Wearer Dialog are NOT Gender neutral

--Wearer

ALTER TABLE WEARER
ADD (MYGENDER VARCHAR2(20) NULL);

COMMENT ON COLUMN WEARER.SEX IS 'M = Male
                                 F = Female
                                 X = Non-binary 
                                 T = Transgender
                                 I = Intersex
                                 S = Let me specify
                                 U = I prefer not to say';
                                 
COMMENT ON COLUMN WEARER.MYGENDER IS 'May only be filled when Sex = S';

UPDATE WEARER
SET SEX='F'
WHERE SEX NOT IN ('F','M','X','T','I','S','U');
COMMIT;

ALTER TABLE WEARER
ADD CONSTRAINT CHK_WEARER_SEX CHECK (SEX IN('F','M','X','T','I','S','U'));

ALTER TABLE WEARER
ADD CONSTRAINT CHK_WEARER_MYGENDER CHECK((SEX='S' AND MYGENDER IS NOT NULL) OR (SEX<>'S' AND MYGENDER IS NULL));

--GDTransaction

ALTER TABLE GDTRANSACTION
ADD (MYGENDER VARCHAR2(20) NULL);

COMMENT ON COLUMN GDTRANSACTION.SEX IS 'M = Male
                                        F = Female
                                        X = Non-binary 
                                        T = Transgender
                                        I = Intersex
                                        S = Let me specify
                                        U = I prefer not to say';

COMMENT ON COLUMN GDTRANSACTION.MYGENDER IS 'May only be filled when Sex = S';

ALTER TABLE GDTRANSACTION
ADD CONSTRAINT CHK_GDTRANSACTION_SEX CHECK (SEX IN('F','M','X','T','I','S','U'));

ALTER TABLE GDTRANSACTION
ADD CONSTRAINT CHK_GDTRANSACTION_MYGENDER CHECK ((SEX='S' AND MYGENDER IS NOT NULL) OR (SEX<>'S' AND MYGENDER IS NULL));
