Description
Describe the bug
CREATE TABLE users fails
To Reproduce
Steps to reproduce the behavior:
Deploy per instructions.
Creation of users table fails:
docketeer-db | CREATE DATABASE
docketeer-db |
docketeer-db |
docketeer-db | /usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/init.sql
docketeer-db | 2024-09-23 16:54:41.431 UTC [62] ERROR: syntax error at or near ")" at character 269
docketeer-db | 2024-09-23 16:54:41.431 UTC [62] STATEMENT: CREATE TABLE users (
docketeer-db | _id SERIAL NOT NULL,
docketeer-db | username VARCHAR (255) UNIQUE NOT NULL,
docketeer-db | password VARCHAR (255) NOT NULL,
docketeer-db | mem_threshold INTEGER DEFAULT 80,
docketeer-db | cpu_threshold INTEGER DEFAULT 80,
docketeer-db | container_stops BOOLEAN DEFAULT true,
docketeer-db | PRIMARY KEY (_id),
docketeer-db | ) WITH (
docketeer-db | OIDS = FALSE
docketeer-db | );
docketeer-db | psql:/docker-entrypoint-initdb.d/init.sql:11: ERROR: syntax error at or near ")"
docketeer-db | LINE 9: ) WITH (
docketeer-db | ^
docketeer-db exited with code 0
Expected behavior
users table to be successfully created
Desktop (please complete the following information):
- OS: Win11
- Browser: Edge
- Version: 128.0.2739.79
Additional context
Workaround:
- docker compose up
- docker exec -it docketeer-db /bin/bash
- apt-get update
- apt-get install vim
- vim /docker-entrypoint-initdb.d/init.sql
- remove the extra comma (",") from the "PRIMARY KEY (_id)" line
- un-comment the "CREATE TABLE notification_settings" section
- save the file
- psql -U postgres -d docketeer-db -f /docker-entrypoint-initdb.d/init.sql