fix user id sequence in postgre
This commit is contained in:
parent
35fc1d2356
commit
9da2c9381a
6
rootfs/etc/cont-init.d/02-fix-postgre-schema
Normal file
6
rootfs/etc/cont-init.d/02-fix-postgre-schema
Normal file
@ -0,0 +1,6 @@
|
||||
#!/usr/bin/with-contenv sh
|
||||
|
||||
if [ "$DB_TYPE" == "postgres" ]; then
|
||||
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');"
|
||||
fi
|
Loading…
Reference in New Issue
Block a user