Skip to content

Commit dd25835

Browse files
authored
Merge pull request #632 from wadoodalam/PR_wadoodalam
PR for Database changes
2 parents e7d2ee6 + e499dc4 commit dd25835

37 files changed

+460
-209
lines changed

src/scripts/testData.sh

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -54,21 +54,21 @@ sed -i "" -e "s/^[0-9]/313,&/" src/server/test/db/data/automatedTests/15Freq7Amp
5454
# This will probably not be necesary once can use curl to get the files in
5555
# CSV with meter info
5656
cat > $postgresdir/testMeters.csv << EOF
57-
id,name,ipaddress,enabled,displayable,meter_type,default_timezone_meter,gps,identifier
58-
300,test4DaySin,123.45.6.0,FALSE,TRUE,mamac,,,test4DaySin
59-
301,test4HourSin,123.45.6.0,FALSE,TRUE,mamac,,,test4HourSin
60-
302,test23MinSin,123.45.6.0,FALSE,TRUE,mamac,,,test23MinSin
61-
303,test15MinSin,123.45.6.0,FALSE,TRUE,mamac,,,test15MinSin
62-
304,test23MinCos,123.45.6.0,FALSE,TRUE,mamac,,,test23MinCos
63-
305,testSqSin,123.45.6.0,FALSE,TRUE,mamac,,,testSqSin
64-
306,testSqCos,123.45.6.0,FALSE,TRUE,mamac,,,testSqCos
65-
307,testAmp1Sin,123.45.6.0,FALSE,TRUE,mamac,,,testAmp1Sin
66-
308,testAmp2Sin,123.45.6.0,FALSE,TRUE,mamac,,,testAmp2Sin
67-
309,testAmp3Sin,123.45.6.0,FALSE,TRUE,mamac,,,testAmp3Sin
68-
310,testAmp4Sin,123.45.6.0,FALSE,TRUE,mamac,,,testAmp4Sin
69-
311,testAmp5Sin,123.45.6.0,FALSE,TRUE,mamac,,,testAmp5Sin
70-
312,testAmp6Sin,123.45.6.0,FALSE,TRUE,mamac,,,testAmp6Sin
71-
313,testAmp7Sin,123.45.6.0,FALSE,TRUE,mamac,,,testAmp7Sin
57+
id,name,ipaddress,enabled,displayable,meter_type,default_timezone_meter,gps,identifier,note,area,cumulative,cumulative_reset,cumulative_reset_start,cumulative_reset_end,reading_length,reading_variation,reading,start_timestamp,end_timestamp
58+
300,test4DaySin,123.45.6.0,FALSE,TRUE,mamac,,,test4DaySin,notesTest,25.0,FALSE,TRUE,00:00:00,00:00:00,,,20.0,,0001-01-01 : 00:00:00
59+
301,test4HourSin,123.45.6.0,FALSE,TRUE,mamac,,,test4HourSin,notesTest,25.0,FALSE,TRUE,00:00:00,00:00:00,,,20.0,,0001-01-01 : 00:00:00
60+
302,test23MinSin,123.45.6.0,FALSE,TRUE,mamac,,,test23MinSin,notesTest,25.0,FALSE,TRUE,00:00:00,00:00:00,,,20.0,,0001-01-01 : 00:00:00
61+
303,test15MinSin,123.45.6.0,FALSE,TRUE,mamac,,,test15MinSin,notesTest,25.0,FALSE,TRUE,00:00:00,00:00:00,,,20.0,,0001-01-01 : 00:00:00
62+
304,test23MinCos,123.45.6.0,FALSE,TRUE,mamac,,,test23MinCos,notesTest,25.0,FALSE,TRUE,00:00:00,00:00:00,,,20.0,,0001-01-01 : 00:00:00
63+
305,testSqSin,123.45.6.0,FALSE,TRUE,mamac,,,testSqSin,notesTest,25.0,FALSE,TRUE,00:00:00,00:00:00,,,20.0,,0001-01-01 : 00:00:00
64+
306,testSqCos,123.45.6.0,FALSE,TRUE,mamac,,,testSqCos,notesTest,25.0,FALSE,TRUE,00:00:00,00:00:00,,,20.0,,0001-01-01 : 00:00:00
65+
307,testAmp1Sin,123.45.6.0,FALSE,TRUE,mamac,,,testAmp1Sin,notesTest,25.0,FALSE,TRUE,00:00:00,00:00:00,,,20.0,,0001-01-01 : 00:00:00
66+
308,testAmp2Sin,123.45.6.0,FALSE,TRUE,mamac,,,testAmp2Sin,notesTest,25.0,FALSE,TRUE,00:00:00,00:00:00,,,20.0,,0001-01-01 : 00:00:00
67+
309,testAmp3Sin,123.45.6.0,FALSE,TRUE,mamac,,,testAmp3Sin,notesTest,25.0,FALSE,TRUE,00:00:00,00:00:00,,,20.0,,0001-01-01 : 00:00:00
68+
310,testAmp4Sin,123.45.6.0,FALSE,TRUE,mamac,,,testAmp4Sin,notesTest,25.0,FALSE,TRUE,00:00:00,00:00:00,,,20.0,,0001-01-01 : 00:00:00
69+
311,testAmp5Sin,123.45.6.0,FALSE,TRUE,mamac,,,testAmp5Sin,notesTest,25.0,FALSE,TRUE,00:00:00,00:00:00,,,20.0,,0001-01-01 : 00:00:00
70+
312,testAmp6Sin,123.45.6.0,FALSE,TRUE,mamac,,,testAmp6Sin,notesTest,25.0,FALSE,TRUE,00:00:00,00:00:00,,,20.0,,0001-01-01 : 00:00:00
71+
313,testAmp7Sin,123.45.6.0,FALSE,TRUE,mamac,,,testAmp7Sin,notesTest,25.0,FALSE,TRUE,00:00:00,00:00:00,,,20.0,,0001-01-01 : 00:00:00
7272
EOF
7373
# Put meters into OED
7474
docker-compose exec database psql -U oed -c "copy meters from 'testMeters.csv' CSV HEADER"
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/* This Source Code Form is subject to the terms of the Mozilla Public
2+
* License, v. 2.0. If a copy of the MPL was not distributed with this
3+
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4+
5+
ALTER TABLE groups
6+
ADD COLUMN IF NOT EXISTS displayable BOOLEAN,
7+
ADD COLUMN IF NOT EXISTS gps POINT DEFAULT NULL,
8+
ADD COLUMN IF NOT EXISTS note TEXT,
9+
ADD COLUMN IF NOT EXISTS area REAL DEFAULT NULL;
10+
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/* This Source Code Form is subject to the terms of the Mozilla Public
2+
* License, v. 2.0. If a copy of the MPL was not distributed with this
3+
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4+
5+
ALTER TABLE maps
6+
ADD COLUMN IF NOT EXISTS north_angle REAL DEFAULT 0.0,
7+
ADD COLUMN IF NOT EXISTS max_circle_size_fraction REAL DEFAULT 0.15;
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/* This Source Code Form is subject to the terms of the Mozilla Public
2+
* License, v. 2.0. If a copy of the MPL was not distributed with this
3+
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4+
5+
ALTER TABLE meters
6+
ADD COLUMN IF NOT EXISTS note TEXT,
7+
ADD COLUMN IF NOT EXISTS area REAL DEFAULT NULL,
8+
ADD COLUMN IF NOT EXISTS cumulative BOOLEAN DEFAULT false,
9+
ADD COLUMN IF NOT EXISTS cumulative_reset BOOLEAN DEFAULT false,
10+
ADD COLUMN IF NOT EXISTS cumulative_reset_start TIME DEFAULT '00:00:00',
11+
ADD COLUMN IF NOT EXISTS cumulative_reset_end TIME DEFAULT '23:59:59.999999',
12+
ADD COLUMN IF NOT EXISTS reading_length TIME DEFAULT '00:00:00',
13+
ADD COLUMN IF NOT EXISTS reading_variation TIME DEFAULT '23:59:59.999999',
14+
ADD COLUMN IF NOT EXISTS reading REAL DEFAULT 0.0,
15+
ADD COLUMN IF NOT EXISTS start_timestamp TIMESTAMP DEFAULT '0001-01-01 00:00:00',
16+
ADD COLUMN IF NOT EXISTS end_timestamp TIMESTAMP DEFAULT '0001-01-01 00:00:00'
17+
;
18+

0 commit comments

Comments
 (0)