 update interpro_prod.matches m_outer set m_outer.cv_evidence_id=(select cve_inner.cv_evidence_id from interpro_prod.cv_evidence cve_inner where m_outer.evidence=cve_inner.code);
 
 
-create table interpro_prod.common_annotation as select ann_id, name, text, comments from interpro10.common_annotation limit 10000000;
+create table interpro_prod.common_annotation as select ann_id, name, text, comments from interpro_src_data.common_annotation;
 alter table interpro_prod.common_annotation add column common_annotation_id INTEGER(32) AUTO_INCREMENT primary key first;
 
 
-create table interpro_prod.entry2common_annotation as select entry_ac, ann_id, order_in from interpro10.entry2common limit 10000000;
+create table interpro_prod.entry2common_annotation as select entry_ac, ann_id, order_in from interpro_src_data.entry2common;
 alter table interpro_prod.entry2common_annotation add column entry2common_annotation_id INTEGER(32) AUTO_INCREMENT primary key first;
 alter table interpro_prod.entry2common_annotation add column entry_id INTEGER(32) after entry2common_annotation_id;
 alter table interpro_prod.entry2common_annotation add column common_annotation_id INTEGER(32) after entry_id;
 update interpro_prod.entry2common_annotation e2ca_outer set e2ca_outer.entry_id=(select e_inner.entry_id from interpro_prod.entry e_inner where e2ca_outer.entry_ac=e_inner.entry_ac);
 update interpro_prod.entry2common_annotation e2ca_outer set e2ca_outer.common_annotation_id=(select ca_inner.common_annotation_id from interpro_prod.common_annotation ca_inner where e2ca_outer.ann_id=ca_inner.ann_id);
 
-create table interpro_prod.entry2cv_database as select entry_ac, dbcode, ac, name from interpro10.entry_xref limit 10000000;
+create table interpro_prod.entry2cv_database as select entry_ac, dbcode, ac, name from interpro_src_data.entry_xref;
 alter table interpro_prod.entry2cv_database add column entry2cv_database_id INTEGER(32) AUTO_INCREMENT primary key first;
 alter table interpro_prod.entry2cv_database add column entry_id INTEGER(32) after entry2cv_database_id;
 alter table interpro_prod.entry2cv_database add column cv_database_id INTEGER(32) after entry_id;
 update interpro_prod.entry2cv_database e2cvd_outer set e2cvd_outer.entry_id=(select e_inner.entry_id from interpro_prod.entry e_inner where e2cvd_outer.entry_ac=e_inner.entry_ac);
 update interpro_prod.entry2cv_database e2cvd_outer set e2cvd_outer.cv_database_id=(select cvd_inner.cv_database_id from interpro_prod.cv_database cvd_inner where e2cvd_outer.dbcode=cvd_inner.dbcode);
 
-create table interpro_prod.entry2method as select entry_ac, method_ac, evidence, ida from interpro10.entry2method limit 10000000;
+create table interpro_prod.entry2method as select entry_ac, method_ac, evidence, ida from interpro_src_data.entry2method;
 alter table interpro_prod.entry2method add column entry2method_id INTEGER(32) AUTO_INCREMENT primary key first;
 alter table interpro_prod.entry2method add column entry_id INTEGER(32) after entry2method_id;
 alter table interpro_prod.entry2method add column method_id INTEGER(32) after entry_id;

update interpro_prod.protein2taxonomy p2t_outer set p2t_outer.taxonomy_id=(select t_inner.taxonomy_id from interpro_prod.taxonomy t_inner where p2t_outer.tax_id=t_inner.taxa_id);


create table interpro_prod.method as select method_ac, name, dbcode, method_date, skip_flag from interpro10.method limit 10000000;
alter table interpro_prod.method add column method_id INTEGER(32) AUTO_INCREMENT primary key first;
alter table interpro_prod.method add column cv_database_id INTEGER(32) after method_id;
update interpro_prod.method m_outer set m_outer.cv_database_id=(select cvd_inner.cv_database_id from interpro_prod.cv_database cvd_inner where m_outer.dbcode=cvd_inner.dbcode);
create index idx_m_method_ac on interpro_prod.method(method_ac);


create table interpro_prod.entry as select entry_ac, entry_type, name, checked, created, short_name from interpro10.entry limit 10000000;
alter table interpro_prod.entry add column entry_id INTEGER(32) AUTO_INCREMENT primary key first;
alter table interpro_prod.entry add column cv_entry_type_id INTEGER(32) after entry_id;
update interpro_prod.entry e_outer set e_outer.cv_entry_type_id=(select cvet_inner.cv_entry_type_id from interpro_prod.cv_entry_type cvet_inner where e_outer.entry_type=cvet_inner.code);
create index idx_e_protein_ac on interpro_prod.entry(entry_ac);

create table interpro_prod.supermatch as select i10s.protein_ac, i10s.entry_ac, i10s.pos_from, i10s.pos_to from interpro10.supermatch i10s, interpro_prod.protein itp where i10s.protein_ac = itp.protein_ac;
alter table interpro_prod.supermatch add column supermatch_id INTEGER(32) AUTO_INCREMENT primary key first;
alter table interpro_prod.supermatch add column protein_id INTEGER(32) after supermatch_id;
alter table interpro_prod.supermatch add column entry_id INTEGER(32) after protein_id;
update interpro_prod.supermatch s_outer set s_outer.protein_id=(select p_inner.protein_id from interpro_prod.protein p_inner where s_outer.protein_ac=p_inner.protein_ac);
update interpro_prod.supermatch s_outer set s_outer.entry_id=(select e_inner.entry_id from interpro_prod.entry e_inner where s_outer.entry_ac=e_inner.entry_ac);

create table interpro_prod.matches as select i10m.protein_ac, i10m.method_ac, i10m.pos_from, i10m.pos_to, i10m.status, i10m.dbcode, i10m.evidence, i10m.seq_date, i10m.match_date, i10m.score from interpro10.matches i10m, interpro_prod.protein itp where i10m.protein_ac = itp.protein_ac;
alter table interpro_prod.matches add column matches_id INTEGER(32) AUTO_INCREMENT primary key first;
alter table interpro_prod.matches add column protein_id INTEGER(32) after matches_id;
alter table interpro_prod.matches add column method_id INTEGER(32) after protein_id;

update interpro_prod.entry2method e2m_outer set e2m_outer.method_id=(select m_inner.method_id from interpro_prod.method m_inner where e2m_outer.method_ac=m_inner.method_ac);
update interpro_prod.entry2method e2m_outer set e2m_outer.cv_evidence_id=(select cve_inner.cv_evidence_id from interpro_prod.cv_evidence cve_inner where e2m_outer.evidence=cve_inner.code);

create table interpro_prod.entry2comp as select entry1_ac, entry2_ac, relation from interpro_src_data.entry2comp;
alter table interpro_prod.entry2comp add column entry2comp_id INTEGER(32) AUTO_INCREMENT primary key first;
alter table interpro_prod.entry2comp add column cv_relation_id INTEGER(32) after entry2comp_id;
alter table interpro_prod.entry2comp add column entry1_id INTEGER(32) after cv_relation_id;
