ADD COLUMN biotype varchar(40) AS id(type) INTO gene
ADD COLUMN source varchar(20) INTO gene
ADD COLUMN confidence enum_confidence INTO gene
DROP COLUMN type FROM gene
JOIN TABLE gene, gene_description INTO gene WHERE gene.gene_id = gene_description.gene_id
ADD COLUMN biotype varchar(40) INTO transcript
ADD COLUMN confidence enum_conf INTO transcript
ADD COLUMN description text INTO transcript
COPY TABLE xref INTO xref_temp
DROP COLUMN display_label FROM xref_temp
DROP COLUMN dbprimary_acc FROM xref_temp
DROP COLUMN external_db_id FROM xref_temp
DROP COLUMN version FROM xref_temp
RENAME COLUMN description IN xref_temp TO desc
JOIN TABLE transcript, xref_temp INTO transcript WHERE transcript.display_xref_id = xref_temp.xref_id
ADD COLUMN description_t varchar(255) AS update_null_value(description) INTO transcript
DROP COLUMN description FROM transcript
RENAME COLUMN description_t IN transcript TO description
ADD COLUMN biotype_t varchar(40) AS upd_field_value(biotype) INTO gene
DROP COLUMN biotype FROM gene
RENAME COLUMN biotype_t IN gene TO biotype
COPY TABLE gene INTO gene_temp
DROP COLUMN analysis_id FROM gene_temp
DROP COLUMN display_xref_id FROM gene_temp
DROP COLUMN seq_region_end FROM gene_temp
DROP COLUMN seq_region_id FROM gene_temp
DROP COLUMN seq_region_start FROM gene_temp
DROP COLUMN seq_region_strand FROM gene_temp
DROP COLUMN source FROM gene_temp
DROP COLUMN confidence FROM gene_temp
DROP COLUMN description FROM gene_temp
RENAME COLUMN gene_id IN gene_temp TO gd_id
CREATE TABLE transcript_supporting_feature(transcript_id int(11), feature_type enum_feat, feature_id int(11))
COPY TABLE gene INTO gene_temp
COPY TABLE xref INTO xref_temp
COPY TABLE external_db INTO external_db_temp
DROP COLUMN db_name FROM external_db_temp
DROP COLUMN release FROM external_db_temp
DROP COLUMN dbprimary_acc from xref_temp
DROP COLUMN description from xref_temp
DROP COLUMN display_label from xref_temp
DROP COLUMN version from xref_temp
JOIN TABLE gene_temp, xref_temp INTO gene_temp WHERE gene_temp.display_xref_id = xref_temp.xref_id 
JOIN TABLE gene_temp, external_db_temp INTO gene_temp WHERE gene_temp.external_db_id = external_db_temp.external_db_id 
