-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathdb-schema.sql
38 lines (32 loc) · 979 Bytes
/
db-schema.sql
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
drop table if exists af_structure cascade;
drop table if exists af_pdb_hit cascade;
drop table if exists af_transplant cascade;
create table af_structure (
id serial primary key,
name varchar not null,
chunked boolean default false,
af_version varchar not null,
created timestamp with time zone not null,
af_file varchar not null
);
alter table af_structure owner to "$OWNER";
create table af_pdb_hit (
id serial primary key,
af_id bigint references af_structure on delete cascade deferrable initially deferred,
identity float,
length integer,
pdb_asym_id varchar not null,
pdb_id varchar not null,
rmsd float
);
alter table af_pdb_hit owner to "$OWNER";
create table af_transplant (
id serial primary key,
hit_id bigint references af_pdb_hit on delete cascade deferrable initially deferred,
asym_id varchar not null,
compound_id varchar not null,
analogue_id varchar,
entity_id varchar,
rmsd float
);
alter table af_transplant owner to "$OWNER";