Comments (3)
Obviously, the observed difference in the name of the primary key occurs due to the fact that, when creating primary key via creating a table, the DefaultPrimaryKeyNameConvention
class is used to generate the name, and when creating a standalone primary key, the DefaultConstraintNameConvention
class is used to generate the name.
I agree that it would be correct for the name for the primary key to be generated the same in all cases. I have created a pull request with the appropriate fix, please check #1803.
I won’t reassure you and I’ll say right away that I’m not a maintainer. For now, I suggest keeping in mind that the default primary key name is not guaranteed. And each time explicitly set the name of the primary key.
from fluentmigrator.
This would be a breaking change, but seems reasonable. For now you can implement a different naming convention as a workaround.
from fluentmigrator.
The root cause here is that we're using CreateConstraintExpression.
fluentmigrator/src/FluentMigrator/Builders/Create/CreateExpressionRoot.cs
Lines 129 to 144 in 7efff09
It gets generated here:
Which in turn delegates ultimately to ColumnBase.GetPrimaryKeyConstraintName
:
fluentmigrator/src/FluentMigrator.Runner.Core/Generators/Base/ColumnBase.cs
Lines 318 to 328 in 7efff09
- ColumnBase would need a dependency on IConventionSet to get the primary key name convention
- should have an explicit IPrimaryKeyNameConvention interface, although probably not strictly required, it does help with discoverability.
from fluentmigrator.
Related Issues (20)
- AsBoolean() creates INTEGER column instead of Boolean/BIT on SQLite HOT 14
- Request to add a fluent entity existence check to entity creation and deletion statements HOT 1
- The test method "CanCreateIndexWithVacuumCleanupIndexScaleFactor" fails in the master branch HOT 1
- We need MongoDB support for at least a minimal subset of migration operations
- SqlServer Runner - "StackOverflowException Operation Caused a stack overflow" HOT 2
- Is it possible to create an automatic table with fluentmigrator? HOT 5
- More options when creating tables needed HOT 1
- RawSql.Insert cannot be used as entire Where clause or Set clause in UpdateDataExpression/DeleteDataExpression
- Registering custom IVersionTableMetaData must be done after AddFluentMigratorCore HOT 9
- Aspire example code
- Do not hardcode date when updating `VersionInfo` table HOT 3
- Some tests fail if culture is different from en-US HOT 6
- Migrate database SqlServer and DotNet 8 HOT 3
- FluentMigrator creates two equivalent indices for SQLite
- Upgrade GitVersion.Tool
- My Project implemented a sharding strategy, how can I use fluentmigrator to upgrade the database HOT 1
- Transitive Dependency Vulnerabilities HOT 2
- Ability to pass parameters to Execute root sub-commands Script/Sql/EmbeddedScript
- PostgreSQL Error 55000 if database level replication is enabled HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fluentmigrator.