Skip to content

Commit 4b4ffea

Browse files
committed
Update database initialization scripts
1 parent fc6be7e commit 4b4ffea

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

app/service/sql/init_table_device_plant.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$MEASUREMENTS_DB"
77
IF NOT EXISTS dev.device_plant (
88
id_device VARCHAR(32) PRIMARY KEY,
99
id_plant INT UNIQUE NOT NULL,
10-
plant_type SMALLINT NOT NULL,
10+
plant_type VARCHAR(70) NOT NULL,
1111
id_user INT NOT NULL
1212
);
1313
1414
DO $do$ BEGIN
1515
IF (SELECT COUNT(*) FROM dev.device_plant) = 0 THEN
1616
INSERT INTO dev.device_plant (id_device, id_plant, plant_type, id_user) VALUES
17-
('fd7c7531467748539f99d2bcef076c88', 1, 1, 1),
18-
('fd8c7531467748539f99d2bcef076c88', 2, 2, 2),
19-
('fd9c7531467748539f99d2bcef076c88', 3, 3, 3);
17+
('fd7c7531467748539f99d2bcef076c88', 1, 'Passiflora caerulea', 1),
18+
('fd8c7531467748539f99d2bcef076c88', 2, 'Kalanchoe daigremontiana', 2),
19+
('fd9c7531467748539f99d2bcef076c88', 3, 'Dracaena fragrans', 3);
2020
END IF;
2121
END $do$;
2222
EOSQL

0 commit comments

Comments
 (0)