Omaha #3454 Adding sequences to tables in events schema
Former-commit-id:39f00d60ae
[formerly 9799cba1a2c525190d297f7e355cda29f1e98ee7] Former-commit-id:4af35d83f8
This commit is contained in:
parent
2626b9ff33
commit
acea99bb5e
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