0
In the 1:1 relations I have done in another way that only today I noticed, in which I turn this 1:1 to 1:N, and in the table that has the N, the primary key is the same as the 1, so it’s like 1:1, but I don’t know if this method can generate errors?
Example:
tabela 1
--------------
id_ficha - PrimaryKey
etc..
tabela 2
-------------
id_ficha -PrimaryKey e ForeignKey(tabela1)
etc...
I did not understand what exactly is your doubt. Is it about the cardinality? Could it be more specific?
– gato
If you want to relate table 1 to 2, you need to have the "id" of one on the other to "tie" the die, if you say the id is the same. 1°- will these id always be the same? 2°- If they are always equal and you do not want to put the id of one table in the other, this "mooring" will be in charge of the code, which will always have to take the "id’s" equal, and not by the bank. From the bank’s point of view, it would only be two fields, which by chance would have equal values
– Fleuquer Lima
@2016, I don’t know any other way to make a 1:1 relationship
– Tobias Mesquita
Usually what they give in college is, create two different primary keys one for each table, and when it is 1:1 the primary key of the two passes to the foreign key of the other. That way I presented up, I was always told I might be sick, and I’m trying to clear that up
– programmer2016