-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.sql
105 lines (93 loc) · 1.62 KB
/
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
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
CREATE TABLE users (
username text,
email text,
passw text,
avatar text DEFAULT 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQzlDPRr1xSW0lukY2EmVpAx5Ye1S8H5luUVOK2IqFdcsjCDQxK',
userid SERIAL PRIMARY KEY
);
CREATE TABLE plant_data (
userid integer NOT NULL,
temp FLOAT,
sun FLOAT,
moist FLOAT,
humidity FLOAT,
created timestamp without time zone NOT NULL DEFAULT (current_timestamp AT TIME ZONE 'EDT'),
dataid SERIAL PRIMARY KEY
);
INSERT INTO users (
username, email, passw
) VALUES(
'test1',
'$2b$10$4WDy9wvyLYga4fXveTmz.OZGG/EbF6BX1RMbcPnJ7E4WZJuXb0tOK'
);
INSERT INTO users (
username, email, passw
) VALUES(
'test2',
'$2b$10$Z9Ohg.0jzgaB5wGO1fhmY.R.vvYFXIy6elLMBIu/HLXgMsQ2JsbHG'
);
INSERT INTO plant_data (
userid, temp, sun, moist, humidity
) VALUES(
1,
75,
1050,
20,
5
);
INSERT INTO plant_data (
userid, temp, sun, moist, humidity
) VALUES(
1,
72,
900,
22,
4.8
);
INSERT INTO plant_data (
userid, temp, sun, moist, humidity
) VALUES(
1,
50,
700,
23,
4.7
);
INSERT INTO plant_data (
userid, temp, sun, moist, humidity
) VALUES(
2,
62,
950,
15,
2
);
INSERT INTO plant_data (
userid, temp, sun, moist, humidity
) VALUES(
2,
70,
1050,
15,
2.3
);
INSERT INTO plant_data (
userid, temp, sun, moist, humidity
) VALUES(
2,
80,
1200,
16,
2.1
);
INSERT INTO plant_data (
userid, temp, sun, moist, humidity
) VALUES(
2,
78,
1100,
17,
2.0
);