I am trying to use Libreoffice Base to create a DB. To begin, I created 2 tables:
Table1 called “UF” with 2 fields:
- UF (TEXT Fix CHAR, Length=2) - this is the primary key with unique values
- estado (TEXT Varchar)
Table2 called “Municipios” with 22 fields, among which: - IdIBGE (INTEGER) - This is the primary key with unique values
- UF (TEXT Fix CHAR, Length=2)
When I try to create a relationship 1:N between these 2 tables, it gives an error: Primary or unique constraint required on main table: “UF” in statement [ALTER TABLE “Municipios” ADD FOREIGN KEY (“UF”) REFERENCES “UF” (“UF”)]
What am I doing wrong?
The UF field in the UF table is already a primary key unique.
Thank you