migratordotnet / migrator.net Goto Github PK
View Code? Open in Web Editor NEWDatabase migrations for .NET. Based on the idea of Rails ActiveRecord Migrations.
Database migrations for .NET. Based on the idea of Rails ActiveRecord Migrations.
Hi,
When I try to create a table with a GUID type for the ID, I get an exception that GUIDs are not allowed. (This is with the SQL Server provider.)
I'm sure there's a reason for this. The problem is, I'm creating a JSON API, so I need GUIDs for everything -- I don't want to manage a pair of IDs (integer for the DB and GUID for everything else).
Is there a way around this? SQL Server itself allows GUID primary keys.
Edit: This error doesn't appear to be coming from Migrator.NET. It's because I specified PrimaryKeyWithIdentity
. Changing it to PrimaryKey
works.
E.g. when we have just one migration and issue a command to migrate to version 2 on the command line:
Migrator.Console.exe SqlServer "Data Source=..." Database.dll -version 2
the application wil go forever:
2 <Migration not found>
2 <Migration not found>
2 <Migration not found>
2 <Migration not found>
2 <Migration not found>
2 <Migration not found>
...
Unexpected behavior when using schema.
For instance:
Assert.IsTrue(_provider.ColumnExists("dbo.TestTwo", "TestWithDefault"));
Will fail even if the column is present in the table.
If the .csproj is modified so that it calls Migrate task in the AfterBuild target the project DLL will stay locked after the first compile. The problem is that Assembly.LoadFrom locks the DLL and it can not be unloaded.
Solution for the problem is adding the attributes [LoadInSeparateAppDomain] and [Serializable] to the Migrator.MSBuild.Migrate class and inheriting from AppDomainIsolatedTask instead of the Task. TaskLogger has to be change accordingly.
[LoadInSeparateAppDomain]
[Serializable]
public class Migrate : AppDomainIsolatedTask
{
public class TaskLogger : ILogger
{
private readonly AppDomainIsolatedTask _task;
public TaskLogger(AppDomainIsolatedTask task)
{
_task = task;
}
Sorry for not using the GIT :(
Currently the BeginTransaction method in TransformationProvider always uses IsolationLevel.ReadCommitted to begin the transaction. In MySQL 5.1.66 if you are using InnoDB tables and Statement based replication the isolation level must be either IsolationLevel.RepeatableRead or IsolationLevel.Serializable.
Could the TransformationProvider be updated so that the isolation level was configurable via a property? Or as a argument to the BeginTransaction method?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.