3
I have an MVC DDD application that uses Sqlserver.
I’m trying to get the database to Postgressql, but there is a FK duplicity error.
For example, the default Sqlserver would be generated:
FK_dbo.Adicao_dbo.OrgaoEmissorAtoLegal_ExTarifOrgEmissorAtoLegaLegalId
FK_dbo.Adicao_dbo.OrgaoEmissorAtoLegal_ExTarifOrgEmissorAtoLegalId
But in Postgressql when generating FK he tends to do:
FK_dbo.Adicao_dbo.OrgaoEmissorAtoLegal_ExTarifOrgEmissorAtoLega -- ambas iguais
It is possible to apply another rule in FK generation automatically?
Someone’s already done it?
Which version of postgresql you are using?
– Andre Mesquita
I’ve been reading the documentation and an identifier can be up to 63 characters long. Check if there is no prefix inclusion in fk’s name in the generation. (https://til.hashrocket.com/posts/8f87c65a0a-postgresqls-max-identifier-length-is-63-bytes)
– Andre Mesquita
the version is 9.6.10.
– nfrigo
Exactly the indicator goes up to 63 characters, but there is a way to say this for Migration so that when generating the FK apply this new rule?
– nfrigo