-
-
Notifications
You must be signed in to change notification settings - Fork 268
Description
While attempting to run httpsms with a PostgreSQL 18.3 (Alpine) backend, the auto-migration fails during the schema initialization/update phase. The application attempts to use IF NOT EXISTS syntax for ALTER TABLE ... ADD CONSTRAINT, which is not supported in standard PostgreSQL.
Error Logs:
ERROR: syntax error at or near "EXISTS" at character 42
STATEMENT:
ALTER TABLE users ADD CONSTRAINT IF NOT EXISTS uni_users_api_key CHECK (api_key IS NOT NULL);
ALTER TABLE phone_api_keys ADD CONSTRAINT IF NOT EXISTS uni_phone_api_keys_api_key CHECK (api_key IS NOT NULL);
ALTER TABLE discords ADD CONSTRAINT IF NOT EXISTS uni_discords_server_id CHECK (server_id IS NOT NULL);
Environment:
PostgreSQL Version: 18.3 (compiled by gcc Alpine 15.2.0)
Deployment: Docker Compose
Image: postgres:alpine
Steps to Reproduce:
Use a standard postgres:alpine image in a docker-compose setup.
Point the httpsms API service to this database.
Observe the logs during the initial container startup/migration phase.