Omaha #3454 Adding sequences to tables in events schema
Change-Id: I79d03c5f97eeecdb665fee624cdae377555fa373 Former-commit-id: fa5ec2a1866784e8b0fc0f9a6c0d3a363cbcc22d
This commit is contained in:
parent
14a86f1063
commit
a13c0a8b39
1 changed files with 4 additions and 1 deletions
|
@ -1,5 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# This script creates sequences for the tables in the events schema
|
||||||
|
|
||||||
STATS_MAX_VAL=$(psql -U awips -d metadata -t -c "select max(id)+1 from events.stats;")
|
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;")
|
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;")
|
AGGREGATE_MAX_VAL=$(psql -U awips -d metadata -t -c "select max(id)+1 from events.aggregate;")
|
||||||
|
@ -22,4 +24,5 @@ fi
|
||||||
psql -U awips -d metadata -c \
|
psql -U awips -d metadata -c \
|
||||||
"CREATE SEQUENCE stats_seq START WITH $STATS_MAX_VAL; \
|
"CREATE SEQUENCE stats_seq START WITH $STATS_MAX_VAL; \
|
||||||
CREATE SEQUENCE notification_seq START WITH $NOTIFICATION_MAX_VAL; \
|
CREATE SEQUENCE notification_seq START WITH $NOTIFICATION_MAX_VAL; \
|
||||||
CREATE SEQUENCE aggregate_seq START WITH $NOTIFICATION_MAX_VAL;"
|
CREATE SEQUENCE aggregate_seq START WITH $AGGREGATE_MAX_VAL;"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue