Skip to content
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

Postgres DB Scheme setup not working #2846

Open
john2exonets opened this issue Oct 6, 2022 · 5 comments
Open

Postgres DB Scheme setup not working #2846

john2exonets opened this issue Oct 6, 2022 · 5 comments
Labels
bug 🐛 Problems with the code that result in unexpected or bad behavior

Comments

@john2exonets
Copy link

john2exonets commented Oct 6, 2022

Setup of Postgres DB Scheme errors out in the Tracks 2.6.1 Container:

C:\Users\john\ToDo\PG>docker run --link tracks-db:db --rm -t -e "DATABASE_PASSWORD=blak123" -e "DATABASE_TYPE=postgresql" -e "DATABASE_PORT=5432"  -e "DATABASE_ENCODING=unicode" tracksapp/tracks:2.6.1 bin/rake db:reset --trace
** Invoke db:reset (first_time)
** Invoke db:drop (first_time)
** Invoke db:load_config (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:load_config
** Invoke db:check_protected_environments (first_time)
** Invoke db:load_config
** Execute db:check_protected_environments
** Execute db:drop
** Invoke db:drop:_unsafe (first_time)
** Invoke db:load_config
** Execute db:drop:_unsafe
D, [2022-10-06T18:37:22.460750 #9] DEBUG -- :    (10.8ms)  DROP DATABASE IF EXISTS "tracks"
Dropped database 'tracks'
** Invoke db:setup (first_time)
** Invoke db:schema:load_if_ruby (first_time)
** Invoke db:create (first_time)
** Invoke db:load_config
** Execute db:create
D, [2022-10-06T18:37:22.514223 #9] DEBUG -- :    (45.7ms)  CREATE DATABASE "tracks" ENCODING = 'unicode'
Created database 'tracks'
** Invoke environment
** Execute db:schema:load_if_ruby
** Invoke db:schema:load (first_time)
** Invoke db:load_config
** Invoke db:check_protected_environments
** Execute db:schema:load
D, [2022-10-06T18:37:22.526380 #9] DEBUG -- :    (0.1ms)  DROP TABLE IF EXISTS "attachments" CASCADE
D, [2022-10-06T18:37:22.526989 #9] DEBUG -- :    (0.4ms)  CREATE TABLE "attachments" ("id" bigserial primary key, "todo_id" integer, "file_file_name" character varying, "file_content_type" character varying, "file_file_size" integer, "file_updated_at" timestamp, "created_at" timestamp, "updated_at" timestamp) ENGINE=InnoDB DEFAULT CHARSET=utf8
rake aborted!
ActiveRecord::StatementInvalid: PG::SyntaxError: ERROR:  syntax error at or near "ENGINE"
LINE 1: ..., "created_at" timestamp, "updated_at" timestamp) ENGINE=Inn...
                                                             ^
/usr/local/bundle/gems/activerecord-6.0.5.1/lib/active_record/connection_adapters/postgresql/database_statements.rb:92:in `exec'
/usr/local/bundle/gems/activerecord-6.0.5.1/lib/active_record/connection_adapters/postgresql/database_statements.rb:92:in `block (2 levels) in execute'
/usr/local/bundle/gems/activesupport-6.0.5.1/lib/active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads'
@ZeiP
Copy link
Member

ZeiP commented Oct 7, 2022

Interesting, it looks like it's using the MySQL schema for pg, which of course doesn't work. Thanks for reporting!

@ZeiP ZeiP added the bug 🐛 Problems with the code that result in unexpected or bad behavior label Oct 7, 2022
@john2exonets
Copy link
Author

I get the same error when I tried Tracks 2.5.2 Container as well.

@Stopi
Copy link

Stopi commented Oct 26, 2022

Hi, this is still an issue using the latest image from https://hub.docker.com/r/tracksapp/tracks/tags published 16h ago (v2.6.1 ?).
Please help.

@Stopi
Copy link

Stopi commented Jan 10, 2023

Still an issue with the image ec10d92efc64 published on 1st Jan.

@nrybowski
Copy link

Got the same problem on 596b700. Running db:migrate rather than db:reset "solved" the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Problems with the code that result in unexpected or bad behavior
Projects
None yet
Development

No branches or pull requests

4 participants