Omaha #3454 Adding sequences to tables in events schema

Change-Id: I79d03c5f97eeecdb665fee624cdae377555fa373

Former-commit-id: fa5ec2a1866784e8b0fc0f9a6c0d3a363cbcc22d
This commit is contained in:
Benjamin Phillippe 2014-10-28 10:30:08 -05:00
parent 14a86f1063
commit a13c0a8b39

View file

@ -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;"