Skip to content

typo in /docker-entrypoint-initdb.d/init.sql #176

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
AnthonyRobinson opened this issue Sep 23, 2024 · 0 comments
Open

typo in /docker-entrypoint-initdb.d/init.sql #176

AnthonyRobinson opened this issue Sep 23, 2024 · 0 comments

Comments

@AnthonyRobinson
Copy link

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:

  1. docker compose up
  2. docker exec -it docketeer-db /bin/bash
  3. apt-get update
  4. apt-get install vim
  5. vim /docker-entrypoint-initdb.d/init.sql
  6. remove the extra comma (",") from the "PRIMARY KEY (_id)" line
  7. un-comment the "CREATE TABLE notification_settings" section
  8. save the file
  9. psql -U postgres -d docketeer-db -f /docker-entrypoint-initdb.d/init.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant