Skip to content

Commit

Permalink
Int64 can be used as data type in primary keys
Browse files Browse the repository at this point in the history
  • Loading branch information
dradovic committed Mar 21, 2011
1 parent f338fdb commit cbcf30f
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions MigSharp/trunk/CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
1.1.0 - Added support for SQLite
- Int64 can be used as data type in primary keys
- IProvider: added the DropDefault method which replaces the AddedColumn.DropThereafter and gives the providers
more flexibility to report what they support and what not
- Teradata: raise validation error on adding/dropping primary keys (Teradata does not support that)
Expand Down
2 changes: 1 addition & 1 deletion MigSharp/trunk/MigSharp.NUnit/Integration/Migration4.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ internal class Migration4 : IIntegrationTestMigration
public void Up(IDatabase db)
{
db.CreateTable(TableName)
.WithPrimaryKeyColumn(ColumnNames[0], DbType.Int32).AsIdentity()
.WithPrimaryKeyColumn(ColumnNames[0], DbType.Int64).AsIdentity()
.WithNotNullableColumn(ColumnNames[1], DbType.String);

db.Execute(string.Format(CultureInfo.InvariantCulture, @"INSERT INTO ""{0}"" (""{1}"")VALUES ('{2}')", TableName, ColumnNames[1], ExpectedValues[0, 1]));
Expand Down
2 changes: 1 addition & 1 deletion MigSharp/trunk/MigSharp/Providers/OracleProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace MigSharp.Providers
[Supports(DbType.Guid, Warning = "Requires custom ADO.NET code to convert to/from a byte array (call Guid.ToByteArray(), Guid(byte[])) and the DbParameter.DbType must be set to DbType.Binary.")]
[Supports(DbType.Int16)]
[Supports(DbType.Int32, CanBeUsedAsPrimaryKey = true)]
[Supports(DbType.Int64)]
[Supports(DbType.Int64, CanBeUsedAsPrimaryKey = true)]
[Supports(DbType.String, MaximumSize = 2000, CanBeUsedAsPrimaryKey = true)]
[Supports(DbType.String, Warning = "Might require custom ADO.NET code as NCLOB has unique restrictions (e.g. columns using this data type cannot appear in a WHERE clause without converting using the Oracle 'to_char' function).")]
internal class OracleProvider : IProvider
Expand Down
2 changes: 1 addition & 1 deletion MigSharp/trunk/MigSharp/Providers/SQLiteProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace MigSharp.Providers
[Supports(DbType.Guid)]
[Supports(DbType.Int16)]
[Supports(DbType.Int32, CanBeUsedAsPrimaryKey = true)]
[Supports(DbType.Int64)]
[Supports(DbType.Int64, CanBeUsedAsPrimaryKey = true)]
[Supports(DbType.SByte)]
//[Supports(DbType.Single)] throws a System.OverflowException in the SQLiteDataReader when trying to convert the data type to a decimal!?
[Supports(DbType.String, MaximumSize = 4000, CanBeUsedAsPrimaryKey = true)]
Expand Down
2 changes: 1 addition & 1 deletion MigSharp/trunk/MigSharp/Providers/SqlServerCe4Provider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace MigSharp.Providers
[Supports(DbType.Guid)]
[Supports(DbType.Int16)]
[Supports(DbType.Int32, CanBeUsedAsPrimaryKey = true)]
[Supports(DbType.Int64)]
[Supports(DbType.Int64, CanBeUsedAsPrimaryKey = true)]
//[Supports(DbType.SByte)]
[Supports(DbType.Single)]
[Supports(DbType.String, MaximumSize = 4000, CanBeUsedAsPrimaryKey = true)]
Expand Down
2 changes: 1 addition & 1 deletion MigSharp/trunk/MigSharp/Providers/SqlServerProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace MigSharp.Providers
[Supports(DbType.Guid)]
[Supports(DbType.Int16)]
[Supports(DbType.Int32, CanBeUsedAsPrimaryKey = true)]
[Supports(DbType.Int64)]
[Supports(DbType.Int64, CanBeUsedAsPrimaryKey = true)]
[Supports(DbType.Single)]
[Supports(DbType.String, MaximumSize = 4000, CanBeUsedAsPrimaryKey = true)]
[Supports(DbType.String)] // translates to NVARCHAR(MAX) without specifying the Size
Expand Down
2 changes: 1 addition & 1 deletion MigSharp/trunk/MigSharp/Providers/TeradataProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace MigSharp.Providers
[Supports(DbType.Guid, Warning = "Requires custom ADO.NET code to convert to/from a byte array (call Guid.ToByteArray(), Guid(byte[])) and the DbParameter.DbType must be set to DbType.Binary.")]
[Supports(DbType.Int16, CanBeUsedAsPrimaryKey = true)]
[Supports(DbType.Int32, CanBeUsedAsPrimaryKey = true)]
[Supports(DbType.Int64)]
[Supports(DbType.Int64, CanBeUsedAsPrimaryKey = true)]
[Supports(DbType.String, MaximumSize = 8000, CanBeUsedAsPrimaryKey = true)]
[Supports(DbType.String, Warning = "Might require custom ADO.NET code as CLOB has unique restrictions.")]
internal class TeradataProvider : IProvider
Expand Down

0 comments on commit cbcf30f

Please sign in to comment.