You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Below is a program demonstrating the bug(s) (Sorry, I also posted this in templates, as that is where the link from the wiki lands)
Step to reproduce:
Run Program to induce bug.
Expected Result:
Both columns for ID and RefID to be created as bigint columns.
Actual Result:
They are created as int columns
Additional Steps:
Change column Types to Bigint in Database. Rerun Program
Expected Result:
Expect the columns For ID and RefIT would be left as bigint.
Actual Result:
ID Column remained bigint, but RefID migrated back to int.
using System;using System.Collections.Generic;using System.Linq;using System.Text;using SubSonic.DataProviders;using SubSonic.Repository;using SubSonic.SqlGeneration.Schema;namespaceDemoInt64Bug{[SubSonicTableNameOverride("Demos")]publicclassDemo{[SubSonicPrimaryKey]publiclongID{get;set;}publiclongRefID{get;set;}[SubSonicNullString]publicstringName{get;set;}}classProgram{staticvoidMain(string[]args){varprovider= ProviderFactory.GetProvider(@"Data Source=.\sqlexpress;Integrated Security=true;Initial Catalog=Tinker;","System.Data.SqlClient");varrepo=new SimpleRepository(provider, SimpleRepositoryOptions.RunMigrations);vardemo=new Demo{Name="foo"};
repo.Add(demo);// This works, but creates table with two int columns instead of two bigint columns// Also, if you change the columns to bigint, the next migration will turn the second column back to int, but not the first ?!?Int64id= demo.ID;vardemoBack= repo.Single<Demo>(id);// fails, and spews a error message about sqlite, but that error would be the opposite direction :S}}}
The text was updated successfully, but these errors were encountered:
I see a problem in SubSonic.Core\DataProviders\SqlServer\Sql2005Schema.cs in the method
public override string GetNativeType(DbType dbType)
It is returning "int" for all the integer types, but it should return "bigint" for the Int64 and UInt64 Types.
Below is a program demonstrating the bug(s) (Sorry, I also posted this in templates, as that is where the link from the wiki lands)
Step to reproduce:
Run Program to induce bug.
Expected Result:
Both columns for ID and RefID to be created as bigint columns.
Actual Result:
They are created as int columns
Additional Steps:
Change column Types to Bigint in Database. Rerun Program
Expected Result:
Expect the columns For ID and RefIT would be left as bigint.
Actual Result:
ID Column remained bigint, but RefID migrated back to int.
The text was updated successfully, but these errors were encountered: