New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem with Tablename and CodeFirst [DNET753] #695
Comments
Commented by: @cincuranet You're required to properly configure your DbContext to fit Firebird's limitations. There's nothing I can do about it. |
Commented by: Andreas Patock (apatock) For example: public class KSC_ATE_OVERRIDE_RESERVE didn't work! KSC_ATE_OVERRIDE_RESERVE is not longer than 31 chars. If I write the following: public class KSC_ATE_OVERRIDE_RESERVE This is working and also creates a Primary Key ID in the Database. |
Commented by: Andreas Patock (apatock) I maybe found it: It is the name of the before insert trigger. Do you know how to override the generator for this? |
Commented by: @cincuranet Yes. Implement your own IFbMigrationSqlGeneratorBehavior (https://github.com/cincuranet/FirebirdSql.Data.FirebirdClient/blob/master/Provider/src/EntityFramework.Firebird/IFbMigrationSqlGeneratorBehavior.cs). |
Commented by: Andreas Patock (apatock) Hi Jiri, Following to your last comment I created a CustomDbConfiguration and a new CustomFbMigrationSqlGeneratorBehavior. Then I first tried to return only the new Triggername from the CreateIdentityForColumn method. That of course doesn't work. I looked in the DefaultFbMigrationGeneratorBehavior and realized that I must return the complete SQLs for creating the Trigger. Wouldn't it be easier to inherit from DefaultFbMigartionSqlGeneratorBehavior, make the CreateTriggerName virtual and override this? This would be great! I know this is all for compatibility with other DBs, but due to the limitations of firebird (length of names), wouldn't it be nice if you provide a FbMigrationSqlGenerator which takes note of this limitations and offer this to the community. So they can use the naming rules you selected and can simply use the firebird database. If someone else want to use another naming scheme then he can implement all this by himself, but if someone just want to use firebird for simple datastructures he can just use your Generator and all is working. I think no one else knows the firebird database as you do - so you would be the right man for the job. Please think of it. Kind regards, |
Commented by: @cincuranet Sure. That's easy to do. |
Modified by: @cincuranet |
Modified by: @cincuranet |
Modified by: @cincuranet |
Commented by: @cincuranet Added as DNET754. |
Submitted by: Andreas Patock (apatock)
Is related to DNET754
If we use a classname longer than 15 letters we get a "Name longer than database column size" on Update-Database.
I think someone does a byte count over a unicode string, so 16 letters result in 32 bytes and this is more than the firebird restriction.
What I wonder is that the problem didn't appear on foreignkey-names.
The text was updated successfully, but these errors were encountered: