Skip to content

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

Open
@AnthonyRobinson

Description

@AnthonyRobinson

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions