-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathddl.sql
More file actions
40 lines (32 loc) · 741 Bytes
/
ddl.sql
File metadata and controls
40 lines (32 loc) · 741 Bytes
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
-- Table: public.person
-- DROP TABLE public.person;
CREATE TABLE public.person
(
id serial NOT NULL ,
name character varying(100),
surname character varying(100),
CONSTRAINT user_pkey PRIMARY KEY (id)
)
WITH (
OIDS=FALSE
);
ALTER TABLE public.person
OWNER TO postgres;
-- Table: public.contact
-- DROP TABLE public.contact;
CREATE TABLE public.contact
(
id serial NOT NULL,
user_id integer NOT NULL,
type character varying(100),
value character varying(100),
CONSTRAINT kontakt_pkey PRIMARY KEY (id),
CONSTRAINT my_fk FOREIGN KEY (user_id)
REFERENCES public.person (id) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE CASCADE
)
WITH (
OIDS=FALSE
);
ALTER TABLE public.contact
OWNER TO postgres;