My favorites | Sign in
Project Logo
                
Details: Show all Hide all

Last 30 days

  • Dec 08, 2009
    issue 131 (Added support for multiple schemainfo instances) commented on by bittercoder   -   I would like a copy of this patch (Implementing something similar myself).
    I would like a copy of this patch (Implementing something similar myself).
  • Dec 02, 2009
    issue 135 (Updated VS Item template) commented on by jimmy.mitchener   -   This looks good. It would be really nice if we had a template that could generate a more accurate time value for the version number. I think the only real option here is to create a wizard or use a third-party project that allows you to use T4 for you item templates.
    This looks good. It would be really nice if we had a template that could generate a more accurate time value for the version number. I think the only real option here is to create a wizard or use a third-party project that allows you to use T4 for you item templates.
  • Dec 01, 2009
    WritingMigrations Wiki page commented on by jimmy.mitchener   -   How do you get these timestamps? Is there some way to automate this?
    How do you get these timestamps? Is there some way to automate this?
  • Nov 30, 2009
    issue 135 (Updated VS Item template) reported by candland   -   Just an updated Migration.zip in migratordotnet-0.8.0\doc\extras\VS.NET Template Fixed the attribute and base class values. Defaulted the version to the $year$. Doesn't look like vs supports a formatted datetime. Removed the method bodies. Sorry, I didn't have time to do a normal patch. Really liking this project, nice work.
    Just an updated Migration.zip in migratordotnet-0.8.0\doc\extras\VS.NET Template Fixed the attribute and base class values. Defaulted the version to the $year$. Doesn't look like vs supports a formatted datetime. Removed the method bodies. Sorry, I didn't have time to do a normal patch. Really liking this project, nice work.
  • Nov 20, 2009
    issue 20 (Enhance SchemaDumper) commented on by gewalli   -   This patch might be a step on the way. Enhancing the existing functionality in SchemaDumper.Dump.
    This patch might be a step on the way. Enhancing the existing functionality in SchemaDumper.Dump.
  • Nov 20, 2009
    issue 134 (Better support for SqlServer) reported by gewalli   -   What steps will reproduce the problem? 1. Initialize SchemaDumper with "SqlServer" as provider 2. Note that for any column the properties Size, DefaultValue, Type are set to default values
    What steps will reproduce the problem? 1. Initialize SchemaDumper with "SqlServer" as provider 2. Note that for any column the properties Size, DefaultValue, Type are set to default values
  • Nov 20, 2009
    issue 133 (CREATE PROCEDURE Migration Fails Via Migration Script) reported by gmancoll   -   What steps will reproduce the problem? 1. Add multiple migrations, one of which is to create a stored procedure via a Database.ExecuteNonQuery call. 2. Ensure that the stored procedure migrations is not the first to be executed. 3. Run the migrations and generate an output script. When that script is run, because the 'CREATE PROCEDURE..' is preceded by another statement which is not completed by a 'GO' statement, the following error is raised: "'CREATE/ALTER PROCEDURE' must be the first statement in a query batch." What is the expected output? What do you see instead? Expected output is for the migrations script to execute successfully, instead the above error is raised. What version of the product are you using? On what operating system? With what .NET implementation/version? Migratordotnet Version 0.8. .Net 3.5 What database and version are you seeing this issue on? SqlServer 2005 Please provide any additional information below.
    What steps will reproduce the problem? 1. Add multiple migrations, one of which is to create a stored procedure via a Database.ExecuteNonQuery call. 2. Ensure that the stored procedure migrations is not the first to be executed. 3. Run the migrations and generate an output script. When that script is run, because the 'CREATE PROCEDURE..' is preceded by another statement which is not completed by a 'GO' statement, the following error is raised: "'CREATE/ALTER PROCEDURE' must be the first statement in a query batch." What is the expected output? What do you see instead? Expected output is for the migrations script to execute successfully, instead the above error is raised. What version of the product are you using? On what operating system? With what .NET implementation/version? Migratordotnet Version 0.8. .Net 3.5 What database and version are you seeing this issue on? SqlServer 2005 Please provide any additional information below.
  • Nov 20, 2009
    issue 130 (SQLServer nvarchar(max)) commented on by gmancoll   -   In order to create an nvarchar(max)column you need to set the size to the following length: 0x3fffffff. I presume this is a bug in how the data type is registered in the SqlServer2005Dialect class as varchar(max) and varbinary(max) are registered with sizes of 0x7fffffff = int.MaxValue.
    In order to create an nvarchar(max)column you need to set the size to the following length: 0x3fffffff. I presume this is a bug in how the data type is registered in the SqlServer2005Dialect class as varchar(max) and varbinary(max) are registered with sizes of 0x7fffffff = int.MaxValue.

Earlier this year

  • Nov 18, 2009
    Links (Various links to help you get started in Migrator.NET.) Wiki page commented on by iripka   -   Migrator.NET and MSBuild configuration tips http://michielvoo.net/blog/migrator-net-and-msbuild-configuration-tips/
  • Nov 14, 2009
    GettingStarted (Getting Started with MigratorDotNet) Wiki page commented on by Kris.Williams.USA   -   2.3.4 of Rails/ActiveRecord recently added a "rake db:seed" to the template for a new rails project. Perhaps Seed base class could be created that does something similar in this project.
    2.3.4 of Rails/ActiveRecord recently added a "rake db:seed" to the template for a new rails project. Perhaps Seed base class could be created that does something similar in this project.
  • Nov 13, 2009
    issue 132 (MySQL does not support non-numeric primary keys (such as GUI...) reported by nathan.osullivan   -   ColumnProperty.PrimaryKey is defined as 64 | Unsigned | NotNull , which sets all primary keys as unsigned. MySQL is the only dialect that implements unsigned (by inserting "UNSIGNED" into the column's SQL) but this is not legal if the column is non-numeric, such as DbType.Guid This patch changes Dialect class to store a list of DbTypes that are unsigned compatible, updates MysqlDialect to register the appropriate DbTypes, revises ColumnPropertiesMapper to utilise this new functionality, and provides 3 test cases showing correct implementation. Also available here: http://github.com/nats/migratordotnet/commit/44dcfdeefe0d51f00545f84b5fb80a0fd547f280
    ColumnProperty.PrimaryKey is defined as 64 | Unsigned | NotNull , which sets all primary keys as unsigned. MySQL is the only dialect that implements unsigned (by inserting "UNSIGNED" into the column's SQL) but this is not legal if the column is non-numeric, such as DbType.Guid This patch changes Dialect class to store a list of DbTypes that are unsigned compatible, updates MysqlDialect to register the appropriate DbTypes, revises ColumnPropertiesMapper to utilise this new functionality, and provides 3 test cases showing correct implementation. Also available here: http://github.com/nats/migratordotnet/commit/44dcfdeefe0d51f00545f84b5fb80a0fd547f280
  • Nov 12, 2009
    issue 92 (PostgreSQL support: UUID and indexes) commented on by nathan.osullivan   -   In other words, without part of this patch AddTable() will throw due to invalid SQL if one of the columns has ColumnProperty.Indexed set
    In other words, without part of this patch AddTable() will throw due to invalid SQL if one of the columns has ColumnProperty.Indexed set
  • Nov 10, 2009
    issue 131 (Added support for multiple schemainfo instances) reported by breeni   -   Hi, I needed support for multiple schemainfo instances, so I implemented it. :) I needed this because I'm developing a project using a plugin based architecture, and I want my plugins to specify migrations independently. And thus, I need more than one SchemaInfo table per database. It works at my end, but I still need to add more unit tests for the multi- context scenarios. If you guys are interested, I can send you a patch with my changes.
    Hi, I needed support for multiple schemainfo instances, so I implemented it. :) I needed this because I'm developing a project using a plugin based architecture, and I want my plugins to specify migrations independently. And thus, I need more than one SchemaInfo table per database. It works at my end, but I still need to add more unit tests for the multi- context scenarios. If you guys are interested, I can send you a patch with my changes.
  • Oct 24, 2009
    issue 130 (SQLServer nvarchar(max)) commented on by dima117a   -   for create columns varchar(max), use DbType.AnsiString type with a length int.MaxValue
    for create columns varchar(max), use DbType.AnsiString type with a length int.MaxValue
  • Oct 23, 2009
    issue 130 (SQLServer nvarchar(max)) reported by jelle.huygen   -   What steps will reproduce the problem? 1. AddColumn with column of type DbType.String and size -1 creates a column of type nvarchar(255) in stead of nvarchar(max) What version of the product are you using? On what operating system? With what .NET implementation/version? OS: Windows 7, .NET 3.5 What database and version are you seeing this issue on? DB: MSSQL 2005
    What steps will reproduce the problem? 1. AddColumn with column of type DbType.String and size -1 creates a column of type nvarchar(255) in stead of nvarchar(max) What version of the product are you using? On what operating system? With what .NET implementation/version? OS: Windows 7, .NET 3.5 What database and version are you seeing this issue on? DB: MSSQL 2005
  • Oct 16, 2009
    issue 129 (SQLite: Primary Keys on multiple fields) reported by dennis.d...@mlsolutions.be   -   If you add a table in SQLite with a primary key on more than one field, Migrator uses the alter table statement. The patch attached uses the CREATE UNIQUE INDEX
    If you add a table in SQLite with a primary key on more than one field, Migrator uses the alter table statement. The patch attached uses the CREATE UNIQUE INDEX
  • Oct 15, 2009
    issue 128 (Delete with multi-column where broken for SQL Server) reported by garry@robustsoftware.co.uk   -   What steps will reproduce the problem? 1. Create a row with an Up migration that has two fields: Database.Insert("MyTable", new[] { "Col1", "Col2" }, new[] { "Value", "Value"}); 2. Try to remove it on a Down: Database.Delete("MyTable", new[] { "Col1", "Col2" }, new[] { "Value", "Value"}); 3. This will generate SQL like: DELETE FROM MyTable WHERE (Col1='Value', Col2='Value') which isn't valid What version of the product are you using? On what operating system? With what .NET implementation/version? This occurs with migratordotnet 0.8.0
    What steps will reproduce the problem? 1. Create a row with an Up migration that has two fields: Database.Insert("MyTable", new[] { "Col1", "Col2" }, new[] { "Value", "Value"}); 2. Try to remove it on a Down: Database.Delete("MyTable", new[] { "Col1", "Col2" }, new[] { "Value", "Value"}); 3. This will generate SQL like: DELETE FROM MyTable WHERE (Col1='Value', Col2='Value') which isn't valid What version of the product are you using? On what operating system? With what .NET implementation/version? This occurs with migratordotnet 0.8.0
  • Oct 10, 2009
    MSBuildTarget Wiki page commented on by dangph   -   Or, to follow on from my previous comment, you can as that article points out, use `<UsingTask>` instead.
    Or, to follow on from my previous comment, you can as that article points out, use `<UsingTask>` instead.
  • Oct 10, 2009
    MSBuildTarget Wiki page commented on by dangph   -   Or, to follow on from my previous comment, you can as the article points out, use `<UsingTask>` instead.
    Or, to follow on from my previous comment, you can as the article points out, use `<UsingTask>` instead.
  • Oct 10, 2009
    MSBuildTarget Wiki page commented on by dangph   -   Something that is not mentioned here that was not obvious to me as someone who is not very familiar with MSBuild is that you have to copy some files to %ProgramFiles%\MSBuild\MigratorTasks. See [http://michielvoo.net/blog/configuring-migrator-net-as-an-external-tool-in-visual-studio-using-msbuild/ this article] for the details.
    Something that is not mentioned here that was not obvious to me as someone who is not very familiar with MSBuild is that you have to copy some files to %ProgramFiles%\MSBuild\MigratorTasks. See [http://michielvoo.net/blog/configuring-migrator-net-as-an-external-tool-in-visual-studio-using-msbuild/ this article] for the details.
  • Oct 08, 2009
    GettingStarted (Getting Started with MigratorDotNet) Wiki page commented on by willem.erasmus   -   Is there a way to wrap a set of migrations in a transaction...i.e. let all of them roll back if one fails?
    Is there a way to wrap a set of migrations in a transaction...i.e. let all of them roll back if one fails?
  • Oct 03, 2009
    issue 127 (Case sensitive schemas cause internal exception on (in this ...) commented on by hen...@haf.se   -   This is because there are bugs in the code when it comes the casing. Fixed with patches.
    This is because there are bugs in the code when it comes the casing. Fixed with patches.
  • Oct 03, 2009
    issue 110 (GetColumnByName should not be case sensitive) commented on by hen...@haf.se   -   You proposed fix breaks case-sensitive databases, doesn't it.
    You proposed fix breaks case-sensitive databases, doesn't it.
  • Oct 03, 2009
    issue 127 (Case sensitive schemas cause internal exception on (in this ...) reported by hen...@haf.se   -   What steps will reproduce the problem? 1. Create a DB with e.g. Swedish Collation_CS_AS 2. Create a table 3. Create a migration, renaming this table to the same name but different casing. Output: [...] INTERNAL ERROR System.Data.SqlClient.SqlException: Invalid column name 'version'. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolea n breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception , Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObj ect stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cm dHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, Tds ParserStateObject stateObj) at System.Data.SqlClient.SqlDataReader.ConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, Run Behavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBe havior, RunBehavior runBehavior, Boolean returnStream, Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehav ior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehav ior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, S tring method) at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behav ior) at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader() at Migrator.Providers.TransformationProvider.ExecuteQuery(String sql) in c:\w ork\other_projects\migratordotnet\migratordotnet-trunk\src\Migrator.Providers\Tr ansformationProvider.cs:line 594 at Migrator.Providers.TransformationProvider.Select(String what, String from, String where) in c:\work\other_projects\migratordotnet\migratordotnet-trunk\src \Migrator.Providers\TransformationProvider.cs:line 620 at Migrator.Providers.TransformationProvider.Select(String what, String from) in c:\work\other_projects\migratordotnet\migratordotnet-trunk\src\Migrator.Prov iders\TransformationProvider.cs:line 615 at Migrator.Providers.TransformationProvider.get_AppliedMigrations() in c:\wo rk\other_projects\migratordotnet\migratordotnet-trunk\src\Migrator.Providers\Tra nsformationProvider.cs:line 747 at Migrator.BaseMigrate..ctor(List`1 availableMigrations, ITransformationProv ider provider, ILogger logger) in c:\work\other_projects\migratordotnet\migrator dotnet-trunk\src\Migrator\BaseMigrate.cs:line 19 at Migrator.MigrateAnywhere..ctor(List`1 availableMigrations, ITransformation Provider provider, ILogger logger) in c:\work\other_projects\migratordotnet\migr atordotnet-trunk\src\Migrator\MigrateAnywhere.cs:line 14 at Migrator.BaseMigrate.GetInstance(List`1 availableMigrations, ITransformati onProvider provider, ILogger logger) in c:\work\other_projects\migratordotnet\mi gratordotnet-trunk\src\Migrator\BaseMigrate.cs:line 25 at Migrator.Migrator.MigrateTo(Int64 version) in c:\work\other_projects\migra tordotnet\migratordotnet-trunk\src\Migrator\Migrator.cs:line 136 at Migrator.NAnt.MigrateTask.RunMigration(Migrator mig) in c:\work\other_proj ects\migratordotnet\migratordotnet-trunk\src\Migrator.NAnt\MigrateTask.cs:line 1 74 at Migrator.NAnt.MigrateTask.Execute(Assembly asm) in c:\work\other_projects\ migratordotnet\migratordotnet-trunk\src\Migrator.NAnt\MigrateTask.cs:line 162 at Migrator.NAnt.MigrateTask.ExecuteTask() in c:\work\other_projects\migrator dotnet\migratordotnet-trunk\src\Migrator.NAnt\MigrateTask.cs:line 138 at NAnt.Core.Task.Execute() at NAnt.Core.Target.Execute() at NAnt.Core.Project.Execute(String targetName, Boolean forceDependencies) at NAnt.Core.Project.Execute() at NAnt.Core.Project.Run() What is the expected output? What do you see instead? Not an internal error. Success. What version of the product are you using? On what operating system? With what .NET implementation/version? Latest d/lable version What database and version are you seeing this issue on? SQL Server 2008 Enterprise Ed.
    What steps will reproduce the problem? 1. Create a DB with e.g. Swedish Collation_CS_AS 2. Create a table 3. Create a migration, renaming this table to the same name but different casing. Output: [...] INTERNAL ERROR System.Data.SqlClient.SqlException: Invalid column name 'version'. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolea n breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception , Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObj ect stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cm dHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, Tds ParserStateObject stateObj) at System.Data.SqlClient.SqlDataReader.ConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, Run Behavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBe havior, RunBehavior runBehavior, Boolean returnStream, Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehav ior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehav ior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, S tring method) at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behav ior) at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader() at Migrator.Providers.TransformationProvider.ExecuteQuery(String sql) in c:\w ork\other_projects\migratordotnet\migratordotnet-trunk\src\Migrator.Providers\Tr ansformationProvider.cs:line 594 at Migrator.Providers.TransformationProvider.Select(String what, String from, String where) in c:\work\other_projects\migratordotnet\migratordotnet-trunk\src \Migrator.Providers\TransformationProvider.cs:line 620 at Migrator.Providers.TransformationProvider.Select(String what, String from) in c:\work\other_projects\migratordotnet\migratordotnet-trunk\src\Migrator.Prov iders\TransformationProvider.cs:line 615 at Migrator.Providers.TransformationProvider.get_AppliedMigrations() in c:\wo rk\other_projects\migratordotnet\migratordotnet-trunk\src\Migrator.Providers\Tra nsformationProvider.cs:line 747 at Migrator.BaseMigrate..ctor(List`1 availableMigrations, ITransformationProv ider provider, ILogger logger) in c:\work\other_projects\migratordotnet\migrator dotnet-trunk\src\Migrator\BaseMigrate.cs:line 19 at Migrator.MigrateAnywhere..ctor(List`1 availableMigrations, ITransformation Provider provider, ILogger logger) in c:\work\other_projects\migratordotnet\migr atordotnet-trunk\src\Migrator\MigrateAnywhere.cs:line 14 at Migrator.BaseMigrate.GetInstance(List`1 availableMigrations, ITransformati onProvider provider, ILogger logger) in c:\work\other_projects\migratordotnet\mi gratordotnet-trunk\src\Migrator\BaseMigrate.cs:line 25 at Migrator.Migrator.MigrateTo(Int64 version) in c:\work\other_projects\migra tordotnet\migratordotnet-trunk\src\Migrator\Migrator.cs:line 136 at Migrator.NAnt.MigrateTask.RunMigration(Migrator mig) in c:\work\other_proj ects\migratordotnet\migratordotnet-trunk\src\Migrator.NAnt\MigrateTask.cs:line 1 74 at Migrator.NAnt.MigrateTask.Execute(Assembly asm) in c:\work\other_projects\ migratordotnet\migratordotnet-trunk\src\Migrator.NAnt\MigrateTask.cs:line 162 at Migrator.NAnt.MigrateTask.ExecuteTask() in c:\work\other_projects\migrator dotnet\migratordotnet-trunk\src\Migrator.NAnt\MigrateTask.cs:line 138 at NAnt.Core.Task.Execute() at NAnt.Core.Target.Execute() at NAnt.Core.Project.Execute(String targetName, Boolean forceDependencies) at NAnt.Core.Project.Execute() at NAnt.Core.Project.Run() What is the expected output? What do you see instead? Not an internal error. Success. What version of the product are you using? On what operating system? With what .NET implementation/version? Latest d/lable version What database and version are you seeing this issue on? SQL Server 2008 Enterprise Ed.
  • Sep 30, 2009
    issue 126 (Value returned by GetColumnByName does not match the propert...) reported by jsholzer   -   What steps will reproduce the problem? 1. Create a table in a SQL Server 2008 database with a DATETIME column 2. Use GetColumnByName() to retrieve this column as a Column object 3. The Type property of the column is DbType.String (NVARCHAR) What is the expected output? I would expect the Type property of the Column to be DbType.DateTime What do you see instead? The Type property is DbType.String What version of the product are you using? 0.8 On what operating system? Reproduced on Windows XP SP3 and Windows 7 With what .NET implementation/version? .NET 3.5 What database and version are you seeing this issue on? SQL Server 2008 (Express Edition)
    What steps will reproduce the problem? 1. Create a table in a SQL Server 2008 database with a DATETIME column 2. Use GetColumnByName() to retrieve this column as a Column object 3. The Type property of the column is DbType.String (NVARCHAR) What is the expected output? I would expect the Type property of the Column to be DbType.DateTime What do you see instead? The Type property is DbType.String What version of the product are you using? 0.8 On what operating system? Reproduced on Windows XP SP3 and Windows 7 With what .NET implementation/version? .NET 3.5 What database and version are you seeing this issue on? SQL Server 2008 (Express Edition)
  • Sep 21, 2009
    issue 125 (IDbCommand objects are not being properly disposed of) reported by messorian   -   I have encountered an issue with sqlite (managed provider) where the file will remain locked if the command object is not properly disposed of. To reproduce the issue, run a migration and attempt to delete the file after the migration has completed. You will encounter an exception due to the file being locked by another process. You can verify that the migrations are causing the lock by monitoring the process with sysinternal's process explorer.
    I have encountered an issue with sqlite (managed provider) where the file will remain locked if the command object is not properly disposed of. To reproduce the issue, run a migration and attempt to delete the file after the migration has completed. You will encounter an exception due to the file being locked by another process. You can verify that the migrations are causing the lock by monitoring the process with sysinternal's process explorer.
  • Sep 21, 2009
    issue 119 (TransformationProvider should implement IDispose) commented on by messorian   -   I have run into this issue as well and can verify that this is an issue. It is especially apparent when using the Sqlite managed provider which does not do a good job of cleaning up after itself.
    I have run into this issue as well and can verify that this is an issue. It is especially apparent when using the Sqlite managed provider which does not do a good job of cleaning up after itself.
  • Sep 18, 2009
    issue 124 (When runiing ExecuteNonQuery command and the command has som...) reported by hoefkens.koen   -   What steps will reproduce the problem? 1. Create a Migration class that runs a ExecuteNonQuery with a SQL test that containes curly brackets 2. Execute the Migration from the console application 3. The console application throws an Exception "input string was not in correct format" What is the expected output? What do you see instead? Expected : No exception and execute the TSQL script. Output: Exception "input string was not in correct format" What version of the product are you using? latest 0.8 On what operating system? Windows 7/Vista With what .NET implementation/version? .NET 3.5 What database and version are you seeing this issue on? All Please provide any additional information below.
    What steps will reproduce the problem? 1. Create a Migration class that runs a ExecuteNonQuery with a SQL test that containes curly brackets 2. Execute the Migration from the console application 3. The console application throws an Exception "input string was not in correct format" What is the expected output? What do you see instead? Expected : No exception and execute the TSQL script. Output: Exception "input string was not in correct format" What version of the product are you using? latest 0.8 On what operating system? Windows 7/Vista With what .NET implementation/version? .NET 3.5 What database and version are you seeing this issue on? All Please provide any additional information below.
  • Sep 18, 2009
    issue 103 (Floating Point Columns Size) commented on by cassiot   -   Hi. Like the previous one, your code is more flexible than mine. I did it in that way because we don't see new database types everyday. So I think I will not have to change it in a long time. This case is solved but let's keep contact. And english is not my first language too, so, sorry too.
    Hi. Like the previous one, your code is more flexible than mine. I did it in that way because we don't see new database types everyday. So I think I will not have to change it in a long time. This case is solved but let's keep contact. And english is not my first language too, so, sorry too.
  • Sep 15, 2009
    issue 103 (Floating Point Columns Size) commented on by dima117a   -   Thank you for your reply! When I wrote to you my last comment, I was not familiar with the code. I made a assumption about how to implement the building of SQL for columns. After that long time I studied the code and now I see that my assumption proved incorrect. I made implementation of this functional for yourself. My implementation is very similar to yours. Difference is that instead of several fields in the class 'Column' I use one field of type 'ColumnType' (http://code.google.com/p/ecm7migrator/source/browse/trunk/ECM7.Migrator.Framework/ColumnType.cs). ColumnType object can be created implicit from DbType object. Also I wrote extension methods for DbType and for create ColumnType can use this syntax: DbType.Decimal.WithSize(10, 2) DbType.String.WithSize(20) Also, I made other changes in code, but I'm not sure that these changes are needed to other people. I made separate project with my changes. If you're interested, the url of my project is http://ecm7migrator.googlecode.com/svn/trunk/ Thank you Sorry for my English
    Thank you for your reply! When I wrote to you my last comment, I was not familiar with the code. I made a assumption about how to implement the building of SQL for columns. After that long time I studied the code and now I see that my assumption proved incorrect. I made implementation of this functional for yourself. My implementation is very similar to yours. Difference is that instead of several fields in the class 'Column' I use one field of type 'ColumnType' (http://code.google.com/p/ecm7migrator/source/browse/trunk/ECM7.Migrator.Framework/ColumnType.cs). ColumnType object can be created implicit from DbType object. Also I wrote extension methods for DbType and for create ColumnType can use this syntax: DbType.Decimal.WithSize(10, 2) DbType.String.WithSize(20) Also, I made other changes in code, but I'm not sure that these changes are needed to other people. I made separate project with my changes. If you're interested, the url of my project is http://ecm7migrator.googlecode.com/svn/trunk/ Thank you Sorry for my English
  • Sep 15, 2009
    issue 103 (Floating Point Columns Size) commented on by cassiot   -   Hi. Thank you for your sugestion but I found that migrator already had most of the code to make it work, so I just created new methods and slightly modified others to make it work. I think that your code would be a better choice since it is better designed, but like I said, migrator size handing is more primitive and I would have to change it a lot too. Thank you I'm attaching the files that I've changed. Use it at your own risk! :)
    Hi. Thank you for your sugestion but I found that migrator already had most of the code to make it work, so I just created new methods and slightly modified others to make it work. I think that your code would be a better choice since it is better designed, but like I said, migrator size handing is more primitive and I would have to change it a lot too. Thank you I'm attaching the files that I've changed. Use it at your own risk! :)
  • Sep 15, 2009
    issue 107 (Problems when the constraint don't have the same name of the...) commented on by cassiot   -   I have another modification for this issue because the method RemoveForeignKey is using the "SHOW KEYS FROM" command too. Note: THIS ISSUE ONLY OCCURS IF YOU ARE USING MYSQL 5.xx or up. I DIDN'T TEST WITH OTHER VERSIONS
    I have another modification for this issue because the method RemoveForeignKey is using the "SHOW KEYS FROM" command too. Note: THIS ISSUE ONLY OCCURS IF YOU ARE USING MYSQL 5.xx or up. I DIDN'T TEST WITH OTHER VERSIONS
  • Sep 08, 2009
    issue 18 (Create Fluent Interface) commented on by after.fallout   -   Has anybody considered an interface like this? public class CreateSystemUserTable : Migration { public class SystemUser { [PrimaryKey] public Guid SystemUserId { get; set; } [Length(50)] public string FirstName { get; set; } [Length(50)] public string LastName { get; set; } [Length(50)] public string EmailAddress { get; set; } } public override void Up() { Database.AddTable<SystemUser>(); } public override void Down() { Database.RemoveTable<SystemUser>(); } } public class AddEncryptedPasswordToSystemUser : Migration { public class SystemUser { [Length(250)] public string EncryptedPassword { get; set; } } public override void Up() { Database.AddColumn<SystemUser>(); } public override void Down() { Database.RemoveColumn <SystemUser>(); } } public class AddAdminUser : Migration { public class SystemUser { public Guid SystemUserId { get; set; } public string FirstName { get; set; } public string LastName { get; set; } public string EmailAddress { get; set; } public string EncryptedPassword { get; set; } } public override void Up() { IEncryptionEngine engine = new AesEncryptionEngine(); Database.Insert(new SystemUser { SystemUserId=Guid.NewGuid(), FirstName="Joe", LastName = "Smith", EmailAddress = "admin@system.com", EncryptedPassword=engine.Encrypt("pass") }); } public override void Down() { Database.Delete<SystemUser>(u=>u.EmailAddress=="admin@system.com"); } } -- I mean, fluent interfaces are cool and all that but there is so many magic strings in your examples and they just look so very fragile. With the sample from comment 25 it could look something like this: public class AddAdminUser : Migration { public class PrimaryKeyTable { [PrimaryKey(Identity=true)] public int PrimaryKeyColumn { get; set; } } public class SomeTable { [PrimaryKey(Identity=true)] public int SomeColumn { get; set; } [ForeignKey(typeof(PrimaryKeyTable), Constraint=ForeignKeyConstraint.NoAction)] public int MyColumnThatIsForeignKey { get; set; } } public override void Up() { Database.AddTable<PrimaryKeyTable>(); Database.AddTable<SomeTable>(); } public override void Down() { Database.RemoveTable<SomeTable>(); Database.RemoveTable<PrimaryKeyTable>(); } } Which is about the same number of characters as that example would be once put into an actual migration (my rough attempt comes out to 592 chars this way vs 524 in comment 25 after whitespace removal but comment 25 fails to specify the primary key in the second table and if the keys are identity or not [could be hilo for instance]; my guess for adding those specs brings c25 up to 555 while this way could easily be brought down to 541 chars without sacrificing any readability).
    Has anybody considered an interface like this? public class CreateSystemUserTable : Migration { public class SystemUser { [PrimaryKey] public Guid SystemUserId { get; set; } [Length(50)] public string FirstName { get; set; } [Length(50)] public string LastName { get; set; } [Length(50)] public string EmailAddress { get; set; } } public override void Up() { Database.AddTable<SystemUser>(); } public override void Down() { Database.RemoveTable<SystemUser>(); } } public class AddEncryptedPasswordToSystemUser : Migration { public class SystemUser { [Length(250)] public string EncryptedPassword { get; set; } } public override void Up() { Database.AddColumn<SystemUser>(); } public override void Down() { Database.RemoveColumn <SystemUser>(); } } public class AddAdminUser : Migration { public class SystemUser { public Guid SystemUserId { get; set; } public string FirstName { get; set; } public string LastName { get; set; } public string EmailAddress { get; set; } public string EncryptedPassword { get; set; } } public override void Up() { IEncryptionEngine engine = new AesEncryptionEngine(); Database.Insert(new SystemUser { SystemUserId=Guid.NewGuid(), FirstName="Joe", LastName = "Smith", EmailAddress = "admin@system.com", EncryptedPassword=engine.Encrypt("pass") }); } public override void Down() { Database.Delete<SystemUser>(u=>u.EmailAddress=="admin@system.com"); } } -- I mean, fluent interfaces are cool and all that but there is so many magic strings in your examples and they just look so very fragile. With the sample from comment 25 it could look something like this: public class AddAdminUser : Migration { public class PrimaryKeyTable { [PrimaryKey(Identity=true)] public int PrimaryKeyColumn { get; set; } } public class SomeTable { [PrimaryKey(Identity=true)] public int SomeColumn { get; set; } [ForeignKey(typeof(PrimaryKeyTable), Constraint=ForeignKeyConstraint.NoAction)] public int MyColumnThatIsForeignKey { get; set; } } public override void Up() { Database.AddTable<PrimaryKeyTable>(); Database.AddTable<SomeTable>(); } public override void Down() { Database.RemoveTable<SomeTable>(); Database.RemoveTable<PrimaryKeyTable>(); } } Which is about the same number of characters as that example would be once put into an actual migration (my rough attempt comes out to 592 chars this way vs 524 in comment 25 after whitespace removal but comment 25 fails to specify the primary key in the second table and if the keys are identity or not [could be hilo for instance]; my guess for adding those specs brings c25 up to 555 while this way could easily be brought down to 541 chars without sacrificing any readability).
  • Sep 04, 2009
    issue 18 (Create Fluent Interface) commented on by zerovalue   -   I'm working on an interface like rails' one: //automatically adds id, based on IConvention instance CreateTable("users" t=> { t.String("name").WithSize(128); t.Int32("age").NotNullable(); t.Binary("photo"); t.Int32("address_id").AutoForeignKey("addresses"); }) http://code.google.com/p/migratordotnet-fluent/
    I'm working on an interface like rails' one: //automatically adds id, based on IConvention instance CreateTable("users" t=> { t.String("name").WithSize(128); t.Int32("age").NotNullable(); t.Binary("photo"); t.Int32("address_id").AutoForeignKey("addresses"); }) http://code.google.com/p/migratordotnet-fluent/
  • Aug 06, 2009
    GettingStarted (Getting Started with MigratorDotNet) Wiki page commented on by danyal.aytekin   -   Can migrator.net be used to migrate data?
    Can migrator.net be used to migrate data?
  • Jul 28, 2009
    issue 121 (How to generate script from the migrations) commented on by atanu.ghosh76   -   I have integrated the Migration process through a web page, thanks to the contrib project Migrator.Web. In that web page I have implemented the code to log the SQL modifications in a sql file. If you want I can share the code with you.
    I have integrated the Migration process through a web page, thanks to the contrib project Migrator.Web. In that web page I have implemented the code to log the SQL modifications in a sql file. If you want I can share the code with you.
  • Jul 28, 2009
    MSBuildTarget Wiki page commented on by m...@longtailvideo.com   -   Also, "Scriptfile" needs to be "scriptFile".
    Also, "Scriptfile" needs to be "scriptFile".
  • Jul 15, 2009
    WritingMigrations Wiki page commented on by gianmarco.gherardi   -   Looking at the source i found that is possibile to generate a migration containing all table in a specified database. This feature is accessible via commandline: Migrator.Console.exe SqlServer "Server=localhost\SQLEXPRESS;Database=DB;Trusted_Connection=True" MyMigrations.dll -dump "c:\temp\dump.cs" Will be nice to have this useful feature documented in the wiki!
    Looking at the source i found that is possibile to generate a migration containing all table in a specified database. This feature is accessible via commandline: Migrator.Console.exe SqlServer "Server=localhost\SQLEXPRESS;Database=DB;Trusted_Connection=True" MyMigrations.dll -dump "c:\temp\dump.cs" Will be nice to have this useful feature documented in the wiki!
  • Jul 14, 2009
    issue 123 (Can't use TransformationProvider.this[] to tell apart dialec...) commented on by coldacid   -   This patch includes the change from the previous patch, as well as changes related to renaming Migrator.Providers.SqlServer.SqlServerDialect to SqlServerPureDialect. I'm now using these changes to tell apart SQL Server dialects, but further testing is probably required to make sure things work fine with other databases as well.
    This patch includes the change from the previous patch, as well as changes related to renaming Migrator.Providers.SqlServer.SqlServerDialect to SqlServerPureDialect. I'm now using these changes to tell apart SQL Server dialects, but further testing is probably required to make sure things work fine with other databases as well.
  • Jul 14, 2009
    issue 123 (Can't use TransformationProvider.this[] to tell apart dialec...) commented on by coldacid   -   Ah, another possible (and better) solution: rename class SqlServerDialect to SqlServerPureDialect, and use this patch so that TransformationProvider.IsThisProvider checks dialect instead of provider name. In this case, "SqlServer" will match any SQL Server dialect, but "SqlServerPure" will match only the "pure" one.
    Ah, another possible (and better) solution: rename class SqlServerDialect to SqlServerPureDialect, and use this patch so that TransformationProvider.IsThisProvider checks dialect instead of provider name. In this case, "SqlServer" will match any SQL Server dialect, but "SqlServerPure" will match only the "pure" one.
  • Jul 14, 2009
    issue 123 (Can't use TransformationProvider.this[] to tell apart dialec...) reported by coldacid   -   Right now, telling apart classic SQL Server from SQL Server CE does not work with TransformationProvider.this[] due to the simple definition of TransformationProvider.IsThisProvider. As some SQL Server commands don't work with CE, this can pose a problem for developers who are building migrations that should work across various versions of SQL Server (and/or other database projects). The attached patch redefines IsThisProvider in SqlServerTransformationProvider, in such a way that the various different database dialects supported can be told apart. This may cause issues for migrations where dialect is unimportant, however; a better solution still needs to be found.
    Right now, telling apart classic SQL Server from SQL Server CE does not work with TransformationProvider.this[] due to the simple definition of TransformationProvider.IsThisProvider. As some SQL Server commands don't work with CE, this can pose a problem for developers who are building migrations that should work across various versions of SQL Server (and/or other database projects). The attached patch redefines IsThisProvider in SqlServerTransformationProvider, in such a way that the various different database dialects supported can be told apart. This may cause issues for migrations where dialect is unimportant, however; a better solution still needs to be found.
  • Jul 12, 2009
    issue 99 (Assigning a DateTime as default value to a DateTime-field re...) commented on by richard....@googlemail.com   -   I just fixed the equivalent issue for Oracle (in our local copy), but went about it like this: public override string Default(object defaultValue) { if (defaultValue is DateTime) { DateTime dt = (DateTime) defaultValue; string dtString= dt.ToString("yyyy'-'MM'-'dd' 'HH':'mm':'ss"); defaultValue = string.Format("to_date('{0}', 'yyyy-mm-dd hh24:mi:ss')", dtString); } else if (defaultValue is string) { defaultValue = string.Format("'{0}'", defaultValue); } return base.Default(defaultValue); } I would say that the dialect should do the quoting, so that dialect specificness doesn't leak out into the Migrations. Then handle functions such as getdate() as a new class specific e.g class Fn {...} that Dialect.Default can test for as above.
    I just fixed the equivalent issue for Oracle (in our local copy), but went about it like this: public override string Default(object defaultValue) { if (defaultValue is DateTime) { DateTime dt = (DateTime) defaultValue; string dtString= dt.ToString("yyyy'-'MM'-'dd' 'HH':'mm':'ss"); defaultValue = string.Format("to_date('{0}', 'yyyy-mm-dd hh24:mi:ss')", dtString); } else if (defaultValue is string) { defaultValue = string.Format("'{0}'", defaultValue); } return base.Default(defaultValue); } I would say that the dialect should do the quoting, so that dialect specificness doesn't leak out into the Migrations. Then handle functions such as getdate() as a new class specific e.g class Fn {...} that Dialect.Default can test for as above.
  • Jul 08, 2009
    issue 122 (Request a Delete method to delete data without writing a sql...) Status changed by geofflane   -   0.8 has Select, Insert and Delete methods.
    Status: Invalid
    0.8 has Select, Insert and Delete methods.
    Status: Invalid
  • Jul 08, 2009
    issue 122 (Request a Delete method to delete data without writing a sql...) reported by Dalene.Serfontein   -   I cannot find a Delete method to delete rows of data. It seems I have to use the .ExecuteSql method instead. E.g. for select, I could have something like .Select("CompanyNumber", "dbo._Company", "CompanyNumber=11"); I would have liked a corresponding Delete/RemoveRow method. I am now forced to write a sql statement, which forces this tool to be Database spesific. With this tool, I am obviously trying to get away from writing any sql as much as possible. Version 0.7, .Net v3.5, Vista, SQL Server 2005
    I cannot find a Delete method to delete rows of data. It seems I have to use the .ExecuteSql method instead. E.g. for select, I could have something like .Select("CompanyNumber", "dbo._Company", "CompanyNumber=11"); I would have liked a corresponding Delete/RemoveRow method. I am now forced to write a sql statement, which forces this tool to be Database spesific. With this tool, I am obviously trying to get away from writing any sql as much as possible. Version 0.7, .Net v3.5, Vista, SQL Server 2005
  • Jul 02, 2009
    issue 121 (How to generate script from the migrations) reported by Yahia.Alaoui   -   I would like to keep track of the modifications also in SQL language. Is there an option to generate from the C# migration a SQL script
    I would like to keep track of the modifications also in SQL language. Is there an option to generate from the C# migration a SQL script
  • Jun 25, 2009
    issue 103 (Floating Point Columns Size) commented on by dima117a   -   I suggest the following class for specify the size of the field of table: public class FieldSize { public int Length { get; set; } public int? Precision { get; set; } public FieldSize(int length) { Length = length; } public static implicit operator FieldSize(int i) { return new FieldSize(i); } /// <summary> /// string representation of the Length (without Precision) /// can be used to build a sql-query /// </summary> public string GetLength() { return Length.ToString(); } /// <summary> /// string representation of the Length (with Precision) /// can be used to build a sql-query /// </summary> public string GetLengthWithPrecision() { return Precision.HasValue ? string.Format("{0},{1}", Length, Precision) : GetLength(); }
    I suggest the following class for specify the size of the field of table: public class FieldSize { public int Length { get; set; } public int? Precision { get; set; } public FieldSize(int length) { Length = length; } public static implicit operator FieldSize(int i) { return new FieldSize(i); } /// <summary> /// string representation of the Length (without Precision) /// can be used to build a sql-query /// </summary> public string GetLength() { return Length.ToString(); } /// <summary> /// string representation of the Length (with Precision) /// can be used to build a sql-query /// </summary> public string GetLengthWithPrecision() { return Precision.HasValue ? string.Format("{0},{1}", Length, Precision) : GetLength(); }
  • Jun 25, 2009
    issue 56 (Migrator.Framework.dll is not strongly named.) commented on by lazydev   -   Could you please apply the patch provided, its been there for frikkin 10 months.
    Could you please apply the patch provided, its been there for frikkin 10 months.
  • Jun 15, 2009
    issue 120 (How to create a column with a specific collation ?) reported by Yahia.Alaoui   -   How to create a column with a specific collation ? In the methods Database.AddTable(...), there is no one that enables to set the collation for the column created
    How to create a column with a specific collation ? In the methods Database.AddTable(...), there is no one that enables to set the collation for the column created
  • Jun 04, 2009
    issue 119 (TransformationProvider should implement IDispose) commented on by benjamin.pollack   -   I have attached a patch.
    I have attached a patch.
  • Jun 04, 2009
    issue 119 (TransformationProvider should implement IDispose) reported by benjamin.pollack   -   TransformationProvider will leak database connections if neither Commit() nor Rollback() are called--which is entirely possible if the provider is used solely by a loader/migrator to determine whether the schema is up-to-date. The simple fix is to have TransformationProvider implement IDispose, and to dispose of the database connection at that point if it is opened.
    TransformationProvider will leak database connections if neither Commit() nor Rollback() are called--which is entirely possible if the provider is used solely by a loader/migrator to determine whether the schema is up-to-date. The simple fix is to have TransformationProvider implement IDispose, and to dispose of the database connection at that point if it is opened.
 
Hosted by Google Code