NocoDB
Bug empty releations [Jul 22]
Discord-Discussions
NocoDB
November 3, 2022, 10:32am
1
lublak
asked
I have a strange behaviour: empty relations
image0
198×759 2.59 KB
NocoDB
November 3, 2022, 10:32am
2
lublak
replied
This is actually a “to many” relationship.
NocoDB
November 3, 2022, 10:32am
3
lublak
replied
If i click on them (also empty):
NocoDB
November 3, 2022, 10:32am
4
lublak
replied
The PurchasingPages table:
NocoDB
November 3, 2022, 10:32am
5
lublak
replied
so the other way round it shows everything ok.
NocoDB
November 3, 2022, 10:32am
6
lublak
replied
The ddls:
```sql
CREATE TABLE purchasing_pages (
purchasing_id int8 NOT NULL,
page_path varchar(255) NOT NULL,
CONSTRAINT purchasing_pages_check_page_path CHECK (((page_path)::text ~ ‘^([a-zA-Z0-9-_ ]+/)+[a-zA-Z0-9-_ ~]+.[tT][iI][fF]’::text)),
CONSTRAINT purchasing_pages_purchasing_id_page_path_key UNIQUE (purchasing_id, page_path)
);
ALTER TABLE purchasing_pages ADD CONSTRAINT purchasing_pages_id_fkey FOREIGN KEY (purchasing_id) REFERENCES purchasing(id) ON UPDATE CASCADE ON DELETE RESTRICT;
```
```sql
CREATE TABLE purchasing (
id int4 NOT NULL GENERATED BY DEFAULT AS IDENTITY,
mandant_id int2 NOT NULL,
company_code int4 NOT NULL,
sequence_number int8 NOT NULL,
“year” int2 NOT NULL,
“month” int2 NOT NULL,
CONSTRAINT purchasing_check_month CHECK (((month >= 1) AND (month <= 12))),
CONSTRAINT purchasing_check_year CHECK (((year >= 2000) AND (year <= 2100))),
CONSTRAINT purchasing_client_plant_sequence_number_key UNIQUE (mandant_id, company_code, sequence_number),
CONSTRAINT purchasing_pkey PRIMARY KEY (id)
);
CREATE INDEX purchasing_id_idx ON purchasing USING btree (id);
ALTER TABLE purchasing ADD CONSTRAINT purchasing_company_code_fk FOREIGN KEY (company_code) REFERENCES company_codes(id);
ALTER TABLE purchasing ADD CONSTRAINT purchasing_mandant_id_fkey FOREIGN KEY (mandant_id) REFERENCES purchasing_mandant_names(id) NOT VALID;
```
NocoDB
November 3, 2022, 10:32am
7
Autogenerated from discord
Join
NocoDB’s
community
Discord
•
Twitter
•
Reddit
•
Docs
Related Topics
Topic
Replies
Views
Activity
Deleting table with 'Links' [May 26]
Discord-Discussions
13
176
November 3, 2022
Filter on relations [Feb 12]
Discord-Discussions
2
137
November 3, 2022
Many-to-Many relationship creation [Feb 10]
Discord-Discussions
18
172
November 3, 2022
Refresh table's relationship on nocodb after updating and creating foreign keys on table [Apr 27]
Discord-Discussions
30
280
November 3, 2022
Multiple relation columns between two tables [Mar 23]
Discord-Discussions
14
193
November 3, 2022