Questions tagged [dbmigrator]
11 questions
44
votes
5 answers
Code first DbMigrator causes error when building from different machines
We have a project under SCM. When I build it from my machine and publish to a remote server via msdeploy, everything works fine.
When my colleague tries the same thing with the same project, freshly pulled from SCM, on the remote server entity…

spender
- 117,338
- 33
- 229
- 351
6
votes
3 answers
DbMigrator.GetPendingMigrations() always empty
I'm using the DbMigrator class to get a list of pending migrations. For some reason it returns no items even though there are pending migrations. Am i missing a step?
var configuration = new Migrations.Configuration();
configuration.TargetDatabase =…

newbie_86
- 4,520
- 17
- 58
- 89
5
votes
1 answer
Manually Provide DbContext to DbMigrator
Platform
.NET 4.5 and Entity Framework 6.
Question
I have the following code to execute a Migration:
//The following function just returns an object of the Configuration() class
//generated by code migrations
var migratorConfig =…

Aidin
- 2,134
- 22
- 26
5
votes
1 answer
How to make use of EF CodeFirst Migrations without hardcoding nameOrConnectionString
How can you make EF migrations work without hardcoding a nameorconnectionstring in the base of the required parameterless constructor?
EF migrations is forcing you to add a default constructor to the custom dbcontext. In the base of the dbcontext…

wilkokosten
- 351
- 1
- 4
1
vote
0 answers
Supply Context to DbMigrator
How DbMigrator works
I have code that instantiates a new DbMigrator(new Configuration())
Configuration is a custom extension of DbMigrationsConfiguration, where T is DbContext
So within Configuration, there is a ContextType, which is equal to…

Suamere
- 5,691
- 2
- 44
- 58
0
votes
0 answers
SELECT on full model fails because some columns are created in a later migration
I'm using Entity Framework 6 with SQLite and https://www.nuget.org/packages/System.Data.SQLite.EF6.Migrations. AutomaticMigrationsEnabled is disabled. In update-method I call Migrator.Update(pendingMigration); for each pending migration.
The first…

Christopher
- 13
- 3
0
votes
1 answer
Abp framework : An error occurred during the initialize, after switching from EF Core SqlServer to EF Core PostgreSQL Provider
I'm using abp framework and after switching from EF Core SqlServer to EF Core PostgreSQL Provider during the project, I get the following error when I run the DbMigrator or Host projects. Can someone help me with this ?
The problem is in one of the…

Zakaria Errafiqi
- 1
- 1
0
votes
1 answer
How to start Liquibase migrations before MyBatis mapping in a SpringBootApplication?
How to start Liquibase migrations before MyBatis mapping in a SpringBootApplication?
Is it an official way for it? I tried DependsOn it doesn't work, exposing cyclic dependency

J.J. Beam
- 2,612
- 2
- 26
- 55
0
votes
2 answers
Entity Framework/dbMigration - Unwanted decimal rounding
I'm working on a new Code-First Entity Framework (using dbMigration) solution, and I've run into a bit of a snag that I've been unable to get past.
Even though I modified the generated Migration file to set the precision/scale for a decimal field to…

Scott
- 123
- 1
- 1
- 7
0
votes
1 answer
Possible to add migration using EF DbMigrator
Is it possible to add a migration file using DbMigrator in code instead of through the powershell commands?

newbie_86
- 4,520
- 17
- 58
- 89
0
votes
1 answer
MVC3 code first: migrations and generating the database
I'm a bit lost how I should get the entity framework to work with automatic migration. I want:
The database to be created automatically when it doesnt exist
The database to be updated automatically when the model changed
For the latter I'm using…

garma
- 213
- 1
- 3
- 12