#4955 Foreign key constraint is incorrectly formed
Closed: Fixed by pingou. Opened by leejnk.

pagure-5.11.2
CentOS 8.2
MariaDB 10.5.4

When running command

"python3 /usr/share/pagure/pagure_createdb.py -c /etc/pagure/pagure.cfg -i /etc/pagure/alembic.ini"

got the error-

sqlalchemy.exc.OperationalError: (MySQLdb._exceptions.OperationalError) (1005, 'Can\'t create table pagure.boards (errno: 150 "Foreign key constraint is incorrectly formed")')
[SQL:
CREATE TABLE boards (
id INTEGER NOT NULL AUTO_INCREMENT,
project_id INTEGER NOT NULL,
name TEXT NOT NULL,
active BOOL NOT NULL,
tag_id INTEGER NOT NULL,
created DATETIME NOT NULL,
date_updated DATETIME NOT NULL,
CONSTRAINT boards_pkey PRIMARY KEY (id),
CONSTRAINT boards_project_id_name_uix UNIQUE (project_id, name),
CONSTRAINT boards_project_id_fkey FOREIGN KEY(project_id) REFERENCES projects (id) ON DELETE CASCADE ON UPDATE CASCADE,
CHECK (active IN (0, 1)),
CONSTRAINT boards_tag_id_fkey FOREIGN KEY(tag_id) REFERENCES tags_colored (id) ON UPDATE CASCADE
)

]
(Background on this error at: http://sqlalche.me/e/e3q8)


This should be fixed on #4954

Metadata Update from @jlanda:
- Issue tagged with: bug

Metadata Update from @pingou:
- Issue close_status updated to: Fixed
- Issue status updated to: Closed (was: Open)

Metadata
Related Pull Requests