Browse Source

Create the featuregroup table if it doesn't exist

Ferrisx4 4 years ago
parent
commit
0f0799556a
1 changed files with 24 additions and 0 deletions
  1. 24 0
      tripal_chado/chado_schema/default_schema-1.2-1.3-diff.sql

+ 24 - 0
tripal_chado/chado_schema/default_schema-1.2-1.3-diff.sql

@@ -1916,6 +1916,30 @@ SET search_path=frange,public,pg_catalog;
 -- Name: featuregroup; Type: TABLE; Schema: frange; Owner: chado; Tablespace: 
 --
 
+CREATE TABLE IF NOT EXISTS featuregroup (
+    featuregroup_id bigserial not null,
+    primary key (featuregroup_id),
+
+    subject_id bigint not null,
+    foreign key (subject_id) references feature (feature_id) on delete cascade INITIALLY DEFERRED,
+
+    object_id bigint not null,
+    foreign key (object_id) references feature (feature_id) on delete cascade INITIALLY DEFERRED,
+
+    group_id bigint not null,
+    foreign key (group_id) references feature (feature_id) on delete cascade INITIALLY DEFERRED,
+
+    srcfeature_id bigint null,
+    foreign key (srcfeature_id) references feature (feature_id) on delete cascade INITIALLY DEFERRED,
+
+    fmin bigint null,
+    fmax bigint null,
+    strand int null,
+    is_root int not null default 0,
+
+    constraint featuregroup_c1 unique (subject_id,object_id,group_id,srcfeature_id,fmin,fmax,strand)
+);
+
 ALTER TABLE featuregroup 
     ALTER featuregroup_id TYPE bigint,
     ALTER subject_id TYPE bigint,