forked from rkbecker/registerddls
-
Notifications
You must be signed in to change notification settings - Fork 0
/
RegisterServiceDDL.sql
64 lines (56 loc) · 1.53 KB
/
RegisterServiceDDL.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
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
CREATE EXTENSION "uuid-ossp";
CREATE TABLE product (
id uuid NOT NULL,
lookupcode character varying(32) NOT NULL DEFAULT(''),
count int NOT NULL DEFAULT(0),
createdon timestamp without time zone NOT NULL DEFAULT now(),
CONSTRAINT product_pkey PRIMARY KEY (id)
) WITH (
OIDS=FALSE
);
CREATE INDEX ix_product_lookupcode
ON product
USING btree
(lower(lookupcode::text) COLLATE pg_catalog."default");
INSERT INTO product VALUES (
uuid_generate_v4()
, 'lookupcode1'
, 100
, current_timestamp
);
INSERT INTO product VALUES (
uuid_generate_v4()
, 'lookupcode1'
, 125
, current_timestamp
);
INSERT INTO product VALUES (
uuid_generate_v4()
, 'lookupcode3'
, 150
, current_timestamp
);
/*this is createing the table -Ross */
CREATE TABLE employee (
record_id uuid NOT NULL primary key,
first_name char(10) NOT NULL DEFAULT(''),
last_name char(15) NOT NULL DEFAULT(''),
employee_id int,
active Char(2), CHECK ((active='Y') OR (active='N')) NOT NULL DEFAULT('N'),
classificatoin Char(20), CHECK ((classification='General Manager') OR (classification='Shift Manager') OR (classification='Cashier')),
manager uuid, Foreign key (employee) References employee (record_id),
password char(25),
createdon timestamp without time zone NOT NULL DEFAULT now()
);
/*Inserting a test record -Ross*/
INSERT INTO employee VALUES (
uuid_generate_v4()
, 'Test'
, 'ing'
, 10
, 'Y'
, 'General Manager'
, null
, 'fall2017'
, current_timestamp
);