Skip to content

Instantly share code, notes, and snippets.

@jpolvora
Last active August 29, 2015 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jpolvora/04c40b8b54890ab7add3 to your computer and use it in GitHub Desktop.
Save jpolvora/04c40b8b54890ab7add3 to your computer and use it in GitHub Desktop.
Contornar o problema com Firebird, que possui limitação de 31 caracteres em nomes de tabelas, constraints, etc.
/// <summary>
/// Firebird possui limitação de 31 caracteres em nomes de tabelas, constraints, etc.
/// Esta convenção limita o nome do AssociationSet para 28 caracteres pois o Script SQL gerado para criação utiliza o AssociationSet.Name para
/// formar a constraint de chave estrangeira FK_{0}, associationSet.Name
/// </summary>
public class AssociationSetNamingConvention : IStoreModelConvention<AssociationSet>
{
public void Apply(AssociationSet item, DbModel model)
{
if (item.Name.Length <= 28)
return;
item.Name = item.Name.Substring(0, 28);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment