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

Model generation getRelations() bug #170

Open
beno64 opened this issue May 14, 2021 · 0 comments
Open

Model generation getRelations() bug #170

beno64 opened this issue May 14, 2021 · 0 comments

Comments

@beno64
Copy link

beno64 commented May 14, 2021

I have a table:
CREATE TABLE album (
album_id tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
album varchar(10) COLLATE utf8_hungarian_ci DEFAULT NULL,
jelleg varchar(50) COLLATE utf8_hungarian_ci DEFAULT NULL,
alg tinyint(3) unsigned DEFAULT '0',
anyag_id smallint(5) unsigned DEFAULT NULL,
tarolo1_type_id smallint(5) unsigned DEFAULT NULL,
tarolo2_type_id smallint(5) unsigned DEFAULT NULL,
tarolo3_type_id smallint(5) unsigned DEFAULT NULL,
tarolo4_type_id smallint(5) unsigned DEFAULT NULL,
PRIMARY KEY (album_id),
KEY fk_album_szotar_anyag_idx (anyag_id),
KEY fk_album_tarolo1_idx (tarolo1_type_id),
KEY fk_album_tarolo2_idx (tarolo2_type_id),
KEY fk_album_tarolo3_idx (tarolo3_type_id),
KEY fk_album_tarolo4_idx (tarolo4_type_id),
CONSTRAINT fk_album_anyag FOREIGN KEY (anyag_id) REFERENCES szotar (sz_id),
CONSTRAINT fk_album_tarolo1 FOREIGN KEY (tarolo1_type_id) REFERENCES szotar (sz_id),
CONSTRAINT fk_album_tarolo2 FOREIGN KEY (tarolo2_type_id) REFERENCES szotar (sz_id),
CONSTRAINT fk_album_tarolo3 FOREIGN KEY (tarolo3_type_id) REFERENCES szotar (sz_id),
CONSTRAINT fk_album_tarolo4 FOREIGN KEY (tarolo4_type_id) REFERENCES szotar (sz_id)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8 COLLATE=utf8_hungarian_ci;

CREATE TABLE szotar (
sz_id smallint(5) unsigned NOT NULL AUTO_INCREMENT,
csoport varchar(50) CHARACTER SET utf8 COLLATE utf8_hungarian_ci DEFAULT NULL,
kod varchar(50) CHARACTER SET utf8 COLLATE utf8_hungarian_ci DEFAULT NULL,
szoveg varchar(100) CHARACTER SET utf8 COLLATE utf8_hungarian_ci DEFAULT NULL,
jelzo varchar(50) CHARACTER SET utf8 COLLATE utf8_hungarian_ci DEFAULT NULL,
jelzo2 varchar(50) CHARACTER SET utf8 COLLATE utf8_hungarian_ci DEFAULT NULL,
sorrend tinyint(3) unsigned DEFAULT NULL,
megjegyzes varchar(50) CHARACTER SET utf8 COLLATE utf8_hungarian_ci DEFAULT NULL,
PRIMARY KEY (sz_id),
KEY index_2 (csoport,kod,szoveg)
) ENGINE=InnoDB AUTO_INCREMENT=457 DEFAULT CHARSET=utf8 COLLATE=utf8_hungarian_ci ROW_FORMAT=DYNAMIC;

When I generate model the $relations array consists all album fks, but szotar not consists all album fks, only last fk (tarolo4_type).

What can I do?

@beno64 beno64 changed the title Mode generation getRelatins() bug Model generation getRelations() bug May 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant