From 4849cc33f4deb220a7628437ee2c17e5a3f36e5f Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Sat, 2 Nov 2019 15:00:48 +0100 Subject: [PATCH] fix user and group sequences in postgre --- rootfs/etc/cont-init.d/02-fix-postgre-schema | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rootfs/etc/cont-init.d/02-fix-postgre-schema b/rootfs/etc/cont-init.d/02-fix-postgre-schema index b784468..b09fdd0 100644 --- a/rootfs/etc/cont-init.d/02-fix-postgre-schema +++ b/rootfs/etc/cont-init.d/02-fix-postgre-schema @@ -1,6 +1,9 @@ #!/usr/bin/with-contenv sh if [ "$DB_TYPE" == "postgres" ]; then + # starting at 3 because the psql --host "$DB_HOST" --port "$DB_PORT" --username "$DB_USER" --dbname "$DB_NAME" --command \ - "CREATE SEQUENCE IF NOT EXISTS users_id_seq AS integer START 1 OWNED BY users.id; ALTER TABLE users ALTER COLUMN id SET DEFAULT nextval('users_id_seq');" + "ALTER SEQUENCE users_id_seq START WITH 3;" + sql --host "$DB_HOST" --port "$DB_PORT" --username "$DB_USER" --dbname "$DB_NAME" --command \ + "ALTER SEQUENCE groups_id_seq START WITH 3;" fi