OpenSource » Database Migrator » Legacy Migrator
Clone URL:  

Migrator Implemented an enumerator to represent 'newid' as a default value for a column.

Changeset c404b2a6640b

Parent a29032a10991

by jasoncline

Changes to 2 files · Browse files at c404b2a6640b Showing diff from parent a29032a10991 Diff from another changeset...

 
24
25
26
27
 
 
 
 
 
28
29
30
 
24
25
26
 
27
28
29
30
31
32
33
34
@@ -24,7 +24,11 @@
  Identity,   UNIQUE   } - + + public enum SpecialDefaults + { + NewId + }   /// <summary>   /// Represents a table column.   /// </summary>
 
476
477
478
 
 
 
 
 
 
 
 
 
 
 
479
480
481
 
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
@@ -476,6 +476,17 @@
  /// <returns></returns>   private string ToSqlValue(Type type, object value)   { + if (value is SpecialDefaults) + { + switch ((SpecialDefaults)value) + { + case SpecialDefaults.NewId: + default: + return "newid()"; + } + } + +   if (type == typeof(string) || (type == typeof(char)) || (type == typeof(DateTime)) || type == typeof(Guid)|| type == typeof(Guid?))   {   if (value == null)