1drop table persons;
2drop sequence persons_id_seq;
3create table persons (
4	id serial not null primary key,
5	name varchar(255) not null,
6	surname varchar(255) not null,
7	password varchar(64)
8);
9
10drop table institutes;
11drop sequence institutes_id_seq;
12create table institutes (
13	id serial not null primary key,
14	name varchar(255)
15);
16
17drop table documents;
18drop sequence documents_id_seq;
19create table documents (
20	id serial not null primary key,
21	title varchar(255) not null,
22	abstract varchar(255)
23);
24
25drop table authors_docs;
26create table authors_docs (
27	pers_id int not null,
28	doc_id int not null,
29	primary key ( pers_id, doc_id )
30);
31
32drop table phones;
33drop sequence phones_id_seq;
34create table phones (
35	id serial not null primary key,
36	phone varchar(255) not null ,
37	pers_id int not null
38);
39
40drop table certs;
41drop sequence certs_id_seq;
42CREATE TABLE certs (
43	id int not null primary key,
44	cert bytea not null,
45	pers_id int not null 
46);
47 
48drop table referrals;
49drop sequence referrals_id_seq;
50create table referrals (
51	id serial not null primary key,
52	name varchar(255) not null,
53	url varchar(255) not null
54);
55
56