ansibleguy76 / ansibleforms-docker

A docker-compose project to start ansibleforms in docker
8 stars 4 forks source link

SQL schema file preventing subsequent schemes to be initialised in DB #5

Closed CarolinaFernandez closed 5 months ago

CarolinaFernandez commented 5 months ago

Hi, and thank you all for sharing and maintaining this project.

After a first successfully deployment and testing AnsibleForms last year from the main repo (15/12/2023, commit: f3a25b5) with the docker-compose.yml at the root and now migrating to this repository, I found an issue in one of the MySQL schemes that seems to prevent the successful initialisation of the rest of tables in the DB.

Specifically, this is the one for the LDAP table (file: https://github.com/ansibleguy76/ansibleforms-docker/blob/main/data/mysql/init/g_create_ldap_table.sql#L20), introduced when adding the mail attribute in commit: cabaac6. It is simply solved by adding the missing comma before the new attribute. Probably no need of a PR for such a small change, so just notifying it here.

FYI, the logs of the DB before fixing it:

af_db | 2024-04-19 07:00:24+00:00 [Note] [Entrypoint]: /usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/a_grant_root.sql af_db | af_db | af_db | 2024-04-19 07:00:25+00:00 [Note] [Entrypoint]: /usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/b_create_database.sql af_db | af_db | af_db | 2024-04-19 07:00:26+00:00 [Note] [Entrypoint]: /usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/c_create_groups_table.sql af_db | af_db | af_db | 2024-04-19 07:00:30+00:00 [Note] [Entrypoint]: /usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/d_create_users_table.sql af_db | af_db | af_db | 2024-04-19 07:00:35+00:00 [Note] [Entrypoint]: /usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/e_create_tokens_table.sql af_db | af_db | af_db | 2024-04-19 07:00:39+00:00 [Note] [Entrypoint]: /usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/f_create_credentials_table.sql af_db | af_db | af_db | 2024-04-19 07:00:42+00:00 [Note] [Entrypoint]: /usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/g_create_ldap_table.sql af_db | ERROR 1064 (42000) at line 3: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mail_attribute varchar(250) DEFAULT NULL
af_db | ) ENGINE=InnoDB DEFAULT CHARSET=utf' at line 19

Besides this, as a cosmetic issue, schemes "j" and "k" follow a different naming scheme with dots rather than underscores. Order is of course still preserved so, as said, purely cosmetic.

ansibleguy76 commented 5 months ago

nice catch! tx

ansibleguy76 commented 5 months ago

fixed now

CarolinaFernandez commented 4 months ago

Seen it, thanks for the prompt action.