File: Changes.sql

package info (click to toggle)
libchado-perl 1.31-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 44,716 kB
  • sloc: sql: 282,721; xml: 192,553; perl: 25,524; sh: 102; python: 73; makefile: 57
file content (787 lines) | stat: -rw-r--r-- 52,186 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
--when schema elements are added, including new tables or changes to table
--columns, or when initialize.sql is changed, the sql to make those changes
--happen should go here.

--gmod version 1.01

--This is a function to seek out exons of transcripts and orders them,
--using feature_relationship.rank, in "transcript order" numbering
--from 0, taking strand into account. It will not touch transcripts that
--already have their exons ordered (in case they have a non-obvious
--ordering due to trans splicing). It takes as an argument the
--feature.type_id of the parent transcript type (typically, mRNA, although
--non coding transcript types should work too).

CREATE OR REPLACE FUNCTION order_exons (integer) RETURNS void AS '
  DECLARE
    parent_type      ALIAS FOR $1;
    exon_id          int;
    part_of          int;
    exon_type        int;
    strand           int;
    arow             RECORD;
    order_by         varchar;
    rowcount         int;
    exon_count       int;
    ordered_exons    int;    
    transcript_id    int;
  BEGIN
    SELECT INTO part_of cvterm_id FROM cvterm WHERE name=''part_of''
      AND cv_id IN (SELECT cv_id FROM cv WHERE name=''relationship'');
    --SELECT INTO exon_type cvterm_id FROM cvterm WHERE name=''exon''
    --  AND cv_id IN (SELECT cv_id FROM cv WHERE name=''sequence'');

    --RAISE NOTICE ''part_of %, exon %'',part_of,exon_type;

    FOR transcript_id IN
      SELECT feature_id FROM feature WHERE type_id = parent_type
    LOOP
      SELECT INTO rowcount count(*) FROM feature_relationship
        WHERE object_id = transcript_id
          AND rank = 0;

      --Dont modify this transcript if there are already numbered exons or
      --if there is only one exon
      IF rowcount = 1 THEN
        --RAISE NOTICE ''skipping transcript %, row count %'',transcript_id,rowcount;
        CONTINUE;
      END IF;

      --need to reverse the order if the strand is negative
      SELECT INTO strand strand FROM featureloc WHERE feature_id=transcript_id;
      IF strand > 0 THEN
          order_by = ''fl.fmin'';      
      ELSE
          order_by = ''fl.fmax desc'';
      END IF;

      exon_count = 0;
      FOR arow IN EXECUTE 
        ''SELECT fr.*, fl.fmin, fl.fmax
          FROM feature_relationship fr, featureloc fl
          WHERE fr.object_id  = ''||transcript_id||''
            AND fr.subject_id = fl.feature_id
            AND fr.type_id    = ''||part_of||''
            ORDER BY ''||order_by
      LOOP
        --number the exons for a given transcript
        UPDATE feature_relationship
          SET rank = exon_count 
          WHERE feature_relationship_id = arow.feature_relationship_id;
        exon_count = exon_count + 1;
      END LOOP; 

    END LOOP;

  END;
' LANGUAGE 'plpgsql';


--added foreign key for pub_id to phenotype_comparison_cvterm
ALTER TABLE phenotype_comparison_cvterm ADD FOREIGN KEY (pub_id) references pub (pub_id) on delete cascade;

--Changed the Audit table triggers to work with newer versions of Postgres.
--This didn't change the the default schema at all (since audit.sql isn't
--part of the default schema.

--all_feature_name view also searches featureprop and dbxref.accesion
--see the comments in modules/sequence/sequence_views.sql  for more
--information on how this works
CREATE OR REPLACE VIEW all_feature_names (
  feature_id,
  name
) AS
SELECT feature_id,CAST(substring(uniquename from 0 for 255) as varchar(255)) as name FROM feature
UNION
SELECT feature_id, name FROM feature where name is not null
UNION
SELECT fs.feature_id,s.name FROM feature_synonym fs, synonym s
  WHERE fs.synonym_id = s.synonym_id
UNION
SELECT fp.feature_id, CAST(substring(fp.value from 0 for 255) as varchar(255)) as name FROM featureprop fp
UNION
SELECT fd.feature_id, d.accession FROM feature_dbxref fd, dbxref d
  WHERE fd.dbxref_id = d.dbxref_id;


DROP VIEW all_feature_names;
CREATE OR REPLACE VIEW all_feature_names (
  feature_id,
  name,
  organism_id
) AS
SELECT feature_id,CAST(substring(uniquename from 0 for 255) as varchar(255)) as name,organism_id FROM feature
UNION
SELECT feature_id, name, organism_id FROM feature where name is not null
UNION
SELECT fs.feature_id,s.name,f.organism_id FROM feature_synonym fs, synonym s, feature f
  WHERE fs.synonym_id = s.synonym_id AND fs.feature_id = f.feature_id
UNION
SELECT fp.feature_id, CAST(substring(fp.value from 0 for 255) as varchar(255)) as name,f.organism_id FROM featureprop fp, feature f
  WHERE f.feature_id = fp.feature_id
UNION
SELECT fd.feature_id, d.accession, f.organism_id FROM feature_dbxref fd, dbxref d,feature f
  WHERE fd.dbxref_id = d.dbxref_id AND fd.feature_id = f.feature_id;


--all of the primary keys were changed to be bigserial/bigint

ALTER TABLE cell_line ALTER COLUMN cell_line_id TYPE bigserial;
ALTER TABLE cell_line_relationship ALTER COLUMN cell_line_relationship_id TYPE bigserial;
ALTER TABLE cell_line_synonym ALTER COLUMN cell_line_synonym_id TYPE bigserial;
ALTER TABLE cell_line_cvterm ALTER COLUMN cell_line_cvterm_id TYPE bigserial;
ALTER TABLE cell_line_dbxref ALTER COLUMN cell_line_dbxref_id TYPE bigserial;
ALTER TABLE cell_lineprop ALTER COLUMN cell_lineprop_id TYPE bigserial;
ALTER TABLE cell_lineprop_pub ALTER COLUMN cell_lineprop_pub_id TYPE bigserial;
ALTER TABLE cell_line_feature ALTER COLUMN cell_line_feature_id TYPE bigserial;
ALTER TABLE cell_line_cvtermprop ALTER COLUMN cell_line_cvtermprop_id TYPE bigserial;
ALTER TABLE cell_line_pub ALTER COLUMN cell_line_pub_id TYPE bigserial;
ALTER TABLE cell_line_library ALTER COLUMN cell_line_library_id TYPE bigserial;
ALTER TABLE analysis ALTER COLUMN analysis_id TYPE bigserial;
ALTER TABLE analysisprop ALTER COLUMN analysisprop_id TYPE bigserial;
ALTER TABLE analysisfeature ALTER COLUMN analysisfeature_id TYPE bigserial;
ALTER TABLE contact ALTER COLUMN contact_id TYPE bigserial;
ALTER TABLE contact_relationship ALTER COLUMN contact_relationship_id TYPE bigserial;
ALTER TABLE cv ALTER COLUMN cv_id TYPE bigserial;
ALTER TABLE cvterm ALTER COLUMN cvterm_id TYPE bigserial;
ALTER TABLE cvterm_relationship ALTER COLUMN cvterm_relationship_id TYPE bigserial;
ALTER TABLE cvtermpath ALTER COLUMN cvtermpath_id TYPE bigserial;
ALTER TABLE cvtermsynonym ALTER COLUMN cvtermsynonym_id TYPE bigserial;
ALTER TABLE cvterm_dbxref ALTER COLUMN cvterm_dbxref_id TYPE bigserial;
ALTER TABLE cvtermprop ALTER COLUMN cvtermprop_id TYPE bigserial; 
ALTER TABLE dbxrefprop ALTER COLUMN dbxrefprop_id TYPE bigserial;
ALTER TABLE cvprop ALTER COLUMN cvprop_id TYPE bigserial;
ALTER TABLE chadoprop ALTER COLUMN chadoprop_id TYPE bigserial;
ALTER TABLE expression ALTER COLUMN expression_id TYPE bigserial;
ALTER TABLE expression_cvterm ALTER COLUMN expression_cvterm_id TYPE bigserial;
ALTER TABLE expression_cvtermprop ALTER COLUMN expression_cvtermprop_id TYPE bigserial;
ALTER TABLE expressionprop ALTER COLUMN expressionprop_id TYPE bigserial;
ALTER TABLE expression_pub ALTER COLUMN expression_pub_id TYPE bigserial;
ALTER TABLE feature_expression ALTER COLUMN feature_expression_id TYPE bigserial;
ALTER TABLE feature_expressionprop ALTER COLUMN feature_expressionprop_id TYPE bigserial;
ALTER TABLE eimage ALTER COLUMN eimage_id TYPE bigserial;
ALTER TABLE expression_image ALTER COLUMN expression_image_id TYPE bigserial;
ALTER TABLE tableinfo ALTER COLUMN tableinfo_id TYPE bigserial;
ALTER TABLE db ALTER COLUMN db_id TYPE bigserial;
ALTER TABLE dbxref ALTER COLUMN dbxref_id TYPE bigserial;
ALTER TABLE genotype ALTER COLUMN genotype_id TYPE bigserial;
ALTER TABLE feature_genotype ALTER COLUMN feature_genotype_id TYPE bigserial;
ALTER TABLE environment ALTER COLUMN environment_id TYPE bigserial;
ALTER TABLE environment_cvterm ALTER COLUMN environment_cvterm_id TYPE bigserial;
ALTER TABLE phenstatement ALTER COLUMN phenstatement_id TYPE bigserial;
ALTER TABLE phendesc ALTER COLUMN phendesc_id TYPE bigserial;
ALTER TABLE phenotype_comparison ALTER COLUMN phenotype_comparison_id TYPE bigserial;
ALTER TABLE phenotype_comparison_cvterm ALTER COLUMN phenotype_comparison_cvterm_id TYPE bigserial;
ALTER TABLE genotypeprop ALTER COLUMN genotypeprop_id TYPE bigserial;
ALTER TABLE interaction ALTER COLUMN interaction_id TYPE bigserial;
ALTER TABLE interactionprop ALTER COLUMN interactionprop_id TYPE bigserial;
ALTER TABLE interactionprop_pub ALTER COLUMN interactionprop_pub_id TYPE bigserial;
ALTER TABLE interaction_pub ALTER COLUMN interaction_pub_id TYPE bigserial;
ALTER TABLE interaction_expression ALTER COLUMN interaction_expression_id TYPE bigserial;
ALTER TABLE interaction_expressionprop ALTER COLUMN interaction_expressionprop_id TYPE bigserial;
ALTER TABLE interaction_cvterm ALTER COLUMN interaction_cvterm_id TYPE bigserial;
ALTER TABLE interaction_cvtermprop ALTER COLUMN interaction_cvtermprop_id TYPE bigserial;
ALTER TABLE feature_interaction ALTER COLUMN feature_interaction_id TYPE bigserial;
ALTER TABLE feature_interactionprop ALTER COLUMN feature_interactionprop_id TYPE bigserial;
ALTER TABLE feature_interaction_pub ALTER COLUMN feature_interaction_pub_id TYPE bigserial;
ALTER TABLE interaction_cell_line ALTER COLUMN interaction_cell_line_id TYPE bigserial;
ALTER TABLE interaction_group ALTER COLUMN interaction_group_id TYPE bigserial;
ALTER TABLE interaction_group_feature_interaction ALTER COLUMN interaction_group_feature_interaction_id TYPE bigserial;
ALTER TABLE library ALTER COLUMN library_id TYPE bigserial;
ALTER TABLE library_synonym ALTER COLUMN library_synonym_id TYPE bigserial;
ALTER TABLE library_pub ALTER COLUMN library_pub_id TYPE bigserial;
ALTER TABLE libraryprop ALTER COLUMN libraryprop_id TYPE bigserial;
ALTER TABLE libraryprop_pub ALTER COLUMN libraryprop_pub_id TYPE bigserial;
ALTER TABLE library_cvterm ALTER COLUMN library_cvterm_id TYPE bigserial;
ALTER TABLE library_feature ALTER COLUMN library_feature_id TYPE bigserial;
ALTER TABLE library_dbxref ALTER COLUMN library_dbxref_id TYPE bigserial;
ALTER TABLE library_expression ALTER COLUMN library_expression_id TYPE bigserial;
ALTER TABLE library_expressionprop ALTER COLUMN library_expressionprop_id TYPE bigserial;
ALTER TABLE library_featureprop ALTER COLUMN library_featureprop_id TYPE bigserial;
ALTER TABLE library_interaction ALTER COLUMN library_interaction_id TYPE bigserial;
ALTER TABLE library_relationship ALTER COLUMN library_relationship_id TYPE bigserial;
ALTER TABLE library_relationship_pub ALTER COLUMN library_relationship_pub_id TYPE bigserial;
ALTER TABLE library_strain ALTER COLUMN library_strain_id TYPE bigserial;
ALTER TABLE mageml ALTER COLUMN mageml_id TYPE bigserial;
ALTER TABLE magedocumentation ALTER COLUMN magedocumentation_id TYPE bigserial;
ALTER TABLE protocol ALTER COLUMN protocol_id TYPE bigserial;
ALTER TABLE protocolparam ALTER COLUMN protocolparam_id TYPE bigserial;
ALTER TABLE channel ALTER COLUMN channel_id TYPE bigserial;
ALTER TABLE arraydesign ALTER COLUMN arraydesign_id TYPE bigserial;
ALTER TABLE arraydesignprop ALTER COLUMN arraydesignprop_id TYPE bigserial;
ALTER TABLE assay ALTER COLUMN assay_id TYPE bigserial;
ALTER TABLE assayprop ALTER COLUMN assayprop_id TYPE bigserial;
ALTER TABLE assay_project ALTER COLUMN assay_project_id TYPE bigserial;
ALTER TABLE biomaterial ALTER COLUMN biomaterial_id TYPE bigserial;
ALTER TABLE biomaterial_relationship ALTER COLUMN biomaterial_relationship_id TYPE bigserial;
ALTER TABLE biomaterialprop ALTER COLUMN biomaterialprop_id TYPE bigserial;
ALTER TABLE biomaterial_dbxref ALTER COLUMN biomaterial_dbxref_id TYPE bigserial;
ALTER TABLE treatment ALTER COLUMN treatment_id TYPE bigserial;
ALTER TABLE biomaterial_treatment ALTER COLUMN biomaterial_treatment_id TYPE bigserial;
ALTER TABLE assay_biomaterial ALTER COLUMN assay_biomaterial_id TYPE bigserial;
ALTER TABLE acquisition ALTER COLUMN acquisition_id TYPE bigserial;
ALTER TABLE acquisitionprop ALTER COLUMN acquisitionprop_id TYPE bigserial;
ALTER TABLE acquisition_relationship ALTER COLUMN acquisition_relationship_id TYPE bigserial;
ALTER TABLE quantification ALTER COLUMN quantification_id TYPE bigserial;
ALTER TABLE quantificationprop ALTER COLUMN quantificationprop_id TYPE bigserial;
ALTER TABLE quantification_relationship ALTER COLUMN quantification_relationship_id TYPE bigserial;
ALTER TABLE control ALTER COLUMN control_id TYPE bigserial;
ALTER TABLE element ALTER COLUMN element_id TYPE bigserial;
ALTER TABLE elementresult ALTER COLUMN elementresult_id TYPE bigserial;
ALTER TABLE element_relationship ALTER COLUMN element_relationship_id TYPE bigserial;
ALTER TABLE elementresult_relationship ALTER COLUMN elementresult_relationship_id TYPE bigserial;
ALTER TABLE study ALTER COLUMN study_id TYPE bigserial;
ALTER TABLE study_assay ALTER COLUMN study_assay_id TYPE bigserial;
ALTER TABLE studydesign ALTER COLUMN studydesign_id TYPE bigserial;
ALTER TABLE studydesignprop ALTER COLUMN studydesignprop_id TYPE bigserial;
ALTER TABLE studyfactor ALTER COLUMN studyfactor_id TYPE bigserial;
ALTER TABLE studyfactorvalue ALTER COLUMN studyfactorvalue_id TYPE bigserial;
ALTER TABLE studyprop ALTER COLUMN studyprop_id TYPE bigserial;
ALTER TABLE studyprop_feature ALTER COLUMN studyprop_feature_id TYPE bigserial;
ALTER TABLE featuremap ALTER COLUMN featuremap_id TYPE bigserial;
ALTER TABLE featurerange ALTER COLUMN featurerange_id TYPE bigserial;
ALTER TABLE featurepos ALTER COLUMN featurepos_id TYPE bigserial;
ALTER TABLE featuremap_pub ALTER COLUMN featuremap_pub_id TYPE bigserial;
ALTER TABLE nd_geolocation ALTER COLUMN nd_geolocation_id TYPE bigserial;
ALTER TABLE nd_experiment ALTER COLUMN nd_experiment_id TYPE bigserial;
ALTER TABLE nd_experiment_project ALTER COLUMN nd_experiment_project_id TYPE bigserial;
ALTER TABLE nd_experimentprop ALTER COLUMN nd_experimentprop_id TYPE bigserial;
ALTER TABLE nd_experiment_pub ALTER COLUMN nd_experiment_pub_id TYPE bigserial;
ALTER TABLE nd_geolocationprop ALTER COLUMN nd_geolocationprop_id TYPE bigserial;
ALTER TABLE nd_protocol ALTER COLUMN nd_protocol_id TYPE bigserial; 
ALTER TABLE nd_reagent ALTER COLUMN nd_reagent_id TYPE bigserial;
ALTER TABLE nd_protocol_reagent ALTER COLUMN nd_protocol_reagent_id TYPE bigserial;
ALTER TABLE nd_protocolprop ALTER COLUMN nd_protocolprop_id TYPE bigserial;
ALTER TABLE nd_experiment_stock ALTER COLUMN nd_experiment_stock_id TYPE bigserial;
ALTER TABLE nd_experiment_protocol ALTER COLUMN nd_experiment_protocol_id TYPE bigserial;
ALTER TABLE nd_experiment_phenotype ALTER COLUMN nd_experiment_phenotype_id TYPE bigserial;
ALTER TABLE nd_experiment_genotype ALTER COLUMN nd_experiment_genotype_id TYPE bigserial;
ALTER TABLE nd_reagent_relationship ALTER COLUMN nd_reagent_relationship_id TYPE bigserial;
ALTER TABLE nd_reagentprop ALTER COLUMN nd_reagentprop_id TYPE bigserial;
ALTER TABLE nd_experiment_stockprop ALTER COLUMN nd_experiment_stockprop_id TYPE bigserial;
ALTER TABLE nd_experiment_stock_dbxref ALTER COLUMN nd_experiment_stock_dbxref_id TYPE bigserial;
ALTER TABLE nd_experiment_dbxref ALTER COLUMN nd_experiment_dbxref_id TYPE bigserial;
ALTER TABLE nd_experiment_contact ALTER COLUMN nd_experiment_contact_id TYPE bigserial;
ALTER TABLE organism ALTER COLUMN organism_id TYPE bigserial;
ALTER TABLE organism_dbxref ALTER COLUMN organism_dbxref_id TYPE bigserial;
ALTER TABLE organismprop ALTER COLUMN organismprop_id TYPE bigserial;
ALTER TABLE organismprop_pub ALTER COLUMN organismprop_pub_id TYPE bigserial;
ALTER TABLE organism_pub ALTER COLUMN organism_pub_id TYPE bigserial;
ALTER TABLE organism_cvterm ALTER COLUMN organism_cvterm_id TYPE bigserial;
ALTER TABLE organism_cvtermprop ALTER COLUMN organism_cvtermprop_id TYPE bigserial;
ALTER TABLE strain ALTER COLUMN strain_id TYPE bigserial;
ALTER TABLE strain_cvterm ALTER COLUMN strain_cvterm_id TYPE bigserial;
ALTER TABLE strain_cvtermprop ALTER COLUMN strain_cvtermprop_id TYPE bigserial;
ALTER TABLE strain_relationship ALTER COLUMN strain_relationship_id TYPE bigserial;
ALTER TABLE strain_relationship_pub ALTER COLUMN strain_relationship_pub_id TYPE bigserial;
ALTER TABLE strainprop ALTER COLUMN strainprop_id TYPE bigserial;
ALTER TABLE strainprop_pub ALTER COLUMN strainprop_pub_id TYPE bigserial;
ALTER TABLE strain_dbxref ALTER COLUMN strain_dbxref_id TYPE bigserial;
ALTER TABLE strain_pub ALTER COLUMN strain_pub_id TYPE bigserial;
ALTER TABLE strain_synonym ALTER COLUMN strain_synonym_id TYPE bigserial;
ALTER TABLE strain_feature ALTER COLUMN strain_feature_id TYPE bigserial;
ALTER TABLE strain_featureprop ALTER COLUMN strain_featureprop_id TYPE bigserial;
ALTER TABLE strain_phenotype ALTER COLUMN strain_phenotype_id TYPE bigserial;
ALTER TABLE strain_phenotypeprop ALTER COLUMN strain_phenotypeprop_id TYPE bigserial;
ALTER TABLE phenotype ALTER COLUMN phenotype_id TYPE bigserial;
ALTER TABLE phenotype_cvterm ALTER COLUMN phenotype_cvterm_id TYPE bigserial;
ALTER TABLE feature_phenotype ALTER COLUMN feature_phenotype_id TYPE bigserial;
ALTER TABLE phenotypeprop ALTER COLUMN phenotypeprop_id TYPE bigserial;
ALTER TABLE phylotree ALTER COLUMN phylotree_id TYPE bigserial;
ALTER TABLE phylotree_pub ALTER COLUMN phylotree_pub_id TYPE bigserial;
ALTER TABLE phylonode ALTER COLUMN phylonode_id TYPE bigserial;
ALTER TABLE phylonode_dbxref ALTER COLUMN phylonode_dbxref_id TYPE bigserial;
ALTER TABLE phylonode_pub ALTER COLUMN phylonode_pub_id TYPE bigserial;
ALTER TABLE phylonode_organism ALTER COLUMN phylonode_organism_id TYPE bigserial;
ALTER TABLE phylonodeprop ALTER COLUMN phylonodeprop_id TYPE bigserial;
ALTER TABLE phylonode_relationship ALTER COLUMN phylonode_relationship_id TYPE bigserial;
ALTER TABLE project ALTER COLUMN project_id TYPE bigserial;
ALTER TABLE projectprop ALTER COLUMN projectprop_id TYPE bigserial;
ALTER TABLE project_relationship ALTER COLUMN project_relationship_id TYPE bigserial;
ALTER TABLE project_pub ALTER COLUMN project_pub_id TYPE bigserial;
ALTER TABLE project_contact ALTER COLUMN project_contact_id TYPE bigserial;
ALTER TABLE pub ALTER COLUMN pub_id TYPE bigserial;
ALTER TABLE pub_relationship ALTER COLUMN pub_relationship_id TYPE bigserial;
ALTER TABLE pub_dbxref ALTER COLUMN pub_dbxref_id TYPE bigserial;
ALTER TABLE pubauthor ALTER COLUMN pubauthor_id TYPE bigserial;
ALTER TABLE pubprop ALTER COLUMN pubprop_id TYPE bigserial;
ALTER TABLE feature ALTER COLUMN feature_id TYPE bigserial;
ALTER TABLE featureloc ALTER COLUMN featureloc_id TYPE bigserial;
ALTER TABLE featureloc_pub ALTER COLUMN featureloc_pub_id TYPE bigserial;
ALTER TABLE feature_pub ALTER COLUMN feature_pub_id TYPE bigserial;
ALTER TABLE feature_pubprop ALTER COLUMN feature_pubprop_id TYPE bigserial;
ALTER TABLE featureprop ALTER COLUMN featureprop_id TYPE bigserial;
ALTER TABLE featureprop_pub ALTER COLUMN featureprop_pub_id TYPE bigserial;
ALTER TABLE feature_dbxref ALTER COLUMN feature_dbxref_id TYPE bigserial;
ALTER TABLE feature_relationship ALTER COLUMN feature_relationship_id TYPE bigserial;
ALTER TABLE feature_relationship_pub ALTER COLUMN feature_relationship_pub_id TYPE bigserial;
ALTER TABLE feature_relationshipprop ALTER COLUMN feature_relationshipprop_id TYPE bigserial;
ALTER TABLE feature_relationshipprop_pub ALTER COLUMN feature_relationshipprop_pub_id TYPE bigserial;
ALTER TABLE feature_cvterm ALTER COLUMN feature_cvterm_id TYPE bigserial;
ALTER TABLE feature_cvtermprop ALTER COLUMN feature_cvtermprop_id TYPE bigserial;
ALTER TABLE feature_cvterm_dbxref ALTER COLUMN feature_cvterm_dbxref_id TYPE bigserial;
ALTER TABLE feature_cvterm_pub ALTER COLUMN feature_cvterm_pub_id TYPE bigserial;
ALTER TABLE synonym ALTER COLUMN synonym_id TYPE bigserial;
ALTER TABLE feature_synonym ALTER COLUMN feature_synonym_id TYPE bigserial;
ALTER TABLE stock ALTER COLUMN stock_id TYPE bigserial;
ALTER TABLE stock_pub ALTER COLUMN stock_pub_id TYPE bigserial;
ALTER TABLE stockprop ALTER COLUMN stockprop_id TYPE bigserial;
ALTER TABLE stockprop_pub ALTER COLUMN stockprop_pub_id TYPE bigserial;
ALTER TABLE stock_relationship ALTER COLUMN stock_relationship_id TYPE bigserial;
ALTER TABLE stock_relationship_cvterm ALTER COLUMN stock_relationship_cvterm_id TYPE bigserial;
ALTER TABLE stock_relationship_pub ALTER COLUMN stock_relationship_pub_id TYPE bigserial;
ALTER TABLE stock_dbxref ALTER COLUMN stock_dbxref_id TYPE bigserial;
ALTER TABLE stock_cvterm ALTER COLUMN stock_cvterm_id TYPE bigserial;
ALTER TABLE stock_cvtermprop ALTER COLUMN stock_cvtermprop_id TYPE bigserial;
ALTER TABLE stock_genotype ALTER COLUMN stock_genotype_id TYPE bigserial;
ALTER TABLE stockcollection ALTER COLUMN stockcollection_id TYPE bigserial; 
ALTER TABLE stockcollectionprop ALTER COLUMN stockcollectionprop_id TYPE bigserial;
ALTER TABLE stockcollection_stock ALTER COLUMN stockcollection_stock_id TYPE bigserial;
ALTER TABLE stock_dbxrefprop ALTER COLUMN stock_dbxrefprop_id TYPE bigserial;


ALTER TABLE cell_line ALTER COLUMN organism_id type bigint;
ALTER TABLE cell_line_relationship ALTER COLUMN         subject_id type bigint;
ALTER TABLE cell_line_relationship ALTER COLUMN         object_id type bigint;
ALTER TABLE cell_line_relationship ALTER COLUMN  type_id type bigint;
ALTER TABLE cell_line_synonym ALTER COLUMN  cell_line_id type bigint;
ALTER TABLE cell_line_synonym ALTER COLUMN  synonym_id type bigint;
ALTER TABLE cell_line_synonym ALTER COLUMN  pub_id type bigint;
ALTER TABLE cell_line_cvterm ALTER COLUMN  cell_line_id type bigint;
ALTER TABLE cell_line_cvterm ALTER COLUMN  cvterm_id type bigint;
ALTER TABLE cell_line_cvterm ALTER COLUMN  pub_id type bigint;
ALTER TABLE cell_line_dbxref ALTER COLUMN  cell_line_id type bigint;
ALTER TABLE cell_line_dbxref ALTER COLUMN  dbxref_id type bigint;
ALTER TABLE cell_lineprop ALTER COLUMN  cell_line_id type bigint;
ALTER TABLE cell_lineprop ALTER COLUMN  type_id type bigint;
ALTER TABLE cell_lineprop_pub ALTER COLUMN  cell_lineprop_id type bigint;
ALTER TABLE cell_lineprop_pub ALTER COLUMN  pub_id type bigint;
ALTER TABLE cell_line_feature ALTER COLUMN  cell_line_id type bigint;
ALTER TABLE cell_line_feature ALTER COLUMN  feature_id type bigint;
ALTER TABLE cell_line_feature ALTER COLUMN  pub_id type bigint;
ALTER TABLE cell_line_cvtermprop ALTER COLUMN  cell_line_cvterm_id type bigint;
ALTER TABLE cell_line_cvtermprop ALTER COLUMN  type_id type bigint;
ALTER TABLE cell_line_pub ALTER COLUMN  cell_line_id type bigint;
ALTER TABLE cell_line_pub ALTER COLUMN  pub_id type bigint;
ALTER TABLE cell_line_library ALTER COLUMN  cell_line_id type bigint;
ALTER TABLE cell_line_library ALTER COLUMN  library_id type bigint;
ALTER TABLE cell_line_library ALTER COLUMN  pub_id type bigint;
ALTER TABLE analysisprop ALTER COLUMN     analysis_id type bigint;
ALTER TABLE analysisprop ALTER COLUMN     type_id type bigint;
ALTER TABLE analysisfeature ALTER COLUMN     feature_id type bigint;
ALTER TABLE analysisfeature ALTER COLUMN     analysis_id type bigint;
ALTER TABLE analysisfeatureprop ALTER COLUMN     analysisfeature_id type bigint;
ALTER TABLE analysisfeatureprop ALTER COLUMN     type_id type bigint;
ALTER TABLE contact ALTER COLUMN     type_id type bigint;
ALTER TABLE contact_relationship ALTER COLUMN     type_id type bigint;
ALTER TABLE contact_relationship ALTER COLUMN     subject_id type bigint;
ALTER TABLE contact_relationship ALTER COLUMN     object_id type bigint;
ALTER TABLE cvterm ALTER COLUMN     cv_id type bigint;
ALTER TABLE cvterm ALTER COLUMN     dbxref_id type bigint;
ALTER TABLE cvterm_relationship ALTER COLUMN     type_id type bigint;
ALTER TABLE cvterm_relationship ALTER COLUMN     subject_id type bigint;
ALTER TABLE cvterm_relationship ALTER COLUMN     object_id type bigint;
ALTER TABLE cvtermpath ALTER COLUMN     type_id type bigint;
ALTER TABLE cvtermpath ALTER COLUMN     subject_id type bigint;
ALTER TABLE cvtermpath ALTER COLUMN     object_id type bigint;
ALTER TABLE cvtermpath ALTER COLUMN     cv_id type bigint;
ALTER TABLE cvtermsynonym ALTER COLUMN     cvterm_id type bigint;
ALTER TABLE cvtermsynonym ALTER COLUMN     type_id type bigint,;
ALTER TABLE cvterm_dbxref ALTER COLUMN     cvterm_id type bigint;
ALTER TABLE cvterm_dbxref ALTER COLUMN     dbxref_id type bigint;
ALTER TABLE cvtermprop ALTER COLUMN     cvterm_id type bigint ;
ALTER TABLE cvtermprop ALTER COLUMN     type_id type bigint ;
ALTER TABLE dbxrefprop ALTER COLUMN     dbxref_id type bigint;
ALTER TABLE dbxrefprop ALTER COLUMN     type_id type bigint;
ALTER TABLE cvprop ALTER COLUMN     cv_id type bigint;
ALTER TABLE cvprop ALTER COLUMN     type_id type bigint;
ALTER TABLE chadoprop ALTER COLUMN     type_id type bigint;
ALTER TABLE expression_cvterm ALTER COLUMN        expression_id type bigint;
ALTER TABLE expression_cvterm ALTER COLUMN        cvterm_id type bigint;
ALTER TABLE expression_cvterm ALTER COLUMN        cvterm_type_id type bigint;
ALTER TABLE expression_cvtermprop ALTER COLUMN     expression_cvterm_id type bigint;
ALTER TABLE expression_cvtermprop ALTER COLUMN     type_id type bigint;
ALTER TABLE expressionprop ALTER COLUMN     expression_id type bigint;
ALTER TABLE expressionprop ALTER COLUMN     type_id type bigint;
ALTER TABLE expression_pub ALTER COLUMN        expression_id type bigint;
ALTER TABLE expression_pub ALTER COLUMN        pub_id type bigint;
ALTER TABLE feature_expression ALTER COLUMN        expression_id type bigint;
ALTER TABLE feature_expression ALTER COLUMN        feature_id type bigint;
ALTER TABLE feature_expression ALTER COLUMN        pub_id type bigint;
ALTER TABLE feature_expressionprop ALTER COLUMN        feature_expression_id type bigint;
ALTER TABLE feature_expressionprop ALTER COLUMN        type_id type bigint;
ALTER TABLE expression_image ALTER COLUMN        expression_id type bigint;
ALTER TABLE expression_image ALTER COLUMN        eimage_id type bigint;
ALTER TABLE tableinfo ALTER COLUMN     view_on_table_id type bigint null,;
ALTER TABLE tableinfo ALTER COLUMN     superclass_table_id type bigint null,;
ALTER TABLE dbxref ALTER COLUMN     db_id type bigint;
ALTER TABLE genotype ALTER COLUMN     type_id type bigint;
ALTER TABLE feature_genotype ALTER COLUMN     feature_id type bigint;
ALTER TABLE feature_genotype ALTER COLUMN     genotype_id type bigint;
ALTER TABLE feature_genotype ALTER COLUMN     chromosome_id type bigint,;
ALTER TABLE feature_genotype ALTER COLUMN     cvterm_id type bigint;
ALTER TABLE environment_cvterm ALTER COLUMN     environment_id type bigint;
ALTER TABLE environment_cvterm ALTER COLUMN     cvterm_id type bigint;
ALTER TABLE phenstatement ALTER COLUMN     genotype_id type bigint;
ALTER TABLE phenstatement ALTER COLUMN     environment_id type bigint;
ALTER TABLE phenstatement ALTER COLUMN     phenotype_id type bigint;
ALTER TABLE phenstatement ALTER COLUMN     type_id type bigint;
ALTER TABLE phenstatement ALTER COLUMN     pub_id type bigint;
ALTER TABLE phendesc ALTER COLUMN     genotype_id type bigint;
ALTER TABLE phendesc ALTER COLUMN     environment_id type bigint;
ALTER TABLE phendesc ALTER COLUMN     type_id type bigint;
ALTER TABLE phendesc ALTER COLUMN     pub_id type bigint;
ALTER TABLE phenotype_comparison ALTER COLUMN     genotype1_id type bigint;
ALTER TABLE phenotype_comparison ALTER COLUMN     environment1_id type bigint;
ALTER TABLE phenotype_comparison ALTER COLUMN     genotype2_id type bigint;
ALTER TABLE phenotype_comparison ALTER COLUMN     environment2_id type bigint;
ALTER TABLE phenotype_comparison ALTER COLUMN     phenotype1_id type bigint;
ALTER TABLE phenotype_comparison ALTER COLUMN     phenotype2_id type bigint,;
ALTER TABLE phenotype_comparison ALTER COLUMN     pub_id type bigint;
ALTER TABLE phenotype_comparison ALTER COLUMN     organism_id type bigint;
ALTER TABLE phenotype_comparison_cvterm ALTER COLUMN     phenotype_comparison_id type bigint;
ALTER TABLE phenotype_comparison_cvterm ALTER COLUMN     cvterm_id type bigint;
ALTER TABLE phenotype_comparison_cvterm ALTER COLUMN     pub_id type bigint;
ALTER TABLE genotypeprop ALTER COLUMN     genotype_id type bigint;
ALTER TABLE genotypeprop ALTER COLUMN     type_id type bigint;
ALTER TABLE interaction ALTER COLUMN         type_id type bigint;
ALTER TABLE interactionprop ALTER COLUMN     interaction_id type bigint;
ALTER TABLE interactionprop ALTER COLUMN     type_id type bigint;
ALTER TABLE interactionprop_pub ALTER COLUMN        interactionprop_id type bigint;
ALTER TABLE interactionprop_pub ALTER COLUMN      pub_id type bigint;
ALTER TABLE interaction_pub ALTER COLUMN        interaction_id type bigint;
ALTER TABLE interaction_pub ALTER COLUMN        pub_id type bigint;
ALTER TABLE interaction_expression ALTER COLUMN        expression_id type bigint;
ALTER TABLE interaction_expression ALTER COLUMN        interaction_id type bigint;
ALTER TABLE interaction_expression ALTER COLUMN        pub_id type bigint;
ALTER TABLE interaction_expressionprop ALTER COLUMN     interaction_expression_id type bigint;
ALTER TABLE interaction_expressionprop ALTER COLUMN     type_id type bigint;
ALTER TABLE interaction_cvterm ALTER COLUMN        interaction_id type bigint;
ALTER TABLE interaction_cvterm ALTER COLUMN        cvterm_id type bigint;
ALTER TABLE interaction_cvtermprop ALTER COLUMN     interaction_cvterm_id type bigint;
ALTER TABLE interaction_cvtermprop ALTER COLUMN     type_id type bigint;
ALTER TABLE feature_interaction ALTER COLUMN        feature_id type bigint;
ALTER TABLE feature_interaction ALTER COLUMN        interaction_id type bigint;
ALTER TABLE feature_interaction ALTER COLUMN        role_id type bigint;
ALTER TABLE feature_interactionprop ALTER COLUMN        feature_interaction_id type bigint;
ALTER TABLE feature_interactionprop ALTER COLUMN        type_id type bigint;
ALTER TABLE feature_interaction_pub ALTER COLUMN        feature_interaction_id type bigint;
ALTER TABLE feature_interaction_pub ALTER COLUMN        pub_id type bigint;
ALTER TABLE interaction_cell_line ALTER COLUMN        cell_line_id type bigint;
ALTER TABLE interaction_cell_line ALTER COLUMN        interaction_id type bigint;
ALTER TABLE interaction_cell_line ALTER COLUMN        pub_id type bigint;
ALTER TABLE interaction_group_feature_interaction ALTER COLUMN        interaction_group_id type bigint;
ALTER TABLE interaction_group_feature_interaction ALTER COLUMN        feature_interaction_id type bigint;
ALTER TABLE library ALTER COLUMN     organism_id type bigint;
ALTER TABLE library ALTER COLUMN     type_id type bigint;
ALTER TABLE library_synonym ALTER COLUMN     synonym_id type bigint;
ALTER TABLE library_synonym ALTER COLUMN     library_id type bigint;
ALTER TABLE library_synonym ALTER COLUMN     pub_id type bigint;
ALTER TABLE library_pub ALTER COLUMN     library_id type bigint;
ALTER TABLE library_pub ALTER COLUMN     pub_id type bigint;
ALTER TABLE libraryprop ALTER COLUMN     library_id type bigint;
ALTER TABLE libraryprop ALTER COLUMN     type_id type bigint;
ALTER TABLE libraryprop_pub ALTER COLUMN     libraryprop_id type bigint;
ALTER TABLE libraryprop_pub ALTER COLUMN     pub_id type bigint;
ALTER TABLE library_cvterm ALTER COLUMN     library_id type bigint;
ALTER TABLE library_cvterm ALTER COLUMN     cvterm_id type bigint;
ALTER TABLE library_cvterm ALTER COLUMN     pub_id type bigint;
ALTER TABLE library_feature ALTER COLUMN     library_id type bigint;
ALTER TABLE library_feature ALTER COLUMN     feature_id type bigint;
ALTER TABLE library_dbxref ALTER COLUMN     library_id type bigint;
ALTER TABLE library_dbxref ALTER COLUMN     dbxref_id type bigint;
ALTER TABLE library_expression ALTER COLUMN     library_id type bigint;
ALTER TABLE library_expression ALTER COLUMN     expression_id type bigint;
ALTER TABLE library_expression ALTER COLUMN     pub_id type bigint;
ALTER TABLE library_expressionprop ALTER COLUMN     library_expression_id type bigint;
ALTER TABLE library_expressionprop ALTER COLUMN     type_id type bigint;
ALTER TABLE library_featureprop ALTER COLUMN     library_feature_id type bigint;
ALTER TABLE library_featureprop ALTER COLUMN     type_id type bigint;
ALTER TABLE library_interaction ALTER COLUMN     library_id type bigint;
ALTER TABLE library_interaction ALTER COLUMN     interaction_id type bigint;
ALTER TABLE library_interaction ALTER COLUMN     pub_id type bigint;
ALTER TABLE library_relationship ALTER COLUMN     subject_id type bigint;
ALTER TABLE library_relationship ALTER COLUMN     object_id type bigint;
ALTER TABLE library_relationship ALTER COLUMN     type_id type bigint;
ALTER TABLE library_relationship_pub ALTER COLUMN     library_relationship_id type bigint;
ALTER TABLE library_relationship_pub ALTER COLUMN     pub_id type bigint;
ALTER TABLE magedocumentation ALTER COLUMN     mageml_id type bigint;
ALTER TABLE magedocumentation ALTER COLUMN     tableinfo_id type bigint;
ALTER TABLE protocol ALTER COLUMN     type_id type bigint;
ALTER TABLE protocol ALTER COLUMN     pub_id type bigint null,;
ALTER TABLE protocol ALTER COLUMN     dbxref_id type bigint null,;
ALTER TABLE protocolparam ALTER COLUMN     protocol_id type bigint;
ALTER TABLE protocolparam ALTER COLUMN     datatype_id type bigint null,;
ALTER TABLE protocolparam ALTER COLUMN     unittype_id type bigint null,;
ALTER TABLE arraydesign ALTER COLUMN     manufacturer_id type bigint;
ALTER TABLE arraydesign ALTER COLUMN     platformtype_id type bigint;
ALTER TABLE arraydesign ALTER COLUMN     substratetype_id type bigint null,;
ALTER TABLE arraydesign ALTER COLUMN     protocol_id type bigint null,;
ALTER TABLE arraydesign ALTER COLUMN     dbxref_id type bigint null,;
ALTER TABLE arraydesignprop ALTER COLUMN     arraydesign_id type bigint;
ALTER TABLE arraydesignprop ALTER COLUMN     type_id type bigint;
ALTER TABLE assay ALTER COLUMN     arraydesign_id type bigint;
ALTER TABLE assay ALTER COLUMN     protocol_id type bigint null,;
ALTER TABLE assay ALTER COLUMN     operator_id type bigint;
ALTER TABLE assay ALTER COLUMN     dbxref_id type bigint null,;
ALTER TABLE assayprop ALTER COLUMN     assay_id type bigint;
ALTER TABLE assayprop ALTER COLUMN     type_id type bigint;
ALTER TABLE assay_project ALTER COLUMN     assay_id type bigint;
ALTER TABLE assay_project ALTER COLUMN     project_id type bigint;
ALTER TABLE biomaterial ALTER COLUMN     taxon_id type bigint null,;
ALTER TABLE biomaterial ALTER COLUMN     biosourceprovider_id type bigint null,;
ALTER TABLE biomaterial ALTER COLUMN     dbxref_id type bigint null,;
ALTER TABLE biomaterial_relationship ALTER COLUMN     subject_id type bigint;
ALTER TABLE biomaterial_relationship ALTER COLUMN     type_id type bigint;
ALTER TABLE biomaterial_relationship ALTER COLUMN     object_id type bigint;
ALTER TABLE biomaterialprop ALTER COLUMN     biomaterial_id type bigint;
ALTER TABLE biomaterialprop ALTER COLUMN     type_id type bigint;
ALTER TABLE biomaterial_dbxref ALTER COLUMN     biomaterial_id type bigint;
ALTER TABLE biomaterial_dbxref ALTER COLUMN     dbxref_id type bigint;
ALTER TABLE treatment ALTER COLUMN     biomaterial_id type bigint;
ALTER TABLE treatment ALTER COLUMN     type_id type bigint;
ALTER TABLE treatment ALTER COLUMN     protocol_id type bigint null,;
ALTER TABLE biomaterial_treatment ALTER COLUMN     biomaterial_id type bigint;
ALTER TABLE biomaterial_treatment ALTER COLUMN     treatment_id type bigint;
ALTER TABLE biomaterial_treatment ALTER COLUMN     unittype_id type bigint null,;
ALTER TABLE assay_biomaterial ALTER COLUMN     assay_id type bigint;
ALTER TABLE assay_biomaterial ALTER COLUMN     biomaterial_id type bigint;
ALTER TABLE assay_biomaterial ALTER COLUMN     channel_id type bigint null,;
ALTER TABLE acquisition ALTER COLUMN     assay_id type bigint;
ALTER TABLE acquisition ALTER COLUMN     protocol_id type bigint null,;
ALTER TABLE acquisition ALTER COLUMN     channel_id type bigint null,;
ALTER TABLE acquisitionprop ALTER COLUMN     acquisition_id type bigint;
ALTER TABLE acquisitionprop ALTER COLUMN     type_id type bigint;
ALTER TABLE acquisition_relationship ALTER COLUMN     subject_id type bigint;
ALTER TABLE acquisition_relationship ALTER COLUMN     type_id type bigint;
ALTER TABLE acquisition_relationship ALTER COLUMN     object_id type bigint;
ALTER TABLE quantification ALTER COLUMN     acquisition_id type bigint;
ALTER TABLE quantification ALTER COLUMN     operator_id type bigint null,;
ALTER TABLE quantification ALTER COLUMN     protocol_id type bigint null,;
ALTER TABLE quantification ALTER COLUMN     analysis_id type bigint;
ALTER TABLE quantificationprop ALTER COLUMN     quantification_id type bigint;
ALTER TABLE quantificationprop ALTER COLUMN     type_id type bigint;
ALTER TABLE quantification_relationship ALTER COLUMN     subject_id type bigint;
ALTER TABLE quantification_relationship ALTER COLUMN     type_id type bigint;
ALTER TABLE quantification_relationship ALTER COLUMN     object_id type bigint;
ALTER TABLE control ALTER COLUMN     type_id type bigint;
ALTER TABLE control ALTER COLUMN     assay_id type bigint;
ALTER TABLE control ALTER COLUMN     tableinfo_id type bigint;
ALTER TABLE element ALTER COLUMN     feature_id type bigint null,;
ALTER TABLE element ALTER COLUMN     arraydesign_id type bigint;
ALTER TABLE element ALTER COLUMN     type_id type bigint null,;
ALTER TABLE element ALTER COLUMN     dbxref_id type bigint null,;
ALTER TABLE elementresult ALTER COLUMN     element_id type bigint;
ALTER TABLE elementresult ALTER COLUMN     quantification_id type bigint;
ALTER TABLE element_relationship ALTER COLUMN     subject_id type bigint;
ALTER TABLE element_relationship ALTER COLUMN     type_id type bigint;
ALTER TABLE element_relationship ALTER COLUMN     object_id type bigint;
ALTER TABLE elementresult_relationship ALTER COLUMN     subject_id type bigint;
ALTER TABLE elementresult_relationship ALTER COLUMN     type_id type bigint;
ALTER TABLE elementresult_relationship ALTER COLUMN     object_id type bigint;
ALTER TABLE study ALTER COLUMN     contact_id type bigint;
ALTER TABLE study ALTER COLUMN     pub_id type bigint null,;
ALTER TABLE study ALTER COLUMN     dbxref_id type bigint null,;
ALTER TABLE study_assay ALTER COLUMN     study_id type bigint;
ALTER TABLE study_assay ALTER COLUMN     assay_id type bigint;
ALTER TABLE studydesign ALTER COLUMN     study_id type bigint;
ALTER TABLE studydesignprop ALTER COLUMN     studydesign_id type bigint;
ALTER TABLE studydesignprop ALTER COLUMN     type_id type bigint;
ALTER TABLE studyfactor ALTER COLUMN     studydesign_id type bigint;
ALTER TABLE studyfactor ALTER COLUMN     type_id type bigint null,;
ALTER TABLE studyfactorvalue ALTER COLUMN     studyfactor_id type bigint;
ALTER TABLE studyfactorvalue ALTER COLUMN     assay_id type bigint;
ALTER TABLE studyprop ALTER COLUMN     study_id type bigint;
ALTER TABLE studyprop ALTER COLUMN     type_id type bigint;
ALTER TABLE studyprop_feature ALTER COLUMN     studyprop_id type bigint;
ALTER TABLE studyprop_feature ALTER COLUMN     feature_id type bigint;
ALTER TABLE studyprop_feature ALTER COLUMN     type_id type bigint,;
ALTER TABLE featuremap ALTER COLUMN     unittype_id type bigint null,;
ALTER TABLE featurerange ALTER COLUMN     featuremap_id type bigint;
ALTER TABLE featurerange ALTER COLUMN     feature_id type bigint;
ALTER TABLE featurerange ALTER COLUMN     leftstartf_id type bigint;
ALTER TABLE featurerange ALTER COLUMN     leftendf_id type bigint,;
ALTER TABLE featurerange ALTER COLUMN     rightstartf_id type bigint,;
ALTER TABLE featurerange ALTER COLUMN     rightendf_id type bigint;
ALTER TABLE featurepos ALTER COLUMN featuremap_id type bigint;
ALTER TABLE featurepos ALTER COLUMN     feature_id type bigint;
ALTER TABLE featurepos ALTER COLUMN     map_feature_id type bigint;
ALTER TABLE featuremap_pub ALTER COLUMN     featuremap_id type bigint;
ALTER TABLE featuremap_pub ALTER COLUMN     pub_id type bigint;
ALTER TABLE natural_diversity ALTER COLUMN     nd_geolocation_id type bigint;
ALTER TABLE natural_diversity ALTER COLUMN     type_id type bigint;
ALTER TABLE natural_diversity ALTER COLUMN     project_id type bigint;
ALTER TABLE natural_diversity ALTER COLUMN     nd_experiment_id type bigint;
ALTER TABLE natural_diversity ALTER COLUMN     nd_experiment_id type bigint;
ALTER TABLE natural_diversity ALTER COLUMN     type_id type bigint;
ALTER TABLE natural_diversity ALTER COLUMN        nd_experiment_id type bigint;
ALTER TABLE natural_diversity ALTER COLUMN        pub_id type bigint;
ALTER TABLE natural_diversity ALTER COLUMN     nd_geolocation_id type bigint;
ALTER TABLE natural_diversity ALTER COLUMN     type_id type bigint;
ALTER TABLE natural_diversity ALTER COLUMN     type_id type bigint;
ALTER TABLE natural_diversity ALTER COLUMN     type_id type bigint;
ALTER TABLE natural_diversity ALTER COLUMN     nd_protocol_id type bigint;
ALTER TABLE natural_diversity ALTER COLUMN     reagent_id type bigint;
ALTER TABLE natural_diversity ALTER COLUMN     type_id type bigint;
ALTER TABLE natural_diversity ALTER COLUMN     nd_protocol_id type bigint;
ALTER TABLE natural_diversity ALTER COLUMN     type_id type bigint;
ALTER TABLE natural_diversity ALTER COLUMN     nd_experiment_id type bigint;
ALTER TABLE natural_diversity ALTER COLUMN     stock_id type bigint;
ALTER TABLE natural_diversity ALTER COLUMN     type_id type bigint;
ALTER TABLE natural_diversity ALTER COLUMN     nd_experiment_id type bigint;
ALTER TABLE natural_diversity ALTER COLUMN     nd_protocol_id type bigint;
ALTER TABLE natural_diversity ALTER COLUMN     nd_experiment_id type bigint;
ALTER TABLE natural_diversity ALTER COLUMN     phenotype_id type bigint;
ALTER TABLE natural_diversity ALTER COLUMN     nd_experiment_id type bigint;
ALTER TABLE natural_diversity ALTER COLUMN     genotype_id type bigint;
ALTER TABLE natural_diversity ALTER COLUMN     subject_reagent_id type bigint;
ALTER TABLE natural_diversity ALTER COLUMN     object_reagent_id type bigint;
ALTER TABLE natural_diversity ALTER COLUMN     type_id type bigint;
ALTER TABLE natural_diversity ALTER COLUMN     nd_reagent_id type bigint;
ALTER TABLE natural_diversity ALTER COLUMN     type_id type bigint;
ALTER TABLE natural_diversity ALTER COLUMN     nd_experiment_stock_id type bigint;
ALTER TABLE natural_diversity ALTER COLUMN     type_id type bigint;
ALTER TABLE natural_diversity ALTER COLUMN     nd_experiment_stock_id type bigint;
ALTER TABLE natural_diversity ALTER COLUMN     dbxref_id type bigint;
ALTER TABLE natural_diversity ALTER COLUMN     nd_experiment_id type bigint;
ALTER TABLE natural_diversity ALTER COLUMN     dbxref_id type bigint;
ALTER TABLE natural_diversity ALTER COLUMN     nd_experiment_id type bigint;
ALTER TABLE natural_diversity ALTER COLUMN     contact_id type bigint;
ALTER TABLE organism_dbxref ALTER COLUMN     organism_id type bigint;
ALTER TABLE organism_dbxref ALTER COLUMN     dbxref_id type bigint;
ALTER TABLE organismprop ALTER COLUMN     organism_id type bigint;
ALTER TABLE organismprop ALTER COLUMN     type_id type bigint;
ALTER TABLE organismprop_pub ALTER COLUMN     organismprop_id type bigint;
ALTER TABLE organismprop_pub ALTER COLUMN     pub_id type bigint;
ALTER TABLE organism_pub ALTER COLUMN        organism_id type bigint;
ALTER TABLE organism_pub ALTER COLUMN        pub_id type bigint;
ALTER TABLE organism_cvterm ALTER COLUMN        organism_id type bigint;
ALTER TABLE organism_cvterm ALTER COLUMN        cvterm_id type bigint;
ALTER TABLE organism_cvterm ALTER COLUMN        pub_id type bigint;
ALTER TABLE organism_cvtermprop ALTER COLUMN     organism_cvterm_id type bigint;
ALTER TABLE organism_cvtermprop ALTER COLUMN     type_id type bigint;
ALTER TABLE phenotype ALTER COLUMN     observable_id type bigint,;
ALTER TABLE phenotype ALTER COLUMN     attr_id type bigint,;
ALTER TABLE phenotype ALTER COLUMN     cvalue_id type bigint,;
ALTER TABLE phenotype ALTER COLUMN     assay_id type bigint,;
ALTER TABLE phenotype_cvterm ALTER COLUMN     phenotype_id type bigint;
ALTER TABLE phenotype_cvterm ALTER COLUMN     cvterm_id type bigint;
ALTER TABLE feature_phenotype ALTER COLUMN     feature_id type bigint;
ALTER TABLE feature_phenotype ALTER COLUMN     phenotype_id type bigint;
ALTER TABLE phenotypeprop ALTER COLUMN        phenotype_id type bigint;
ALTER TABLE phenotypeprop ALTER COLUMN        type_id type bigint;
ALTER TABLE phylotree ALTER COLUMN    dbxref_id type bigint;
ALTER TABLE phylotree ALTER COLUMN  type_id type bigint,;
ALTER TABLE phylotree ALTER COLUMN  analysis_id type bigint null,;
ALTER TABLE phylotree_pub ALTER COLUMN        phylotree_id type bigint;
ALTER TABLE phylotree_pub ALTER COLUMN        pub_id type bigint;
ALTER TABLE phylonode ALTER COLUMN        phylotree_id type bigint;
ALTER TABLE phylonode ALTER COLUMN        parent_phylonode_id type bigint null,;
ALTER TABLE phylonode ALTER COLUMN        type_id type bigint,;
ALTER TABLE phylonode ALTER COLUMN        feature_id type bigint,;
ALTER TABLE phylonode_dbxref ALTER COLUMN        phylonode_id type bigint;
ALTER TABLE phylonode_dbxref ALTER COLUMN        dbxref_id type bigint;
ALTER TABLE phylonode_pub ALTER COLUMN        phylonode_id type bigint;
ALTER TABLE phylonode_pub ALTER COLUMN        pub_id type bigint;
ALTER TABLE phylonode_organism ALTER COLUMN        phylonode_id type bigint;
ALTER TABLE phylonode_organism ALTER COLUMN        organism_id type bigint;
ALTER TABLE phylonodeprop ALTER COLUMN        phylonode_id type bigint;
ALTER TABLE phylonodeprop ALTER COLUMN        type_id type bigint;
ALTER TABLE phylonode_relationship ALTER COLUMN        subject_id type bigint;
ALTER TABLE phylonode_relationship ALTER COLUMN        object_id type bigint;
ALTER TABLE phylonode_relationship ALTER COLUMN        type_id type bigint;
ALTER TABLE phylonode_relationship ALTER COLUMN        phylotree_id type bigint;
ALTER TABLE projectprop ALTER COLUMN  project_id type bigint;
ALTER TABLE projectprop ALTER COLUMN  type_id type bigint;
ALTER TABLE project_relationship ALTER COLUMN  subject_project_id type bigint;
ALTER TABLE project_relationship ALTER COLUMN  object_project_id type bigint;
ALTER TABLE project_relationship ALTER COLUMN  type_id type bigint;
ALTER TABLE project_pub ALTER COLUMN        project_id type bigint;
ALTER TABLE project_pub ALTER COLUMN        pub_id type bigint;
ALTER TABLE project_contact ALTER COLUMN        project_id type bigint;
ALTER TABLE project_contact ALTER COLUMN        contact_id type bigint;
ALTER TABLE pub ALTER COLUMN     type_id type bigint;
ALTER TABLE pub_relationship ALTER COLUMN     subject_id type bigint;
ALTER TABLE pub_relationship ALTER COLUMN     object_id type bigint;
ALTER TABLE pub_relationship ALTER COLUMN     type_id type bigint;
ALTER TABLE pub_dbxref ALTER COLUMN     pub_id type bigint;
ALTER TABLE pub_dbxref ALTER COLUMN     dbxref_id type bigint;
ALTER TABLE pubauthor ALTER COLUMN     pub_id type bigint;
ALTER TABLE pubprop ALTER COLUMN     pub_id type bigint;
ALTER TABLE pubprop ALTER COLUMN     type_id type bigint;
ALTER TABLE feature ALTER COLUMN     dbxref_id type bigint,;
ALTER TABLE feature ALTER COLUMN     organism_id type bigint;
ALTER TABLE feature ALTER COLUMN     seqlen type bigint; --not a foreign key but changed to bigint
ALTER TABLE feature ALTER COLUMN     type_id type bigint;
ALTER TABLE featureloc ALTER COLUMN     feature_id type bigint;
ALTER TABLE featureloc ALTER COLUMN     srcfeature_id type bigint,;
ALTER TABLE feature ALTER COLUMN     fmin type bigint,;
ALTER TABLE feature ALTER COLUMN     fmax type bigint,;
ALTER TABLE featureloc_pub ALTER COLUMN     featureloc_id type bigint;
ALTER TABLE featureloc_pub ALTER COLUMN     pub_id type bigint;
ALTER TABLE feature_pub ALTER COLUMN     feature_id type bigint;
ALTER TABLE feature_pub ALTER COLUMN     pub_id type bigint;
ALTER TABLE feature_pubprop ALTER COLUMN     feature_pub_id type bigint;
ALTER TABLE feature_pubprop ALTER COLUMN     type_id type bigint;
ALTER TABLE featureprop ALTER COLUMN     feature_id type bigint;
ALTER TABLE featureprop ALTER COLUMN     type_id type bigint;
ALTER TABLE featureprop_pub ALTER COLUMN     featureprop_id type bigint;
ALTER TABLE featureprop_pub ALTER COLUMN     pub_id type bigint;
ALTER TABLE feature_dbxref ALTER COLUMN     feature_id type bigint;
ALTER TABLE feature_dbxref ALTER COLUMN     dbxref_id type bigint;
ALTER TABLE feature_relationship ALTER COLUMN     subject_id type bigint;
ALTER TABLE feature_relationship ALTER COLUMN     object_id type bigint;
ALTER TABLE feature_relationship ALTER COLUMN     type_id type bigint;
ALTER TABLE feature_relationship_pub ALTER COLUMN  feature_relationship_id type bigint;
ALTER TABLE feature_relationship_pub ALTER COLUMN  pub_id type bigint;
ALTER TABLE feature_relationshipprop ALTER COLUMN     feature_relationship_id type bigint;
ALTER TABLE feature_relationshipprop ALTER COLUMN     type_id type bigint;
ALTER TABLE feature_relationshipprop_pub ALTER COLUMN     feature_relationshipprop_id type bigint;
ALTER TABLE feature_relationshipprop_pub ALTER COLUMN     pub_id type bigint;
ALTER TABLE feature_cvterm ALTER COLUMN     feature_id type bigint;
ALTER TABLE feature_cvterm ALTER COLUMN     cvterm_id type bigint;
ALTER TABLE feature_cvterm ALTER COLUMN     pub_id type bigint;
ALTER TABLE feature_cvtermprop ALTER COLUMN     feature_cvterm_id type bigint;
ALTER TABLE feature_cvtermprop ALTER COLUMN     type_id type bigint;
ALTER TABLE feature_cvterm_dbxref ALTER COLUMN     feature_cvterm_id type bigint;
ALTER TABLE feature_cvterm_dbxref ALTER COLUMN     dbxref_id type bigint;
ALTER TABLE feature_cvterm_pub ALTER COLUMN     feature_cvterm_id type bigint;
ALTER TABLE feature_cvterm_pub ALTER COLUMN     pub_id type bigint;
ALTER TABLE synonym ALTER COLUMN     type_id type bigint;
ALTER TABLE feature_synonym ALTER COLUMN     synonym_id type bigint;
ALTER TABLE feature_synonym ALTER COLUMN     feature_id type bigint;
ALTER TABLE feature_synonym ALTER COLUMN     pub_id type bigint;
ALTER TABLE stock ALTER COLUMN        dbxref_id type bigint,;
ALTER TABLE stock ALTER COLUMN        organism_id type bigint,;
ALTER TABLE stock ALTER COLUMN        type_id type bigint;
ALTER TABLE stock_pub ALTER COLUMN        stock_id type bigint;
ALTER TABLE stock_pub ALTER COLUMN        pub_id type bigint;
ALTER TABLE stockprop ALTER COLUMN        stock_id type bigint;
ALTER TABLE stockprop ALTER COLUMN        type_id type bigint;
ALTER TABLE stockprop_pub ALTER COLUMN      stockprop_id type bigint;
ALTER TABLE stockprop_pub ALTER COLUMN      pub_id type bigint;
ALTER TABLE stock_relationship ALTER COLUMN        subject_id type bigint;
ALTER TABLE stock_relationship ALTER COLUMN        object_id type bigint;
ALTER TABLE stock_relationship ALTER COLUMN        type_id type bigint;
ALTER TABLE stock_relationship_cvterm ALTER COLUMN  stock_relationship_id type bigint;
ALTER TABLE stock_relationship_cvterm ALTER COLUMN  cvterm_id type bigint;
ALTER TABLE stock_relationship_cvterm ALTER COLUMN  pub_id type bigint,;
ALTER TABLE stock_relationship_pub ALTER COLUMN       stock_relationship_id type bigint;
ALTER TABLE stock_relationship_pub ALTER COLUMN       pub_id type bigint;
ALTER TABLE stock_dbxref ALTER COLUMN      stock_id type bigint;
ALTER TABLE stock_dbxref ALTER COLUMN      dbxref_id type bigint;
ALTER TABLE stock_cvterm ALTER COLUMN      stock_id type bigint;
ALTER TABLE stock_cvterm ALTER COLUMN      cvterm_id type bigint;
ALTER TABLE stock_cvterm ALTER COLUMN      pub_id type bigint;
ALTER TABLE stock_cvtermprop ALTER COLUMN     stock_cvterm_id type bigint;
ALTER TABLE stock_cvtermprop ALTER COLUMN     type_id type bigint;
ALTER TABLE stock_genotype ALTER COLUMN        stock_id type bigint;
ALTER TABLE stock_genotype ALTER COLUMN        genotype_id type bigint;
ALTER TABLE stockcollection ALTER COLUMN  type_id type bigint;
ALTER TABLE stockcollection ALTER COLUMN         contact_id type bigint null,;
ALTER TABLE stockcollectionprop ALTER COLUMN     stockcollection_id type bigint;
ALTER TABLE stockcollectionprop ALTER COLUMN     type_id type bigint;
ALTER TABLE stockcollection_stock ALTER COLUMN     stockcollection_id type bigint;
ALTER TABLE stockcollection_stock ALTER COLUMN     stock_id type bigint;
ALTER TABLE stock_dbxrefprop ALTER COLUMN        stock_dbxref_id type bigint;
ALTER TABLE stock_dbxrefprop ALTER COLUMN        type_id type bigint;