-- Remove size limitations of text fields.

DROP DOMAIN COMMENT;
DROP DOMAIN CONTENT_TYPE;
DROP DOMAIN FILE_NAME;
DROP DOMAIN OBJECT_NAME;
DROP DOMAIN PATH_NAME;
DROP DOMAIN USER_CODE;
 
CREATE DOMAIN COMMENT AS TEXT;
CREATE DOMAIN CONTENT_TYPE AS TEXT;
CREATE DOMAIN FILE_NAME AS TEXT;
CREATE DOMAIN OBJECT_NAME AS TEXT;
CREATE DOMAIN PATH_NAME AS TEXT;
CREATE DOMAIN USER_CODE AS TEXT;

ALTER TABLE USERS ALTER COLUMN EMAIL OBJECT_NAME;
ALTER TABLE USERS ALTER COLUMN USER_CODE USER_CODE;
ALTER TABLE USERS ALTER COLUMN FULL_NAME OBJECT_NAME;
ALTER TABLE FILES ALTER COLUMN NAME FILE_NAME;
ALTER TABLE FILES ALTER COLUMN PATH PATH_NAME;
ALTER TABLE FILES ALTER COLUMN COMMENT COMMENT;
ALTER TABLE FILES ALTER COLUMN REGISTRATOR_CODE USER_CODE;
ALTER TABLE FILES ALTER COLUMN CONTENT_TYPE CONTENT_TYPE;
