-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_tables.sql
57 lines (48 loc) · 1.46 KB
/
build_tables.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
DROP TABLE IF EXISTS coininfo CASCADE;
CREATE TABLE coininfo
(
id integer DEFAULT "identity"(100241, 0, '1,1'::text) NOT NULL,
name varchar(256) NOT NULL,
symbol varchar(256) NOT NULL,
coinname varchar(256) NOT NULL,
fullname varchar(256) NOT NULL
);
DROP TABLE IF EXISTS datatable CASCADE;
CREATE TABLE datatable
(
id integer DEFAULT "identity"(100267, 0, '1,1'::text) NOT NULL,
closevalue float8,
highvalue float8,
lowvalue float8,
openvalue float8,
volumefrom float8,
volumeto float8,
unixtime integer,
coinid integer
);
DROP TABLE IF EXISTS modeltype CASCADE;
CREATE TABLE modeltype
(
id integer DEFAULT "identity"(100244, 0, '1,1'::text) NOT NULL,
name varchar(100)
);
ALTER TABLE modeltype
ADD CONSTRAINT modeltype_pkey
PRIMARY KEY (id);
DROP TABLE IF EXISTS predictions CASCADE;
CREATE TABLE predictions
(
id integer DEFAULT "identity"(100296, 0, '1,1'::text) NOT NULL,
requestdate varchar(256) NOT NULL,
amznrequestid varchar(256) NOT NULL,
highvaluepredict float8 NOT NULL,
coinid integer NOT NULL,
unixtime bigint DEFAULT 0 NOT NULL,
highvalueactual float8,
percenterror numeric(5,2),
modeltypeid integer,
awsmlmodelid varchar(100)
);
ALTER TABLE predictions
ADD CONSTRAINT predictions_pkey
PRIMARY KEY (id);