-- Migration from 045 to 046\012\012------------------------------------------------------------------------------------\012--  Purpose:  allow longer codes \012------------------------------------------------------------------------------------\012\012-- Switch all uses of the domain code (there are a lot of them!) to use varchar(40)\012alter table CONTROLLED_VOCABULARIES alter column CODE type varchar(40);\012alter table DATA alter column CODE type varchar(40), alter column DATA_PRODUCER_CODE type varchar(40);\012alter table DATABASE_INSTANCES alter column CODE type varchar(40), alter column UUID type varchar(40);\012alter table DATA_STORES alter column CODE type varchar(40);\012alter table DATA_TYPES alter column CODE type varchar(40);\012alter table EXPERIMENTS alter column PERM_ID type varchar(40), alter column CODE type varchar(40);\012alter table EXPERIMENT_TYPES alter column CODE type varchar(40);\012alter table FILE_FORMAT_TYPES alter column CODE type varchar(40);\012alter table GROUPS alter column CODE type varchar(40);\012alter table LOCATOR_TYPES alter column CODE type varchar(40);\012alter table MATERIALS alter column CODE type varchar(40);\012alter table MATERIAL_TYPES alter column CODE type varchar(40);\012alter table DATA_SET_TYPES alter column CODE type varchar(40);\012alter table PROJECTS alter column CODE type varchar(40);\012alter table PROPERTY_TYPES alter column CODE type varchar(40);\012alter table SAMPLES alter column PERM_ID type varchar(40), alter column CODE type varchar(40);\012alter table SAMPLE_TYPES alter column CODE type varchar(40), alter column generated_code_prefix type varchar(40);\012alter table AUTHORIZATION_GROUPS alter column CODE type varchar(40);\012\012-- Convert CODE to VARCHAR(60)\012drop DOMAIN CODE;\012create DOMAIN CODE as varchar(60);\012\012-- Switch all columns back to using the domain code\012alter table CONTROLLED_VOCABULARIES alter column CODE type CODE;\012alter table DATA alter column CODE type CODE, alter column DATA_PRODUCER_CODE type CODE;\012alter table DATABASE_INSTANCES alter column CODE type CODE, alter column UUID type CODE;\012alter table DATA_STORES alter column CODE type CODE;\012alter table DATA_TYPES alter column CODE type CODE;\012alter table EXPERIMENTS alter column PERM_ID type CODE, alter column CODE type CODE;\012alter table EXPERIMENT_TYPES alter column CODE type CODE;\012alter table FILE_FORMAT_TYPES alter column CODE type CODE;\012alter table GROUPS alter column CODE type CODE;\012alter table LOCATOR_TYPES alter column CODE type CODE;\012alter table MATERIALS alter column CODE type CODE;\012alter table MATERIAL_TYPES alter column CODE type CODE;\012alter table DATA_SET_TYPES alter column CODE type CODE;\012alter table PROJECTS alter column CODE type CODE;\012alter table PROPERTY_TYPES alter column CODE type CODE;\012alter table SAMPLES alter column PERM_ID type CODE, alter column CODE type CODE;\012alter table SAMPLE_TYPES alter column CODE type CODE, alter column generated_code_prefix type CODE;\012alter table AUTHORIZATION_GROUPS alter column CODE type CODE;\012