gbwey/persistent-odbc

foreign key types mismatch

wapxmas opened this issue · 0 comments

person.id - INT
blog_post.author_id - BIGINT

Migrating: CREATe TABLE person(id int NOT NULL AUTO_INCREMENT PRIMARY KEY,name TEXT CHARACTER SET utf8 NOT NULL,age BIGINT NULL,score BIGINT NULL)
[Debug#SQL] CREATe TABLE person(id int NOT NULL AUTO_INCREMENT PRIMARY KEY,name TEXT CHARACTER SET utf8 NOT NULL,age BIGINT NULL,score BIGINT NULL); []
Migrating: CREATe TABLE blog_post(id int NOT NULL AUTO_INCREMENT PRIMARY KEY,title TEXT CHARACTER SET utf8 NOT NULL,author_id BIGINT NOT NULL REFERENCES person)
[Debug#SQL] CREATe TABLE blog_post(id int NOT NULL AUTO_INCREMENT PRIMARY KEY,title TEXT CHARACTER SET utf8 NOT NULL,author_id BIGINT NOT NULL REFERENCES person); []
Migrating: ALTER TABLE blog_post ADD CONSTRAINT blog_post_author_id_fkey FOREIGN KEY(author_id) REFERENCES person(id)
[Debug#SQL] ALTER TABLE blog_post ADD CONSTRAINT blog_post_author_id_fkey FOREIGN KEY(author_id) REFERENCES person(id); []
persist2-exe.exe: SqlError {seState = "["HY000"]", seNativeError = -1, seErrorMsg = "execute execute: ["1215: [MySQL][ODBC 5.3(w) Driver][mysqld-5.7.13-log]Cannot add foreign key constraint"]"}