Merge "Omaha #3454 Adding sequences to tables in events schema" into omaha_14.4.1
Former-commit-id:3f1217ac04
[formerly7c8a19d149
] [formerly3f1217ac04
[formerly7c8a19d149
] [formerly14a86f1063
[formerly 3fb87f623c38b78c1d1046990fb05576851174d2]]] Former-commit-id:14a86f1063
Former-commit-id:1f71ff6cc9
[formerlybe63cfd242
] Former-commit-id:08c3220397
This commit is contained in:
commit
ff81058698
1 changed files with 25 additions and 0 deletions
25
deltaScripts/14.4.1/DR3454/createEventsSequences.sh
Executable file
25
deltaScripts/14.4.1/DR3454/createEventsSequences.sh
Executable file
|
@ -0,0 +1,25 @@
|
|||
#!/bin/bash
|
||||
|
||||
STATS_MAX_VAL=$(psql -U awips -d metadata -t -c "select max(id)+1 from events.stats;")
|
||||
NOTIFICATION_MAX_VAL=$(psql -U awips -d metadata -t -c "select max(id)+1 from events.notification;")
|
||||
AGGREGATE_MAX_VAL=$(psql -U awips -d metadata -t -c "select max(id)+1 from events.aggregate;")
|
||||
|
||||
if [ -z $STATS_MAX_VAL ]
|
||||
then
|
||||
STATS_MAX_VAL=1
|
||||
fi
|
||||
|
||||
if [ -z $NOTIFICATION_MAX_VAL ]
|
||||
then
|
||||
NOTIFICATION_MAX_VAL=1
|
||||
fi
|
||||
|
||||
if [ -z $AGGREGATE_MAX_VAL ]
|
||||
then
|
||||
AGGREGATE_MAX_VAL=1
|
||||
fi
|
||||
|
||||
psql -U awips -d metadata -c \
|
||||
"CREATE SEQUENCE stats_seq START WITH $STATS_MAX_VAL; \
|
||||
CREATE SEQUENCE notification_seq START WITH $NOTIFICATION_MAX_VAL; \
|
||||
CREATE SEQUENCE aggregate_seq START WITH $NOTIFICATION_MAX_VAL;"
|
Loading…
Add table
Reference in a new issue