OpenSource » Database Migrator » Migrator2
Clone URL:  
Pushed to one repository · View In Graph Contained in tip

Migrator Fixes the migrator's ability to handle null as a default value for datetime types

Changeset 8c6cf6675089

Parent 14345fa44ab1

by Profile picture of Daniel PupekDaniel Pupek

Changes to 29 files · Browse files at 8c6cf6675089 Showing diff from parent 14345fa44ab1 Diff from another changeset...

 
44
45
46
 
 
 
 
47
48
49
 
44
45
46
47
48
49
50
51
52
53
@@ -44,6 +44,10 @@
  <WarningLevel>4</WarningLevel>   </PropertyGroup>   <ItemGroup> + <Reference Include="log4net, Version=1.2.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\packages\log4net.2.0.2\lib\net40-full\log4net.dll</HintPath> + </Reference>   <Reference Include="RazorEngine">   <HintPath>..\..\packages\RazorEngine.3.3.0\lib\net40\RazorEngine.dll</HintPath>   </Reference>
 
1
2
 
3
4
5
 
 
1
2
3
4
5
6
 
@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>  <packages> + <package id="log4net" version="2.0.2" targetFramework="net40" />   <package id="Microsoft.AspNet.Razor" version="2.0.30506.0" targetFramework="net40" />   <package id="RazorEngine" version="3.3.0" targetFramework="net40" />  </packages> \ No newline at end of file
 
17
18
19
20
 
 
 
 
 
 
 
 
 
 
 
 
 
21
22
23
24
25
26
 
27
28
29
 
17
18
19
 
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
 
38
39
40
41
@@ -17,13 +17,25 @@
  {typeof(decimal),value=>{return (value ?? "").ToString();}},     {typeof(bool),value=>{return (Boolean)value? "1" : "0";}}, - {typeof(DateTime),value=>{return string.Format("'{0}'", ((DateTime)value).ToString("yyy-MM-dd HH:mm:ss")); } }, + {typeof(DateTime), value => + { + if(value == null) + return "null"; + if(value is String && value.ToString().ToLower() == "now") + return "GetDate()"; + + if(value is String && value.ToString().ToLower() == "utcnow") + return "GetUtcDate()"; + + return String.Format("'{0}'", ((DateTime)value).ToString("yyy-MM-dd HH:mm:ss")); + + } },   {typeof(char),value=>{return value == null ? "null" : String.Format("'{0}'", value.ToString());}},   {typeof(Guid),value=>{return value == null ? "null" : String.Format("'{0}'", value.ToString());}},   {typeof(Guid?), value=>{return value == null ? "null" : String.Format("'{0}'", value.ToString());}},   {typeof(byte[]),value=>{return "image";}},   - {typeof(TimeSpan),value=>{return ((TimeSpan)value).TotalMilliseconds.ToString();;}}, + {typeof(TimeSpan),value=>{return ((TimeSpan)value).TotalMilliseconds.ToString();}},     };  
 
522
523
524
 
 
525
526
527
 
522
523
524
525
526
527
528
529
@@ -522,6 +522,8 @@
  this._logger.Exception("Failed to begin migrating.", e);   else   this._logger.Exception(migratingVersion, GetMigrationDescription(GetMigration(migratingVersion).GetType()), e); + + throw new MigrationException("", migratingVersion, e);   }     InitializeMigration(EndMigration).Up();
 
47
48
49
50
 
51
52
 
53
54
55
 
113
114
115
 
116
117
118
 
 
47
48
49
 
50
51
 
52
53
54
55
 
113
114
115
116
117
118
119
 
@@ -47,9 +47,9 @@
  <DocumentationFile>bin\Migrator\Release\Migrator.XML</DocumentationFile>   </PropertyGroup>   <ItemGroup> - <Reference Include="log4net, Version=1.2.11.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL"> + <Reference Include="log4net, Version=1.2.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">   <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\lib\log4net.dll</HintPath> + <HintPath>..\..\packages\log4net.2.0.2\lib\net40-full\log4net.dll</HintPath>   </Reference>   <Reference Include="Mono.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">   <HintPath>..\..\lib\Npgsql\net-4.0\Mono.Security.dll</HintPath> @@ -113,6 +113,7 @@
  </ItemGroup>   <ItemGroup>   <None Include="app.config" /> + <None Include="packages.config" />   </ItemGroup>   <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />  </Project> \ No newline at end of file
 
523
524
525
526
 
 
 
 
 
 
 
 
527
528
529
 
523
524
525
 
526
527
528
529
530
531
532
533
534
535
536
@@ -523,7 +523,14 @@
  catch (Exception ex)   {   System.Diagnostics.Debug.Write(ex.ToString()); - this.Rollback(); + try + { + this.Rollback(); + } + catch (Exception e) + { + _logger.Exception("Unable to rollback after a failed commit.", e); + }   throw;   }   }
Change 1 of 1 Show Entire File app/​core/​packages.config Stacked
 
 
 
 
 
 
 
1
2
3
4
 
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?> +<packages> + <package id="log4net" version="2.0.2" targetFramework="net40" /> +</packages> \ No newline at end of file
 
59
60
61
62
63
64
65
 
 
66
67
68
 
93
94
95
 
 
 
96
97
 
 
59
60
61
 
 
 
 
62
63
64
65
66
 
91
92
93
94
95
96
97
98
 
@@ -59,10 +59,8 @@
  <WarningLevel>4</WarningLevel>   </PropertyGroup>   <ItemGroup> - <Reference Include="log4net, Version=1.2.9.0, Culture=neutral, PublicKeyToken=b32731d11ce58905"> - <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\lib\log4net.dll</HintPath> - <Private>True</Private> + <Reference Include="log4net"> + <HintPath>..\..\packages\log4net.2.0.2\lib\net35-full\log4net.dll</HintPath>   </Reference>   <Reference Include="NAnt.Core, Version=0.85.2344.0, Culture=neutral">   <SpecificVersion>False</SpecificVersion> @@ -93,5 +91,8 @@
  <Install>true</Install>   </BootstrapperPackage>   </ItemGroup> + <ItemGroup> + <None Include="packages.config" /> + </ItemGroup>   <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />  </Project> \ No newline at end of file
Change 1 of 1 Show Entire File app/​nant/​packages.config Stacked
 
 
 
 
 
 
 
1
2
3
4
 
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?> +<packages> + <package id="log4net" version="2.0.2" targetFramework="net35" /> +</packages> \ No newline at end of file
 
 
This file's diff was not loaded because this changeset is very large. Load changes
 
 
This file's diff was not loaded because this changeset is very large. Load changes
 
 
This file's diff was not loaded because this changeset is very large. Load changes
 
 
This file's diff was not loaded because this changeset is very large. Load changes
 
 
This file's diff was not loaded because this changeset is very large. Load changes
 
 
This file's diff was not loaded because this changeset is very large. Load changes
 
 
This file's diff was not loaded because this changeset is very large. Load changes
 
 
Change 1 of 1 Show Entire File packages/​log4net.2.0.2/​log4net.2.0.2.nuspec Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 
@@ -0,0 +1,23 @@
+<?xml version="1.0"?> +<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"> + <metadata> + <id>log4net</id> + <version>2.0.2</version> + <title>log4net [1.2.12]</title> + <authors>Apache Software Foundation</authors> + <owners>Apache Software Foundation</owners> + <licenseUrl>http://logging.apache.org/log4net/license.html</licenseUrl> + <projectUrl>http://logging.apache.org/log4net/</projectUrl> + <requireLicenseAcceptance>false</requireLicenseAcceptance> + <description>log4net is a tool to help the programmer output log statements to a variety of output targets. In case of problems with an application, it is helpful to enable logging so that the problem can be located. With log4net it is possible to enable logging at runtime without modifying the application binary. The log4net package is designed so that log statements can remain in shipped code without incurring a high performance cost. It follows that the speed of logging (or rather not logging) is crucial. + +At the same time, log output can be so voluminous that it quickly becomes overwhelming. One of the distinctive features of log4net is the notion of hierarchical loggers. Using these loggers it is possible to selectively control which log statements are output at arbitrary granularity. + +log4net is designed with two distinct goals in mind: speed and flexibility</description> + <summary>The Apache log4net library is a tool to help the programmer output log statements to a variety of output targets.</summary> + <releaseNotes /> + <copyright /> + <language /> + <tags>logging log tracing logfiles</tags> + </metadata> +</package> \ No newline at end of file
 
1
2
3
 
 
 
4
 
 
1
2
3
4
5
6
7
 
@@ -1,4 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>  <repositories>   <repository path="..\app\console\packages.config" /> + <repository path="..\app\core\packages.config" /> + <repository path="..\app\nant\packages.config" /> + <repository path="..\test\packages.config" />  </repositories> \ No newline at end of file
Change 1 of 1 Show Entire File run.bat Stacked
 
 
 
 
 
 
1
2
3
 
@@ -0,0 +1,3 @@
+CD C:\sandboxes\Migrator2\app\console\bin\Migrator.Console\Debug +migrator-cli.exe SqlServer "Server=localhost;Database=Nexport;Trusted_Connection=True" "C:\sandboxes\NexPort\NexPortVirtualCampus\bin\Nexport.Models.dll" -list +pause \ No newline at end of file
 
44
45
46
47
48
 
 
 
49
50
51
 
82
83
84
 
85
86
87
 
 
44
45
46
 
 
47
48
49
50
51
52
 
83
84
85
86
87
88
89
 
@@ -44,8 +44,9 @@
  <WarningLevel>4</WarningLevel>   </PropertyGroup>   <ItemGroup> - <Reference Include="log4net"> - <HintPath>..\lib\log4net.dll</HintPath> + <Reference Include="log4net, Version=1.2.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\packages\log4net.2.0.2\lib\net40-full\log4net.dll</HintPath>   </Reference>   <Reference Include="MySql.Data">   <HintPath>..\lib\MySql.Data.dll</HintPath> @@ -82,6 +83,7 @@
  <None Include="App.config">   <SubType>Designer</SubType>   </None> + <None Include="packages.config" />   </ItemGroup>   <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />  </Project> \ No newline at end of file
Change 1 of 1 Show Entire File test/​packages.config Stacked
 
 
 
 
 
 
 
1
2
3
4
 
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?> +<packages> + <package id="log4net" version="2.0.2" targetFramework="net40" /> +</packages> \ No newline at end of file