-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
has many Relations in postgresql do not work #5782
Comments
cc @hacksparrow @agnes512 could you help take a look? Thanks. |
@gioppoluca If you think it's a bug, could you make it clear that why it is a bug and the steps to reproduce? or please use the As for questions, could you state it clear as well? i.e you'd like to have the related model returned only, or have the target returned along with its related model? Since If you'd like to have the target returned along with its related mode, you will need to have the inclusion resolver set. Then use filter Since I only have limited information about your question, I could only answer anything that might be related. Again, if you think it's a bug, please provide steps to reproduce it. If the above doesn't help, you might need to provide the repositories as well. Thanks. |
Hi @gioppoluca you please try with the inclusion resolver set as @agnes512 told and you can refer these links for more help. |
Also, I think this blog would help you. |
Closing due to inactivity. |
Steps to reproduce
Current Behavior
created 2 tables with a relation between them but the GET method do not return the related rows
Using the rest-crud controller
Expected Behavior
Since I defined a relation property I'm expecting to have it filled up
I'm adding the 2 files of the model, the generated controller and the tables definition:
`
CREATE TABLE "micadoapp"."topic"
(
id smallint PRIMARY KEY NOT NULL,
icon text,
published bool DEFAULT false NOT NULL,
publication_date date
)
;
CREATE UNIQUE INDEX topic_pkey ON "micadoapp"."topic"(id)
;
CREATE TABLE "micadoapp"."topic_translation"
(
id smallint DEFAULT nextval('topic_translation_id_seq'::regclass) NOT NULL,
lang varchar(10) NOT NULL,
topic varchar(20),
translation_date timestamp,
topic_id smallint NOT NULL,
CONSTRAINT topic_translation_pk PRIMARY KEY (id,lang)
)
;
ALTER TABLE "micadoapp"."topic_translation"
ADD CONSTRAINT topic_translation_fk
FOREIGN KEY (topic_id)
REFERENCES "micadoapp"."topic"(id)
;
ALTER TABLE "micadoapp"."topic_translation"
ADD CONSTRAINT topic_translation_lang_fkey
FOREIGN KEY (lang)
REFERENCES "micadoapp"."languages"(lang) ON DELETE CASCADE ON UPDATE CASCADE
;
CREATE UNIQUE INDEX topic_translation_pk ON "micadoapp"."topic_translation"
(
id,
lang
)
;
topic-translation.model.ts.txt
topic.model.ts.txt
topic.rest-config.ts.txt
`
The text was updated successfully, but these errors were encountered: