Browse files

Add .gitattributes and fix line endings

Adding a .gitattributes in an attempt to fix our problems with line
endings. It is so easy to introduce LF endings and hopefully this will
help stop that.
  • Loading branch information...
1 parent be2ed47 commit a719a929944eb14587225e09929ce85cb4f86f0c @daniellee daniellee committed Sep 29, 2012
Showing with 21,971 additions and 21,949 deletions.
  1. +22 −0 .gitattributes
  2. +30 −30 .gitignore
  3. +25 −25 doc/VisualStudioTemplates/StandardAndAutoReversingMigrations.DotSettings
  4. +279 −279 src/FluentMigrator.Console/MigratorConsole.cs
  5. +174 −174 src/FluentMigrator.MSBuild/Migrate.cs
  6. +140 −140 src/FluentMigrator.NAnt/MigrateTask.cs
  7. +67 −67 src/FluentMigrator.Runner/Extensions/SqlServerExtensions.cs
  8. +342 −342 src/FluentMigrator.Runner/FluentMigrator.Runner.csproj
  9. +80 −80 src/FluentMigrator.Runner/Generators/Base/GeneratorBase.cs
  10. +411 −411 src/FluentMigrator.Runner/Generators/Generic/GenericGenerator.cs
  11. +185 −185 src/FluentMigrator.Runner/Generators/SqlServer/SqlServer2000Generator.cs
  12. +326 −326 src/FluentMigrator.Runner/Generators/SqlServer/SqlServer2005Generator.cs
  13. +61 −61 src/FluentMigrator.Runner/Generators/SqlServer/SqlServerColumn.cs
  14. +9 −9 src/FluentMigrator.Runner/Initialization/IRunnerContext.cs
  15. +41 −41 src/FluentMigrator.Runner/Initialization/RunnerContext.cs
  16. +395 −395 src/FluentMigrator.Runner/MigrationRunner.cs
  17. +11 −11 src/FluentMigrator.Runner/Processors/Firebird/FirebirdProcessor.cs
  18. +4 −4 src/FluentMigrator.Runner/Properties/AssemblyInfo.cs
  19. +383 −383 src/FluentMigrator.Tests/FluentMigrator.Tests.csproj
  20. +30 −30 src/FluentMigrator.Tests/Integration/Migrations/TestEmptyMigration.cs
  21. +165 −165 src/FluentMigrator.Tests/Integration/Processors/SqlServerProcessorTests.cs
  22. +76 −76 src/FluentMigrator.Tests/Unit/Builders/Insert/InsertDataExpressionBuilderTests.cs
  23. +47 −47 src/FluentMigrator.Tests/Unit/Generators/GenericGenerator/GenericGeneratorTests.cs
  24. +116 −116 src/FluentMigrator.Tests/Unit/Generators/SQLite/SQLiteDataTests.cs
  25. +125 −125 src/FluentMigrator.Tests/Unit/Generators/SqlServer2000/SqlServer2000Data.cs
  26. +168 −168 src/FluentMigrator.Tests/Unit/Generators/SqlServer2005/SqlServer2005Data.cs
  27. +435 −435 src/FluentMigrator.Tests/Unit/MigrationRunnerTests.cs
  28. +51 −51 src/FluentMigrator/Builders/IColumnTypeSyntax.cs
  29. +24 −24 src/FluentMigrator/Builders/Insert/IInsertDataSyntax.cs
  30. +69 −69 src/FluentMigrator/Builders/Insert/InsertDataExpressionBuilder.cs
  31. +72 −72 src/FluentMigrator/Expressions/InsertDataExpression.cs
  32. +344 −344 src/FluentMigrator/FluentMigrator.csproj
  33. +31 −31 src/FluentMigrator/IMigration.cs
  34. +3 −3 src/FluentMigrator/Infrastructure/IMigrationContext.cs
  35. +43 −43 src/FluentMigrator/Infrastructure/MigrationContext.cs
  36. +4 −4 src/FluentMigrator/Properties/AssemblyInfo.cs
  37. +11 −11 src/FluentMigrator/SystemMethods.cs
  38. +16 −16 src/SolutionInfo.cs
  39. +17,156 −17,156 tools/nant/NAnt.Core.xml
View
22 .gitattributes
@@ -0,0 +1,22 @@
+# Auto detect text files and perform LF normalization
+* text=auto
+
+# Custom for Visual Studio
+*.cs diff=csharp
+*.sln merge=union
+*.csproj merge=union
+*.vbproj merge=union
+*.fsproj merge=union
+*.dbproj merge=union
+
+# Standard to msysgit
+*.doc diff=astextplain
+*.DOC diff=astextplain
+*.docx diff=astextplain
+*.DOCX diff=astextplain
+*.dot diff=astextplain
+*.DOT diff=astextplain
+*.pdf diff=astextplain
+*.PDF diff=astextplain
+*.rtf diff=astextplain
+*.RTF diff=astextplain
View
60 .gitignore
@@ -1,30 +1,30 @@
-*.sln.cache
-_ReSharper.*
-bin
-obj
-build
-dist
-*.suo
-*resharper*
-*.user
-TestResult.xml
-src/FluentMigrator.Example/tools/FluentMigrator
-db.sqlite
-*.orig
-*.pidb
-*.userprefs
-packages/FluentMigrator/
-packages/FluentMigrator.Tools/
-_UpgradeReport_Files
-UpgradeLog.XML
-*.bak
-pulls/*.patch
-src/*.vs10x
-*.vs10x
-src/FluentMigrator.Tests/FluentMigrator.VisualState.xml
-examplecommand.txt
-*.crunchproject.local.xml
-*.crunchsolution.local.xml
-*.ncrunchproject
-*.ncrunchsolution
-*.crunchsolution.cache
+*.sln.cache
+_ReSharper.*
+bin
+obj
+build
+dist
+*.suo
+*resharper*
+*.user
+TestResult.xml
+src/FluentMigrator.Example/tools/FluentMigrator
+db.sqlite
+*.orig
+*.pidb
+*.userprefs
+packages/FluentMigrator/
+packages/FluentMigrator.Tools/
+_UpgradeReport_Files
+UpgradeLog.XML
+*.bak
+pulls/*.patch
+src/*.vs10x
+*.vs10x
+src/FluentMigrator.Tests/FluentMigrator.VisualState.xml
+examplecommand.txt
+*.crunchproject.local.xml
+*.crunchsolution.local.xml
+*.ncrunchproject
+*.ncrunchsolution
+*.crunchsolution.cache
View
50 doc/VisualStudioTemplates/StandardAndAutoReversingMigrations.DotSettings
@@ -1,26 +1,26 @@
-<TemplatesExport family="File Templates">
- <Template uid="46112660-f637-4eb2-a7c0-2e7385b2b2e8" shortcut="" description="AutoReversingMigration" text="using FluentMigrator;&#xD;&#xA;&#xD;&#xA;namespace $NAMESPACE$&#xD;&#xA;{&#xD;&#xA; [Migration($MIGRATIONNUMBER$)]&#xD;&#xA; public class Migration$MIGRATIONNUMBER$ : AutoReversingMigration&#xD;&#xA; {&#xD;&#xA; public override void Up()&#xD;&#xA; {&#xD;&#xA; $END$&#xD;&#xA; }&#xD;&#xA; }&#xD;&#xA;}" reformat="True" shortenQualifiedReferences="True">
- <Categories />
- <Variables>
- <Variable name="NAMESPACE" expression="fileDefaultNamespace()" initialRange="-1" />
- <Variable name="MIGRATIONNUMBER" expression="getCurrentTime(&quot;yyyyMMddHHmmss&quot;)" initialRange="0" />
- </Variables>
- <CustomProperties>
- <Property key="FileName" value="_MigrationRENAME" />
- <Property key="Extension" value="cs" />
- <Property key="ValidateFileName" value="True" />
- </CustomProperties>
- </Template>
- <Template uid="79de0aee-f555-4c6b-b010-4db19e47c5e0" shortcut="" description="Migration" text="using FluentMigrator;&#xD;&#xA;&#xD;&#xA;namespace $NAMESPACE$&#xD;&#xA;{&#xD;&#xA; [Migration($MIGRATIONNUMBER$)]&#xD;&#xA; public class Migration$MIGRATIONNUMBER$ : Migration&#xD;&#xA; {&#xD;&#xA; public override void Up()&#xD;&#xA; {&#xD;&#xA; $END$&#xD;&#xA; }&#xD;&#xA;&#xD;&#xA; public override void Down()&#xD;&#xA; {&#xD;&#xA; &#xD;&#xA; }&#xD;&#xA; }&#xD;&#xA;}" reformat="True" shortenQualifiedReferences="True">
- <Categories />
- <Variables>
- <Variable name="NAMESPACE" expression="fileDefaultNamespace()" initialRange="-1" />
- <Variable name="MIGRATIONNUMBER" expression="getCurrentTime(&quot;yyyyMMddHHmmss&quot;)" initialRange="0" />
- </Variables>
- <CustomProperties>
- <Property key="FileName" value="_MigrationRENAME" />
- <Property key="Extension" value="cs" />
- <Property key="ValidateFileName" value="True" />
- </CustomProperties>
- </Template>
+<TemplatesExport family="File Templates">
+ <Template uid="46112660-f637-4eb2-a7c0-2e7385b2b2e8" shortcut="" description="AutoReversingMigration" text="using FluentMigrator;&#xD;&#xA;&#xD;&#xA;namespace $NAMESPACE$&#xD;&#xA;{&#xD;&#xA; [Migration($MIGRATIONNUMBER$)]&#xD;&#xA; public class Migration$MIGRATIONNUMBER$ : AutoReversingMigration&#xD;&#xA; {&#xD;&#xA; public override void Up()&#xD;&#xA; {&#xD;&#xA; $END$&#xD;&#xA; }&#xD;&#xA; }&#xD;&#xA;}" reformat="True" shortenQualifiedReferences="True">
+ <Categories />
+ <Variables>
+ <Variable name="NAMESPACE" expression="fileDefaultNamespace()" initialRange="-1" />
+ <Variable name="MIGRATIONNUMBER" expression="getCurrentTime(&quot;yyyyMMddHHmmss&quot;)" initialRange="0" />
+ </Variables>
+ <CustomProperties>
+ <Property key="FileName" value="_MigrationRENAME" />
+ <Property key="Extension" value="cs" />
+ <Property key="ValidateFileName" value="True" />
+ </CustomProperties>
+ </Template>
+ <Template uid="79de0aee-f555-4c6b-b010-4db19e47c5e0" shortcut="" description="Migration" text="using FluentMigrator;&#xD;&#xA;&#xD;&#xA;namespace $NAMESPACE$&#xD;&#xA;{&#xD;&#xA; [Migration($MIGRATIONNUMBER$)]&#xD;&#xA; public class Migration$MIGRATIONNUMBER$ : Migration&#xD;&#xA; {&#xD;&#xA; public override void Up()&#xD;&#xA; {&#xD;&#xA; $END$&#xD;&#xA; }&#xD;&#xA;&#xD;&#xA; public override void Down()&#xD;&#xA; {&#xD;&#xA; &#xD;&#xA; }&#xD;&#xA; }&#xD;&#xA;}" reformat="True" shortenQualifiedReferences="True">
+ <Categories />
+ <Variables>
+ <Variable name="NAMESPACE" expression="fileDefaultNamespace()" initialRange="-1" />
+ <Variable name="MIGRATIONNUMBER" expression="getCurrentTime(&quot;yyyyMMddHHmmss&quot;)" initialRange="0" />
+ </Variables>
+ <CustomProperties>
+ <Property key="FileName" value="_MigrationRENAME" />
+ <Property key="Extension" value="cs" />
+ <Property key="ValidateFileName" value="True" />
+ </CustomProperties>
+ </Template>
</TemplatesExport>
View
558 src/FluentMigrator.Console/MigratorConsole.cs
@@ -1,279 +1,279 @@
-#region License
-
-// Copyright (c) 2007-2009, Sean Chambers <schambers80@gmail.com>
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#endregion
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using FluentMigrator.Runner;
-using FluentMigrator.Runner.Announcers;
-using FluentMigrator.Runner.Initialization;
-using FluentMigrator.Runner.Processors;
-using Mono.Options;
-
-namespace FluentMigrator.Console
-{
- public class MigratorConsole
- {
- private readonly ConsoleAnnouncer consoleAnnouncer = new ConsoleAnnouncer();
- public string ApplicationContext;
- public string Connection;
- public string ConnectionStringConfigPath;
- public string Namespace;
- public bool Output;
- public string OutputFilename;
- public bool PreviewOnly;
- public string ProcessorType;
- public string Profile;
- public bool ShowHelp;
- public int Steps;
- public List<string> Tags = new List<string>();
- public string TargetAssembly;
- public string Task;
- public int Timeout;
- public bool Verbose;
- public long Version;
- public string WorkingDirectory;
-
- public RunnerContext RunnerContext { get; private set;}
-
- public MigratorConsole(params string[] args)
- {
- consoleAnnouncer.Header();
-
- try
- {
- var optionSet = new OptionSet
- {
- {
- "assembly=|a=|target=",
- "REQUIRED. The assembly containing the migrations you want to execute.",
- v => { TargetAssembly = v; }
- },
- {
- "provider=|dbType=|db=",
- string.Format("REQUIRED. The kind of database you are migrating against. Available choices are: {0}.",
- ProcessorFactory.ListAvailableProcessorTypes()),
- v => { ProcessorType = v; }
- },
- {
- "connectionString=|connection=|conn=|c=",
- "The name of the connection string (falls back to machine name) or the connection string itself to the server and database you want to execute your migrations against."
- ,
- v => { Connection = v; }
- },
- {
- "connectionStringConfigPath=|configPath=",
- string.Format("The path of the machine.config where the connection string named by connectionString" +
- " is found. If not specified, it defaults to the machine.config used by the currently running CLR version")
- ,
- v => { ConnectionStringConfigPath = v; }
- },
- {
- "namespace=|ns=",
- "The namespace contains the migrations you want to run. Default is all migrations found within the Target Assembly will be run."
- ,
- v => { Namespace = v; }
- },
- {
- "output|out|o",
- "Output generated SQL to a file. Default is no output. Use outputFilename to control the filename, otherwise [assemblyname].sql is the default."
- ,
- v => { Output = true; }
- },
- {
- "outputFilename=|outfile=|of=",
- "The name of the file to output the generated SQL to. The output option must be included for output to be saved to the file."
- ,
- v => { OutputFilename = v; }
- },
- {
- "preview|p",
- "Only output the SQL generated by the migration - do not execute it. Default is false.",
- v => { PreviewOnly = true; }
- },
- {
- "steps=",
- "The number of versions to rollback if the task is 'rollback'. Default is 1.",
- v => { Steps = int.Parse(v); }
- },
- {
- "task=|t=",
- "The task you want FluentMigrator to perform. Available choices are: migrate:up, migrate (same as migrate:up), migrate:down, rollback, rollback:toversion, rollback:all. Default is 'migrate'."
- ,
- v => { Task = v; }
- },
- {
- "version=",
- "The specific version to migrate. Default is 0, which will run all migrations.",
- v => { Version = long.Parse(v); }
- },
- {
- "verbose=",
- "Show the SQL statements generated and execution time in the console. Default is false.",
- v => { Verbose = true; }
- },
- {
- "workingdirectory=|wd=",
- "The directory to load SQL scripts specified by migrations from.",
- v => { WorkingDirectory = v; }
- },
- {
- "profile=",
- "The profile to run after executing migrations.",
- v => { Profile = v; }
- },
- {
- "context=",
- "Set ApplicationContext to the given string.",
- v => { ApplicationContext = v; }
- },
- {
- "timeout=",
- "Overrides the default SqlCommand timeout of 30 seconds.",
- v => { Timeout = int.Parse(v); }
- },
- {
- "tag=",
- "Filters the migrations to be run by tag.",
- v => { Tags.Add(v); }
- },
- {
- "help|h|?",
- "Displays this help menu.",
- v => { ShowHelp = true; }
- }
- };
-
- try
- {
- optionSet.Parse(args);
- }
- catch (OptionException e)
- {
- consoleAnnouncer.Error(e.Message);
- consoleAnnouncer.Say("Try 'migrate --help' for more information.");
- return;
- }
-
- if (string.IsNullOrEmpty(Task))
- Task = "migrate";
-
- if (string.IsNullOrEmpty(ProcessorType) ||
- string.IsNullOrEmpty(TargetAssembly))
- {
- DisplayHelp(optionSet);
- Environment.ExitCode = 1;
- return;
- }
-
- if (ShowHelp)
- {
- DisplayHelp(optionSet);
- return;
- }
-
- if (Output)
- {
- if (string.IsNullOrEmpty(OutputFilename))
- OutputFilename = TargetAssembly + ".sql";
-
- ExecuteMigrations(OutputFilename);
- }
- else
- ExecuteMigrations();
- }
- catch (Exception ex)
- {
- consoleAnnouncer.Error(ex.ToString());
- Environment.ExitCode = 1;
- }
-
- System.Console.ResetColor();
- }
-
- private void DisplayHelp(OptionSet p)
- {
- consoleAnnouncer.Write("Usage:");
- consoleAnnouncer.Write(" migrate [OPTIONS]");
- consoleAnnouncer.Write("Example:");
- consoleAnnouncer.Write(" migrate -a bin\\debug\\MyMigrations.dll -db SqlServer2008 -conn \"SEE_BELOW\" -profile \"Debug\"");
- consoleAnnouncer.HorizontalRule();
- consoleAnnouncer.Write("Example Connection Strings:");
- consoleAnnouncer.Write(" MySql: Data Source=172.0.0.1;Database=Foo;User Id=USERNAME;Password=BLAH");
- consoleAnnouncer.Write(" Oracle: Server=172.0.0.1;Database=Foo;Uid=USERNAME;Pwd=BLAH");
- consoleAnnouncer.Write(" SqlLite: Data Source=:memory:;Version=3;New=True");
- consoleAnnouncer.Write(" SqlServer: server=127.0.0.1;database=Foo;user id=USERNAME;password=BLAH");
- consoleAnnouncer.Write(" server=.\\SQLExpress;database=Foo;trusted_connection=true");
- consoleAnnouncer.Write(" ");
- consoleAnnouncer.Write("OR use a named connection string from the machine.config:");
- consoleAnnouncer.Write(" migrate -a bin\\debug\\MyMigrations.dll -db SqlServer2008 -connectionName \"namedConnection\" -profile \"Debug\"");
- consoleAnnouncer.HorizontalRule();
- consoleAnnouncer.Write("Options:");
- p.WriteOptionDescriptions(System.Console.Out);
- }
-
- private void ExecuteMigrations()
- {
- consoleAnnouncer.ShowElapsedTime = Verbose;
- consoleAnnouncer.ShowSql = Verbose;
-
- ExecuteMigrations(consoleAnnouncer);
- }
-
- private void ExecuteMigrations(string outputTo)
- {
- using (var sw = new StreamWriter(outputTo))
- {
- var fileAnnouncer = new TextWriterAnnouncer(sw)
- {
- ShowElapsedTime = false,
- ShowSql = true
- };
- consoleAnnouncer.ShowElapsedTime = Verbose;
- consoleAnnouncer.ShowSql = Verbose;
-
- var announcer = new CompositeAnnouncer(consoleAnnouncer, fileAnnouncer);
-
- ExecuteMigrations(announcer);
- }
- }
-
- private void ExecuteMigrations(IAnnouncer announcer)
- {
- RunnerContext = new RunnerContext(announcer)
- {
- Database = ProcessorType,
- Connection = Connection,
- Target = TargetAssembly,
- PreviewOnly = PreviewOnly,
- Namespace = Namespace,
- Task = Task,
- Version = Version,
- Steps = Steps,
- WorkingDirectory = WorkingDirectory,
- Profile = Profile,
- Timeout = Timeout,
- ConnectionStringConfigPath = ConnectionStringConfigPath,
- ApplicationContext = ApplicationContext,
- Tags = Tags
- };
-
- new TaskExecutor(RunnerContext).Execute();
- }
- }
-}
+#region License
+
+// Copyright (c) 2007-2009, Sean Chambers <schambers80@gmail.com>
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using FluentMigrator.Runner;
+using FluentMigrator.Runner.Announcers;
+using FluentMigrator.Runner.Initialization;
+using FluentMigrator.Runner.Processors;
+using Mono.Options;
+
+namespace FluentMigrator.Console
+{
+ public class MigratorConsole
+ {
+ private readonly ConsoleAnnouncer consoleAnnouncer = new ConsoleAnnouncer();
+ public string ApplicationContext;
+ public string Connection;
+ public string ConnectionStringConfigPath;
+ public string Namespace;
+ public bool Output;
+ public string OutputFilename;
+ public bool PreviewOnly;
+ public string ProcessorType;
+ public string Profile;
+ public bool ShowHelp;
+ public int Steps;
+ public List<string> Tags = new List<string>();
+ public string TargetAssembly;
+ public string Task;
+ public int Timeout;
+ public bool Verbose;
+ public long Version;
+ public string WorkingDirectory;
+
+ public RunnerContext RunnerContext { get; private set;}
+
+ public MigratorConsole(params string[] args)
+ {
+ consoleAnnouncer.Header();
+
+ try
+ {
+ var optionSet = new OptionSet
+ {
+ {
+ "assembly=|a=|target=",
+ "REQUIRED. The assembly containing the migrations you want to execute.",
+ v => { TargetAssembly = v; }
+ },
+ {
+ "provider=|dbType=|db=",
+ string.Format("REQUIRED. The kind of database you are migrating against. Available choices are: {0}.",
+ ProcessorFactory.ListAvailableProcessorTypes()),
+ v => { ProcessorType = v; }
+ },
+ {
+ "connectionString=|connection=|conn=|c=",
+ "The name of the connection string (falls back to machine name) or the connection string itself to the server and database you want to execute your migrations against."
+ ,
+ v => { Connection = v; }
+ },
+ {
+ "connectionStringConfigPath=|configPath=",
+ string.Format("The path of the machine.config where the connection string named by connectionString" +
+ " is found. If not specified, it defaults to the machine.config used by the currently running CLR version")
+ ,
+ v => { ConnectionStringConfigPath = v; }
+ },
+ {
+ "namespace=|ns=",
+ "The namespace contains the migrations you want to run. Default is all migrations found within the Target Assembly will be run."
+ ,
+ v => { Namespace = v; }
+ },
+ {
+ "output|out|o",
+ "Output generated SQL to a file. Default is no output. Use outputFilename to control the filename, otherwise [assemblyname].sql is the default."
+ ,
+ v => { Output = true; }
+ },
+ {
+ "outputFilename=|outfile=|of=",
+ "The name of the file to output the generated SQL to. The output option must be included for output to be saved to the file."
+ ,
+ v => { OutputFilename = v; }
+ },
+ {
+ "preview|p",
+ "Only output the SQL generated by the migration - do not execute it. Default is false.",
+ v => { PreviewOnly = true; }
+ },
+ {
+ "steps=",
+ "The number of versions to rollback if the task is 'rollback'. Default is 1.",
+ v => { Steps = int.Parse(v); }
+ },
+ {
+ "task=|t=",
+ "The task you want FluentMigrator to perform. Available choices are: migrate:up, migrate (same as migrate:up), migrate:down, rollback, rollback:toversion, rollback:all. Default is 'migrate'."
+ ,
+ v => { Task = v; }
+ },
+ {
+ "version=",
+ "The specific version to migrate. Default is 0, which will run all migrations.",
+ v => { Version = long.Parse(v); }
+ },
+ {
+ "verbose=",
+ "Show the SQL statements generated and execution time in the console. Default is false.",
+ v => { Verbose = true; }
+ },
+ {
+ "workingdirectory=|wd=",
+ "The directory to load SQL scripts specified by migrations from.",
+ v => { WorkingDirectory = v; }
+ },
+ {
+ "profile=",
+ "The profile to run after executing migrations.",
+ v => { Profile = v; }
+ },
+ {
+ "context=",
+ "Set ApplicationContext to the given string.",
+ v => { ApplicationContext = v; }
+ },
+ {
+ "timeout=",
+ "Overrides the default SqlCommand timeout of 30 seconds.",
+ v => { Timeout = int.Parse(v); }
+ },
+ {
+ "tag=",
+ "Filters the migrations to be run by tag.",
+ v => { Tags.Add(v); }
+ },
+ {
+ "help|h|?",
+ "Displays this help menu.",
+ v => { ShowHelp = true; }
+ }
+ };
+
+ try
+ {
+ optionSet.Parse(args);
+ }
+ catch (OptionException e)
+ {
+ consoleAnnouncer.Error(e.Message);
+ consoleAnnouncer.Say("Try 'migrate --help' for more information.");
+ return;
+ }
+
+ if (string.IsNullOrEmpty(Task))
+ Task = "migrate";
+
+ if (string.IsNullOrEmpty(ProcessorType) ||
+ string.IsNullOrEmpty(TargetAssembly))
+ {
+ DisplayHelp(optionSet);
+ Environment.ExitCode = 1;
+ return;
+ }
+
+ if (ShowHelp)
+ {
+ DisplayHelp(optionSet);
+ return;
+ }
+
+ if (Output)
+ {
+ if (string.IsNullOrEmpty(OutputFilename))
+ OutputFilename = TargetAssembly + ".sql";
+
+ ExecuteMigrations(OutputFilename);
+ }
+ else
+ ExecuteMigrations();
+ }
+ catch (Exception ex)
+ {
+ consoleAnnouncer.Error(ex.ToString());
+ Environment.ExitCode = 1;
+ }
+
+ System.Console.ResetColor();
+ }
+
+ private void DisplayHelp(OptionSet p)
+ {
+ consoleAnnouncer.Write("Usage:");
+ consoleAnnouncer.Write(" migrate [OPTIONS]");
+ consoleAnnouncer.Write("Example:");
+ consoleAnnouncer.Write(" migrate -a bin\\debug\\MyMigrations.dll -db SqlServer2008 -conn \"SEE_BELOW\" -profile \"Debug\"");
+ consoleAnnouncer.HorizontalRule();
+ consoleAnnouncer.Write("Example Connection Strings:");
+ consoleAnnouncer.Write(" MySql: Data Source=172.0.0.1;Database=Foo;User Id=USERNAME;Password=BLAH");
+ consoleAnnouncer.Write(" Oracle: Server=172.0.0.1;Database=Foo;Uid=USERNAME;Pwd=BLAH");
+ consoleAnnouncer.Write(" SqlLite: Data Source=:memory:;Version=3;New=True");
+ consoleAnnouncer.Write(" SqlServer: server=127.0.0.1;database=Foo;user id=USERNAME;password=BLAH");
+ consoleAnnouncer.Write(" server=.\\SQLExpress;database=Foo;trusted_connection=true");
+ consoleAnnouncer.Write(" ");
+ consoleAnnouncer.Write("OR use a named connection string from the machine.config:");
+ consoleAnnouncer.Write(" migrate -a bin\\debug\\MyMigrations.dll -db SqlServer2008 -connectionName \"namedConnection\" -profile \"Debug\"");
+ consoleAnnouncer.HorizontalRule();
+ consoleAnnouncer.Write("Options:");
+ p.WriteOptionDescriptions(System.Console.Out);
+ }
+
+ private void ExecuteMigrations()
+ {
+ consoleAnnouncer.ShowElapsedTime = Verbose;
+ consoleAnnouncer.ShowSql = Verbose;
+
+ ExecuteMigrations(consoleAnnouncer);
+ }
+
+ private void ExecuteMigrations(string outputTo)
+ {
+ using (var sw = new StreamWriter(outputTo))
+ {
+ var fileAnnouncer = new TextWriterAnnouncer(sw)
+ {
+ ShowElapsedTime = false,
+ ShowSql = true
+ };
+ consoleAnnouncer.ShowElapsedTime = Verbose;
+ consoleAnnouncer.ShowSql = Verbose;
+
+ var announcer = new CompositeAnnouncer(consoleAnnouncer, fileAnnouncer);
+
+ ExecuteMigrations(announcer);
+ }
+ }
+
+ private void ExecuteMigrations(IAnnouncer announcer)
+ {
+ RunnerContext = new RunnerContext(announcer)
+ {
+ Database = ProcessorType,
+ Connection = Connection,
+ Target = TargetAssembly,
+ PreviewOnly = PreviewOnly,
+ Namespace = Namespace,
+ Task = Task,
+ Version = Version,
+ Steps = Steps,
+ WorkingDirectory = WorkingDirectory,
+ Profile = Profile,
+ Timeout = Timeout,
+ ConnectionStringConfigPath = ConnectionStringConfigPath,
+ ApplicationContext = ApplicationContext,
+ Tags = Tags
+ };
+
+ new TaskExecutor(RunnerContext).Execute();
+ }
+ }
+}
View
348 src/FluentMigrator.MSBuild/Migrate.cs
@@ -1,174 +1,174 @@
-#region License
-//
-// Copyright (c) 2007-2009, Sean Chambers <schambers80@gmail.com>
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-#endregion
-
-using System;
-using System.IO;
-using System.Reflection;
-using FluentMigrator.Runner;
-using FluentMigrator.Runner.Announcers;
-using FluentMigrator.Runner.Extensions;
-using FluentMigrator.Runner.Initialization;
-using Microsoft.Build.Framework;
-using Microsoft.Build.Utilities;
-
-namespace FluentMigrator.MSBuild
-{
- public class Migrate : Task
- {
-
-
- /// <summary>
- /// Initializes a new instance of the <see cref="T:Migrate"/> class.
- /// </summary>
- public Migrate()
- {
- AppDomain.CurrentDomain.ResourceResolve += new ResolveEventHandler(CurrentDomain_ResourceResolve);
- }
-
- private static Assembly CurrentDomain_ResourceResolve(object sender, ResolveEventArgs args)
- {
- Console.WriteLine("Could Not Resolve {0}", args.Name);
- return null;
- }
-
- private string databaseType;
- private string migrationAssembly;
-
- public string ApplicationContext { get; set; }
-
- [Required]
- public string Connection { get; set; }
-
- public string ConnectionStringConfigPath { get; set; }
-
- public string Target { get { return migrationAssembly; } set { migrationAssembly = value; } }
-
- public string MigrationAssembly { get { return migrationAssembly; } set { migrationAssembly = value; } }
-
- public string Database { get { return databaseType; } set { databaseType = value; } }
-
- public string DatabaseType { get { return databaseType; } set { databaseType = value; } }
-
- public bool Verbose { get; set; }
-
- public string Namespace { get; set; }
-
- public string Task { get; set; }
-
- public long Version { get; set; }
-
- public int Steps { get; set; }
-
- public string WorkingDirectory { get; set; }
-
- public int Timeout { get; set; }
-
- public string Profile { get; set; }
-
- public bool PreviewOnly { get; set; }
-
- public string Tags { get; set; }
-
- public bool Output { get; set; }
-
- public string OutputFilename { get; set; }
-
- public override bool Execute()
- {
-
- if (string.IsNullOrEmpty(databaseType))
- {
- Log.LogError("You must specific a database type. i.e. mysql or sqlserver");
- return false;
- }
-
- if (string.IsNullOrEmpty(migrationAssembly))
- {
- Log.LogError("You must specific a migration assembly");
- return false;
- }
-
- IAnnouncer announcer = new ConsoleAnnouncer
- {
- ShowElapsedTime = Verbose,
- ShowSql = Verbose
- };
-
- StreamWriter outputWriter = null;
- if (Output)
- {
- if (string.IsNullOrEmpty(OutputFilename))
- OutputFilename = Path.GetFileName(Target) + ".sql";
-
- outputWriter = new StreamWriter(OutputFilename);
- var fileAnnouncer = new TextWriterAnnouncer(outputWriter)
- {
- ShowElapsedTime = false,
- ShowSql = true
- };
-
- announcer = new CompositeAnnouncer(announcer, fileAnnouncer);
- }
-
- Log.LogMessage(MessageImportance.Low, "Creating Context");
-
- var runnerContext = new RunnerContext(announcer)
- {
- ApplicationContext = ApplicationContext,
- Database = databaseType,
- Connection = Connection,
- ConnectionStringConfigPath = ConnectionStringConfigPath,
- Target = Target,
- PreviewOnly = PreviewOnly,
- Namespace = Namespace,
- Task = Task,
- Version = Version,
- Steps = Steps,
- WorkingDirectory = WorkingDirectory,
- Profile = Profile,
- Tags = Tags.ToTags(),
- Timeout = Timeout
- };
-
- Log.LogMessage(MessageImportance.Low, "Executing Migration Runner");
- try
- {
- new TaskExecutor(runnerContext).Execute();
- }
- catch (ProcessorFactoryNotFoundException ex)
- {
- Log.LogError("While executing migrations the following error was encountered: {0}", ex.Message);
- return false;
- }
- catch (Exception ex)
- {
- Log.LogError("While executing migrations the following error was encountered: {0}, {1}", ex.Message, ex.StackTrace);
- return false;
- }
- finally
- {
- if (outputWriter != null)
- {
- outputWriter.Dispose();
- }
- }
-
- return true;
- }
- }
-}
+#region License
+//
+// Copyright (c) 2007-2009, Sean Chambers <schambers80@gmail.com>
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+#endregion
+
+using System;
+using System.IO;
+using System.Reflection;
+using FluentMigrator.Runner;
+using FluentMigrator.Runner.Announcers;
+using FluentMigrator.Runner.Extensions;
+using FluentMigrator.Runner.Initialization;
+using Microsoft.Build.Framework;
+using Microsoft.Build.Utilities;
+
+namespace FluentMigrator.MSBuild
+{
+ public class Migrate : Task
+ {
+
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="T:Migrate"/> class.
+ /// </summary>
+ public Migrate()
+ {
+ AppDomain.CurrentDomain.ResourceResolve += new ResolveEventHandler(CurrentDomain_ResourceResolve);
+ }
+
+ private static Assembly CurrentDomain_ResourceResolve(object sender, ResolveEventArgs args)
+ {
+ Console.WriteLine("Could Not Resolve {0}", args.Name);
+ return null;
+ }
+
+ private string databaseType;
+ private string migrationAssembly;
+
+ public string ApplicationContext { get; set; }
+
+ [Required]
+ public string Connection { get; set; }
+
+ public string ConnectionStringConfigPath { get; set; }
+
+ public string Target { get { return migrationAssembly; } set { migrationAssembly = value; } }
+
+ public string MigrationAssembly { get { return migrationAssembly; } set { migrationAssembly = value; } }
+
+ public string Database { get { return databaseType; } set { databaseType = value; } }
+
+ public string DatabaseType { get { return databaseType; } set { databaseType = value; } }
+
+ public bool Verbose { get; set; }
+
+ public string Namespace { get; set; }
+
+ public string Task { get; set; }
+
+ public long Version { get; set; }
+
+ public int Steps { get; set; }
+
+ public string WorkingDirectory { get; set; }
+
+ public int Timeout { get; set; }
+
+ public string Profile { get; set; }
+
+ public bool PreviewOnly { get; set; }
+
+ public string Tags { get; set; }
+
+ public bool Output { get; set; }
+
+ public string OutputFilename { get; set; }
+
+ public override bool Execute()
+ {
+
+ if (string.IsNullOrEmpty(databaseType))
+ {
+ Log.LogError("You must specific a database type. i.e. mysql or sqlserver");
+ return false;
+ }
+
+ if (string.IsNullOrEmpty(migrationAssembly))
+ {
+ Log.LogError("You must specific a migration assembly");
+ return false;
+ }
+
+ IAnnouncer announcer = new ConsoleAnnouncer
+ {
+ ShowElapsedTime = Verbose,
+ ShowSql = Verbose
+ };
+
+ StreamWriter outputWriter = null;
+ if (Output)
+ {
+ if (string.IsNullOrEmpty(OutputFilename))
+ OutputFilename = Path.GetFileName(Target) + ".sql";
+
+ outputWriter = new StreamWriter(OutputFilename);
+ var fileAnnouncer = new TextWriterAnnouncer(outputWriter)
+ {
+ ShowElapsedTime = false,
+ ShowSql = true
+ };
+
+ announcer = new CompositeAnnouncer(announcer, fileAnnouncer);
+ }
+
+ Log.LogMessage(MessageImportance.Low, "Creating Context");
+
+ var runnerContext = new RunnerContext(announcer)
+ {
+ ApplicationContext = ApplicationContext,
+ Database = databaseType,
+ Connection = Connection,
+ ConnectionStringConfigPath = ConnectionStringConfigPath,
+ Target = Target,
+ PreviewOnly = PreviewOnly,
+ Namespace = Namespace,
+ Task = Task,
+ Version = Version,
+ Steps = Steps,
+ WorkingDirectory = WorkingDirectory,
+ Profile = Profile,
+ Tags = Tags.ToTags(),
+ Timeout = Timeout
+ };
+
+ Log.LogMessage(MessageImportance.Low, "Executing Migration Runner");
+ try
+ {
+ new TaskExecutor(runnerContext).Execute();
+ }
+ catch (ProcessorFactoryNotFoundException ex)
+ {
+ Log.LogError("While executing migrations the following error was encountered: {0}", ex.Message);
+ return false;
+ }
+ catch (Exception ex)
+ {
+ Log.LogError("While executing migrations the following error was encountered: {0}, {1}", ex.Message, ex.StackTrace);
+ return false;
+ }
+ finally
+ {
+ if (outputWriter != null)
+ {
+ outputWriter.Dispose();
+ }
+ }
+
+ return true;
+ }
+ }
+}
View
280 src/FluentMigrator.NAnt/MigrateTask.cs
@@ -1,140 +1,140 @@
-#region License
-
-// Copyright (c) 2007-2009, Sean Chambers <schambers80@gmail.com>
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#endregion
-
-using System;
-using System.IO;
-using FluentMigrator.Runner;
-using FluentMigrator.Runner.Announcers;
-using FluentMigrator.Runner.Extensions;
-using FluentMigrator.Runner.Initialization;
-using NAnt.Core;
-using NAnt.Core.Attributes;
-
-namespace FluentMigrator.NAnt
-{
- [TaskName("migrate")]
- public class MigrateTask : Task
- {
- [TaskAttribute("context")]
- public string ApplicationContext { get; set; }
-
- [TaskAttribute("database")]
- public string Database { get; set; }
-
- [TaskAttribute("connection")]
- public string Connection { get; set; }
-
- [TaskAttribute("target")]
- public string Target { get; set; }
-
- [TaskAttribute("namespace")]
- public string Namespace { get; set; }
-
- [TaskAttribute("task")]
- public string Task { get; set; }
-
- [TaskAttribute("to")]
- public long Version { get; set; }
-
- [TaskAttribute("steps")]
- public int Steps { get; set; }
-
- [TaskAttribute("workingdirectory")]
- public string WorkingDirectory { get; set; }
-
- [TaskAttribute("profile")]
- public string Profile { get; set; }
-
- [TaskAttribute("tags")]
- public string Tags { get; set; }
-
- [TaskAttribute("timeout")]
- public int Timeout { get; set; }
-
- [TaskAttribute("output")]
- public bool Output { get; set; }
-
- [TaskAttribute("outputfilename")]
- public string OutputFilename { get; set; }
-
- [TaskAttribute("preview")]
- public bool Preview { get; set; }
-
- protected override void ExecuteTask()
- {
- IAnnouncer announcer = new ConsoleAnnouncer
- {
- ShowElapsedTime = Verbose,
- ShowSql = Verbose
- };
-
- StreamWriter outputWriter = null;
- if (Output)
- {
- if (string.IsNullOrEmpty(OutputFilename))
- OutputFilename = Path.GetFileName(Target) + ".sql";
-
- outputWriter = new StreamWriter(OutputFilename);
- var fileAnnouncer = new TextWriterAnnouncer(outputWriter)
- {
- ShowElapsedTime = false,
- ShowSql = true
- };
-
- announcer = new CompositeAnnouncer(announcer, fileAnnouncer);
- }
-
- var runnerContext = new RunnerContext(announcer)
- {
- ApplicationContext = ApplicationContext,
- Database = Database,
- Connection = Connection,
- Target = Target,
- PreviewOnly = Preview,
- Namespace = Namespace,
- Task = Task,
- Version = Version,
- Steps = Steps,
- WorkingDirectory = WorkingDirectory,
- Profile = Profile,
- Tags = Tags.ToTags(),
- Timeout = Timeout
- };
-
- try
- {
- new TaskExecutor(runnerContext).Execute();
- }
- catch (ProcessorFactoryNotFoundException ex)
- {
- announcer.Error("While executing migrations the following error was encountered: {0}", ex.Message);
- throw;
- }
- catch (Exception e)
- {
- announcer.Error("While executing migrations the following error was encountered: {0}, {1}", e.Message, e.StackTrace);
- throw;
- }
- finally
- {
- if (outputWriter != null)
- outputWriter.Dispose();
- }
- }
- }
-}
+#region License
+
+// Copyright (c) 2007-2009, Sean Chambers <schambers80@gmail.com>
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#endregion
+
+using System;
+using System.IO;
+using FluentMigrator.Runner;
+using FluentMigrator.Runner.Announcers;
+using FluentMigrator.Runner.Extensions;
+using FluentMigrator.Runner.Initialization;
+using NAnt.Core;
+using NAnt.Core.Attributes;
+
+namespace FluentMigrator.NAnt
+{
+ [TaskName("migrate")]
+ public class MigrateTask : Task
+ {
+ [TaskAttribute("context")]
+ public string ApplicationContext { get; set; }
+
+ [TaskAttribute("database")]
+ public string Database { get; set; }
+
+ [TaskAttribute("connection")]
+ public string Connection { get; set; }
+
+ [TaskAttribute("target")]
+ public string Target { get; set; }
+
+ [TaskAttribute("namespace")]
+ public string Namespace { get; set; }
+
+ [TaskAttribute("task")]
+ public string Task { get; set; }
+
+ [TaskAttribute("to")]
+ public long Version { get; set; }
+
+ [TaskAttribute("steps")]
+ public int Steps { get; set; }
+
+ [TaskAttribute("workingdirectory")]
+ public string WorkingDirectory { get; set; }
+
+ [TaskAttribute("profile")]
+ public string Profile { get; set; }
+
+ [TaskAttribute("tags")]
+ public string Tags { get; set; }
+
+ [TaskAttribute("timeout")]
+ public int Timeout { get; set; }
+
+ [TaskAttribute("output")]
+ public bool Output { get; set; }
+
+ [TaskAttribute("outputfilename")]
+ public string OutputFilename { get; set; }
+
+ [TaskAttribute("preview")]
+ public bool Preview { get; set; }
+
+ protected override void ExecuteTask()
+ {
+ IAnnouncer announcer = new ConsoleAnnouncer
+ {
+ ShowElapsedTime = Verbose,
+ ShowSql = Verbose
+ };
+
+ StreamWriter outputWriter = null;
+ if (Output)
+ {
+ if (string.IsNullOrEmpty(OutputFilename))
+ OutputFilename = Path.GetFileName(Target) + ".sql";
+
+ outputWriter = new StreamWriter(OutputFilename);
+ var fileAnnouncer = new TextWriterAnnouncer(outputWriter)
+ {
+ ShowElapsedTime = false,
+ ShowSql = true
+ };
+
+ announcer = new CompositeAnnouncer(announcer, fileAnnouncer);
+ }
+
+ var runnerContext = new RunnerContext(announcer)
+ {
+ ApplicationContext = ApplicationContext,
+ Database = Database,
+ Connection = Connection,
+ Target = Target,
+ PreviewOnly = Preview,
+ Namespace = Namespace,
+ Task = Task,
+ Version = Version,
+ Steps = Steps,
+ WorkingDirectory = WorkingDirectory,
+ Profile = Profile,
+ Tags = Tags.ToTags(),
+ Timeout = Timeout
+ };
+
+ try
+ {
+ new TaskExecutor(runnerContext).Execute();
+ }
+ catch (ProcessorFactoryNotFoundException ex)
+ {
+ announcer.Error("While executing migrations the following error was encountered: {0}", ex.Message);
+ throw;
+ }
+ catch (Exception e)
+ {
+ announcer.Error("While executing migrations the following error was encountered: {0}, {1}", e.Message, e.StackTrace);
+ throw;
+ }
+ finally
+ {
+ if (outputWriter != null)
+ outputWriter.Dispose();
+ }
+ }
+ }
+}
View
134 src/FluentMigrator.Runner/Extensions/SqlServerExtensions.cs
@@ -1,67 +1,67 @@
-using System;
-using FluentMigrator.Builders;
-using FluentMigrator.Builders.Alter.Column;
-using FluentMigrator.Builders.Alter.Table;
-using FluentMigrator.Builders.Create.Column;
-using FluentMigrator.Builders.Create.Table;
-using FluentMigrator.Builders.Insert;
-using FluentMigrator.Infrastructure;
-
-namespace FluentMigrator.Runner.Extensions
-{
- public static class SqlServerExtensions
- {
- public const string IdentityInsert = "SqlServerIdentityInsert";
- public const string IdentitySeed = "SqlServerIdentitySeed";
- public const string IdentityIncrement = "SqlServerIdentityIncrement";
-
- /// <summary>
- /// Inserts data using Sql Server's IDENTITY INSERT feature.
- /// </summary>
- /// <param name="expression"></param>
- /// <returns></returns>
- public static IInsertDataSyntax WithIdentityInsert(this IInsertDataSyntax expression)
- {
- ISupportAdditionalFeatures castExpression = expression as ISupportAdditionalFeatures;
- if (castExpression == null)
- {
- throw new InvalidOperationException("WithIdentityInsert must be called on an object that implements ISupportAdditionalFeatures.");
- }
- castExpression.AddAdditionalFeature(IdentityInsert, true);
- return expression;
- }
-
- /// <summary>
- /// Makes a column an Identity column using the specified seed and increment values.
- /// </summary>
- /// <param name="expression">Column on which to apply the identity.</param>
- /// <param name="seed">Starting value of the identity.</param>
- /// <param name="increment">Increment value of the identity.</param>
- /// <returns></returns>
- public static TNext Identity<TNext, TNextFk>(this IColumnOptionSyntax<TNext, TNextFk> expression,
- int seed, int increment) where TNext : IFluentSyntax where TNextFk : IFluentSyntax
- {
- ISupportAdditionalFeatures castColumn = GetColumn(expression);
- castColumn.AddAdditionalFeature(IdentitySeed, seed);
- castColumn.AddAdditionalFeature(IdentityIncrement, increment);
- return expression.Identity();
- }
-
- private static ISupportAdditionalFeatures GetColumn<TNext, TNextFk>(IColumnOptionSyntax<TNext, TNextFk> expression) where TNext : IFluentSyntax where TNextFk : IFluentSyntax
- {
- CreateTableExpressionBuilder cast1 = expression as CreateTableExpressionBuilder;
- if (cast1 != null) return cast1.CurrentColumn;
-
- AlterTableExpressionBuilder cast2 = expression as AlterTableExpressionBuilder;
- if (cast2 != null) return cast2.CurrentColumn;
-
- AlterColumnExpressionBuilder cast3 = expression as AlterColumnExpressionBuilder;
- if (cast3 != null) return cast3.GetColumnForType();
-
- CreateColumnExpressionBuilder cast4 = expression as CreateColumnExpressionBuilder;
- if (cast4 != null) return cast4.GetColumnForType();
-
- throw new InvalidOperationException("The seeded identity method can only be called on a valid object.");
- }
- }
-}
+using System;
+using FluentMigrator.Builders;
+using FluentMigrator.Builders.Alter.Column;
+using FluentMigrator.Builders.Alter.Table;
+using FluentMigrator.Builders.Create.Column;
+using FluentMigrator.Builders.Create.Table;
+using FluentMigrator.Builders.Insert;
+using FluentMigrator.Infrastructure;
+
+namespace FluentMigrator.Runner.Extensions
+{
+ public static class SqlServerExtensions
+ {
+ public const string IdentityInsert = "SqlServerIdentityInsert";
+ public const string IdentitySeed = "SqlServerIdentitySeed";
+ public const string IdentityIncrement = "SqlServerIdentityIncrement";
+
+ /// <summary>
+ /// Inserts data using Sql Server's IDENTITY INSERT feature.
+ /// </summary>
+ /// <param name="expression"></param>
+ /// <returns></returns>
+ public static IInsertDataSyntax WithIdentityInsert(this IInsertDataSyntax expression)
+ {
+ ISupportAdditionalFeatures castExpression = expression as ISupportAdditionalFeatures;
+ if (castExpression == null)
+ {
+ throw new InvalidOperationException("WithIdentityInsert must be called on an object that implements ISupportAdditionalFeatures.");
+ }
+ castExpression.AddAdditionalFeature(IdentityInsert, true);
+ return expression;
+ }
+
+ /// <summary>
+ /// Makes a column an Identity column using the specified seed and increment values.
+ /// </summary>
+ /// <param name="expression">Column on which to apply the identity.</param>
+ /// <param name="seed">Starting value of the identity.</param>
+ /// <param name="increment">Increment value of the identity.</param>
+ /// <returns></returns>
+ public static TNext Identity<TNext, TNextFk>(this IColumnOptionSyntax<TNext, TNextFk> expression,
+ int seed, int increment) where TNext : IFluentSyntax where TNextFk : IFluentSyntax
+ {
+ ISupportAdditionalFeatures castColumn = GetColumn(expression);
+ castColumn.AddAdditionalFeature(IdentitySeed, seed);
+ castColumn.AddAdditionalFeature(IdentityIncrement, increment);
+ return expression.Identity();
+ }
+
+ private static ISupportAdditionalFeatures GetColumn<TNext, TNextFk>(IColumnOptionSyntax<TNext, TNextFk> expression) where TNext : IFluentSyntax where TNextFk : IFluentSyntax
+ {
+ CreateTableExpressionBuilder cast1 = expression as CreateTableExpressionBuilder;
+ if (cast1 != null) return cast1.CurrentColumn;
+
+ AlterTableExpressionBuilder cast2 = expression as AlterTableExpressionBuilder;
+ if (cast2 != null) return cast2.CurrentColumn;
+
+ AlterColumnExpressionBuilder cast3 = expression as AlterColumnExpressionBuilder;
+ if (cast3 != null) return cast3.GetColumnForType();
+
+ CreateColumnExpressionBuilder cast4 = expression as CreateColumnExpressionBuilder;
+ if (cast4 != null) return cast4.GetColumnForType();
+
+ throw new InvalidOperationException("The seeded identity method can only be called on a valid object.");
+ }
+ }
+}
View
684 src/FluentMigrator.Runner/FluentMigrator.Runner.csproj
@@ -1,349 +1,349 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>9.0.30729</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{CB468AD6-60C2-42E9-B3B0-01968EF94C65}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>FluentMigrator.Runner</RootNamespace>
- <AssemblyName>FluentMigrator.Runner</AssemblyName>
- <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
- <FileAlignment>512</FileAlignment>
- <FileUpgradeFlags>
- </FileUpgradeFlags>
- <OldToolsVersion>3.5</OldToolsVersion>
- <UpgradeBackupLocation />
- <PublishUrl>publish\</PublishUrl>
- <Install>true</Install>
- <InstallFrom>Disk</InstallFrom>
- <UpdateEnabled>false</UpdateEnabled>
- <UpdateMode>Foreground</UpdateMode>
- <UpdateInterval>7</UpdateInterval>
- <UpdateIntervalUnits>Days</UpdateIntervalUnits>
- <UpdatePeriodically>false</UpdatePeriodically>
- <UpdateRequired>false</UpdateRequired>
- <MapFileExtensions>true</MapFileExtensions>
- <ApplicationRevision>0</ApplicationRevision>
- <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
- <IsWebBootstrapper>false</IsWebBootstrapper>
- <UseApplicationTrust>false</UseApplicationTrust>
- <BootstrapperEnabled>true</BootstrapperEnabled>
- <TargetFrameworkProfile />
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <PlatformTarget>AnyCPU</PlatformTarget>
- <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <PlatformTarget>AnyCPU</PlatformTarget>
- <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'AutomatedRelease|AnyCPU' ">
- <OutputPath>..\..\build\AutomatedRelease\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <Optimize>true</Optimize>
- <DebugType>pdbonly</DebugType>
- <PlatformTarget>AnyCPU</PlatformTarget>
- <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
- <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
- <ErrorReport>prompt</ErrorReport>
- <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
- <DebugSymbols>true</DebugSymbols>
- <OutputPath>..\..\build\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <DebugType>full</DebugType>
- <PlatformTarget>x86</PlatformTarget>
- <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
- <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
- <ErrorReport>prompt</ErrorReport>
- <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
- <WarningLevel>4</WarningLevel>
- <Optimize>false</Optimize>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
- <OutputPath>bin\x86\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <Optimize>true</Optimize>
- <DebugType>pdbonly</DebugType>
- <PlatformTarget>x86</PlatformTarget>
- <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
- <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
- <ErrorReport>prompt</ErrorReport>
- <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'AutomatedRelease|x86' ">
- <OutputPath>bin\x86\AutomatedRelease\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <Optimize>true</Optimize>
- <DebugType>pdbonly</DebugType>
- <PlatformTarget>x86</PlatformTarget>
- <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
- <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
- <ErrorReport>prompt</ErrorReport>
- <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
- </PropertyGroup>
- <PropertyGroup>
- <SignAssembly>true</SignAssembly>
- </PropertyGroup>
- <PropertyGroup>
- <AssemblyOriginatorKeyFile>..\FluentMigrator.snk</AssemblyOriginatorKeyFile>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="System" />
- <Reference Include="System.Core">
- <RequiredTargetFramework>3.5</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.configuration" />
- <Reference Include="System.Xml.Linq">
- <RequiredTargetFramework>3.5</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.Data.DataSetExtensions">
- <RequiredTargetFramework>3.5</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.Data" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="..\SolutionInfo.cs">
- <Link>SolutionInfo.cs</Link>
- </Compile>
- <Compile Include="Announcers\Announcer.cs" />
- <Compile Include="AnnouncerExtensions.cs" />
- <Compile Include="Announcers\CompositeAnnouncer.cs" />
- <Compile Include="Announcers\NullAnnouncer.cs" />
- <Compile Include="Announcers\ConsoleAnnouncer.cs" />
- <Compile Include="Announcers\TextWriterAnnouncer.cs" />
- <Compile Include="CompatabilityMode.cs" />
- <Compile Include="Extensions\SqlServerExtensions.cs" />
- <Compile Include="Extensions\TagsExtensions.cs" />
- <Compile Include="Generators\Base\ColumnBase.cs" />
- <Compile Include="Extensions\CompatabilityModeExtension.cs" />
- <Compile Include="Generators\Firebird\FirebirdColumn.cs" />
- <Compile Include="Generators\Firebird\FirebirdGenerator.cs" />
- <Compile Include="Generators\Firebird\FirebirdTruncator.cs" />
- <Compile Include="Processors\Firebird\FirebirdProcessedExpression.cs" />
- <Compile Include="Generators\Firebird\FirebirdQuoter.cs" />
- <Compile Include="Generators\Firebird\FirebirdTypeMap.cs" />
- <Compile Include="Generators\Generic\GenericQuoter.cs" />
- <Compile Include="Generators\Generic\GenericGenerator.cs" />
- <Compile Include="Generators\IColumn.cs" />
- <Compile Include="Generators\IQuoter.cs" />
- <Compile Include="Generators\ITypeMap.cs" />
- <Compile Include="Generators\Jet\JetColumn.cs" />
- <Compile Include="Generators\Jet\JetGenerator.cs" />
- <Compile Include="Generators\Jet\JetQuoter.cs" />
- <Compile Include="Generators\Jet\JetTypeMap.cs" />
- <Compile Include="Generators\MySql\MySqlColumn.cs" />
- <Compile Include="Generators\MySql\MySqlQuoter.cs" />
- <Compile Include="Generators\MySql\MySqlTypeMap.cs" />
- <Compile Include="Generators\DatabaseOperationNotSupportedException.cs" />
- <Compile Include="Generators\Oracle\OracleColumn.cs" />
- <Compile Include="Generators\Oracle\OracleQuoter.cs" />
- <Compile Include="Generators\Oracle\OracleTypeMap.cs" />
- <Compile Include="Generators\Postgres\PostgresQuoter.cs" />
- <Compile Include="Generators\Postgres\PostgresColumn.cs" />
- <Compile Include="Generators\Postgres\PostgresGenerator.cs" />
- <Compile Include="Generators\Postgres\PostgresTypeMap.cs" />
- <Compile Include="Generators\SQLite\SqliteColumn.cs" />
- <Compile Include="Generators\SQLite\SqliteQuoter.cs" />
- <Compile Include="Generators\SQLite\SqliteTypeMap.cs" />
- <Compile Include="Generators\SqlServer\SqlServer2000TypeMap.cs" />
- <Compile Include="Generators\SqlServer\SqlServer2005TypeMap.cs" />
- <Compile Include="Generators\SqlServer\SqlServer2008TypeMap.cs" />
- <Compile Include="Generators\SqlServer\SqlServerCeGenerator.cs" />
- <Compile Include="Generators\SqlServer\SqlServerCeTypeMap.cs" />
- <Compile Include="Generators\SqlServer\SqlServerColumn.cs" />
- <Compile Include="Generators\Base\TypeMapBase.cs" />
- <Compile Include="Generators\SqlServer\SqlServerQuoter.cs" />
- <Compile Include="IAnnouncer.cs" />
- <Compile Include="Generators\MySql\MySqlGenerator.cs" />
- <Compile Include="Generators\Base\GeneratorBase.cs" />
- <Compile Include="Generators\Oracle\OracleGenerator.cs" />
- <Compile Include="Generators\SqlServer\SqlServer2000Generator.cs" />
- <Compile Include="Generators\SqlServer\SqlServer2005Generator.cs" />
- <Compile Include="Generators\SqlServer\SqlServer2008Generator.cs" />
- <Compile Include="IFormattingAnnouncer.cs" />
- <Compile Include="IMigrationRunner.cs" />
- <Compile Include="Initialization\AssemblyLoader\AssemblyLoaderFactory.cs" />
- <Compile Include="Initialization\AssemblyLoader\AssemblyLoaderFromFile.cs" />
- <Compile Include="Initialization\AssemblyLoader\AssemblyLoaderFromName.cs" />
- <Compile Include="Initialization\AssemblyLoader\IAssemblyLoader.cs" />
- <Compile Include="Initialization\INetConfigManager.cs" />
- <Compile Include="Initialization\IRunnerContext.cs" />
- <Compile Include="Initialization\ConnectionStringManager.cs" />
- <Compile Include="Initialization\NetConfigManager.cs" />
- <Compile Include="Initialization\ProcessorFactoryNotFoundException.cs" />
- <Compile Include="Initialization\RunnerContext.cs" />
- <Compile Include="Initialization\TaskExecutor.cs" />
- <Compile Include="Initialization\UndeterminableConnectionException.cs" />
- <Compile Include="IProfileLoader.cs" />
- <Compile Include="IVersionLoader.cs" />
- <Compile Include="Processors\Firebird\FirebirdDbFactory.cs" />
- <Compile Include="Processors\Firebird\FirebirdOptions.cs" />
- <Compile Include="Processors\Firebird\FirebirdProcessor.cs" />
- <Compile Include="Processors\Firebird\FirebirdProcessorFactory.cs" />
- <Compile Include="Processors\Firebird\FirebirdSchemaInfo.cs" />
- <Compile Include="Processors\Firebird\FirebirdSchemaProvider.cs" />
- <Compile Include="Processors\Firebird\FirebirdTableSchema.cs" />
- <Compile Include="Processors\Jet\JetProcessor.cs" />
- <Compile Include="Processors\Jet\JetProcessorFactory.cs" />
- <Compile Include="Processors\MigrationProcessorFactory.cs" />
- <Compile Include="Processors\MySql\MySqlDbFactory.cs" />
- <Compile Include="Processors\MySql\MySqlProcessor.cs" />
- <Compile Include="Processors\MySql\MySqlProcessorFactory.cs" />
- <Compile Include="Processors\Oracle\OracleDbFactory.cs" />
- <Compile Include="Processors\Oracle\OracleProcessor.cs" />
- <Compile Include="Processors\Oracle\OracleProcessorFactory.cs" />
- <Compile Include="Processors\Postgres\PostgresDbFactory.cs" />
- <Compile Include="Processors\Postgres\PostgresProcessor.cs" />
- <Compile Include="Processors\Postgres\PostgresProcessorFactory.cs" />
- <Compile Include="Processors\ProcessorFactory.cs" />
- <Compile Include="Processors\ProcessorOptions.cs" />
- <Compile Include="Processors\IDbFactory.cs" />
- <Compile Include="Processors\DbFactoryBase.cs" />
- <Compile Include="Processors\ReflectionBasedDbFactory.cs" />
- <Compile Include="Processors\Sqlite\SqliteDbFactory.cs" />
- <Compile Include="Processors\SqlServer\SqlServer2000Processor.cs" />
- <Compile Include="Processors\SqlServer\SqlServerCeDbFactory.cs" />
- <Compile Include="Processors\SqlServer\SqlServerDbFactory.cs" />
- <Compile Include="Processors\SqlServer\SqlServerCeProcessor.cs" />
- <Compile Include="Processors\SqlServer\SqlServer2008ProcessorFactory.cs" />
- <Compile Include="Processors\SqlServer\SqlServer2005ProcessorFactory.cs" />
- <Compile Include="Processors\SqlServer\SqlServer2000ProcessorFactory.cs" />
- <Compile Include="Processors\SqlServer\SqlServerCeProcessorFactory.cs" />
- <Compile Include="Processors\SqlServer\SqlServerProcessorFactory.cs" />
- <Compile Include="Processors\IMigrationProcessorFactory.cs" />
- <Compile Include="MigrationLoader.cs" />
- <Compile Include="IMigrationLoader.cs" />
- <Compile Include="MigrationRunner.cs" />
- <Compile Include="Generators\SQLite\SqliteGenerator.cs" />
- <Compile Include="Processors\Sqlite\SqliteProcessorFactory.cs" />
- <Compile Include="Processors\ProcessorBase.cs" />
- <Compile Include="Processors\Sqlite\SqliteProcessor.cs" />
- <Compile Include="Processors\SqlServer\SqlServerProcessor.cs" />
- <Compile Include="ProfileLoader.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="StopWatch.cs" />
- <Compile Include="Versioning\IVersionInfo.cs" />
- <Compile Include="Versioning\VersionInfo.cs" />
- <Compile Include="Versioning\VersionMigration.cs" />
- <Compile Include="VersionLoader.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\FluentMigrator\FluentMigrator.csproj">
- <Project>{FD9410F9-6FEA-47F7-A78E-B4F6FB0539B8}</Project>
- <Name>FluentMigrator</Name>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
- <None Include="..\FluentMigrator.snk">
- <Link>FluentMigrator.snk</Link>
- </None>
- <Content Include="SQLServerCENative\amd64\Microsoft.VC90.CRT\msvcr90.dll">
- <CopyToOutputDirectory>Always</CopyToOutputDirectory>
- </Content>
- <Content Include="SQLServerCENative\amd64\Microsoft.VC90.CRT\README_ENU.txt">
- <CopyToOutputDirectory>Always</CopyToOutputDirectory>
- </Content>
- <Content Include="SQLServerCENative\amd64\sqlceca40.dll">
- <CopyToOutputDirectory>Always</CopyToOutputDirectory>
- </Content>
- <Content Include="SQLServerCENative\amd64\sqlcecompact40.dll">
- <CopyToOutputDirectory>Always</CopyToOutputDirectory>
- </Content>
- <Content Include="SQLServerCENative\amd64\sqlceer40EN.dll">
- <CopyToOutputDirectory>Always</CopyToOutputDirectory>
- </Content>
- <Content Include="SQLServerCENative\amd64\sqlceme40.dll">
- <CopyToOutputDirectory>Always</CopyToOutputDirectory>
- </Content>
- <Content Include="SQLServerCENative\amd64\sqlceqp40.dll">
- <CopyToOutputDirectory>Always</CopyToOutputDirectory>
- </Content>
- <Content Include="SQLServerCENative\amd64\sqlcese40.dll">
- <CopyToOutputDirectory>Always</CopyToOutputDirectory>
- </Content>
- <Content Include="SQLServerCENative\x86\Microsoft.VC90.CRT\msvcr90.dll">
- <CopyToOutputDirectory>Always</CopyToOutputDirectory>
- </Content>
- <Content Include="SQLServerCENative\x86\Microsoft.VC90.CRT\README_ENU.txt">
- <CopyToOutputDirectory>Always</CopyToOutputDirectory>
- </Content>
- <Content Include="SQLServerCENative\x86\sqlceca40.dll">
- <CopyToOutputDirectory>Always</CopyToOutputDirectory>
- </Content>
- <Content Include="SQLServerCENative\x86\sqlcecompact40.dll">
- <CopyToOutputDirectory>Always</CopyToOutputDirectory>
- </Content>
- <Content Include="SQLServerCENative\x86\sqlceer40EN.dll">
- <CopyToOutputDirectory>Always</CopyToOutputDirectory>
- </Content>
- <Content Include="SQLServerCENative\x86\sqlceme40.dll">
- <CopyToOutputDirectory>Always</CopyToOutputDirectory>
- </Content>
- <Content Include="SQLServerCENative\x86\sqlceqp40.dll">
- <CopyToOutputDirectory>Always</CopyToOutputDirectory>
- </Content>
- <Content Include="SQLServerCENative\x86\sqlcese40.dll">
- <CopyToOutputDirectory>Always</CopyToOutputDirectory>
- </Content>
- </ItemGroup>
- <ItemGroup>
- <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
- <Install>false</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.5 SP1</ProductName>
- <Install>true</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
- <Visible>False</Visible>
- <ProductName>Windows Installer 3.1</ProductName>
- <Install>true</Install>
- </BootstrapperPackage>
- </ItemGroup>
- <ItemGroup>
- <Content Include="SQLServerCENative\amd64\Microsoft.VC90.CRT\Microsoft.VC90.CRT.manifest">
- <CopyToOutputDirectory>Always</CopyToOutputDirectory>
- </Content>
- <Content Include="SQLServerCENative\x86\Microsoft.VC90.CRT\Microsoft.VC90.CRT.manifest">
- <CopyToOutputDirectory>Always</CopyToOutputDirectory>
- </Content>
- </ItemGroup>
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <PropertyGroup>
- <PostBuildEvent>
- </PostBuildEvent>
- </PropertyGroup>
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>9.0.30729</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{CB468AD6-60C2-42E9-B3B0-01968EF94C65}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>FluentMigrator.Runner</RootNamespace>
+ <AssemblyName>FluentMigrator.Runner</AssemblyName>
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ <FileUpgradeFlags>
+ </FileUpgradeFlags>
+ <OldToolsVersion>3.5</OldToolsVersion>
+ <UpgradeBackupLocation />
+ <PublishUrl>publish\</PublishUrl>
+ <Install>true</Install>
+ <InstallFrom>Disk</InstallFrom>
+ <UpdateEnabled>false</UpdateEnabled>
+ <UpdateMode>Foreground</UpdateMode>
+ <UpdateInterval>7</UpdateInterval>
+ <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+ <UpdatePeriodically>false</UpdatePeriodically>
+ <UpdateRequired>false</UpdateRequired>
+ <MapFileExtensions>true</MapFileExtensions>
+ <ApplicationRevision>0</ApplicationRevision>
+ <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+ <IsWebBootstrapper>false</IsWebBootstrapper>
+ <UseApplicationTrust>false</UseApplicationTrust>
+ <BootstrapperEnabled>true</BootstrapperEnabled>
+ <TargetFrameworkProfile />
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <PlatformTarget>AnyCPU</PlatformTarget>
+ <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <PlatformTarget>AnyCPU</PlatformTarget>
+ <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'AutomatedRelease|AnyCPU' ">
+ <OutputPath>..\..\build\AutomatedRelease\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <Optimize>true</Optimize>
+ <DebugType>pdbonly</DebugType>
+ <PlatformTarget>AnyCPU</PlatformTarget>
+ <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
+ <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
+ <ErrorReport>prompt</ErrorReport>
+ <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+ <DebugSymbols>true</DebugSymbols>
+ <OutputPath>..\..\build\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <DebugType>full</DebugType>
+ <PlatformTarget>x86</PlatformTarget>
+ <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
+ <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
+ <ErrorReport>prompt</ErrorReport>
+ <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+ <WarningLevel>4</WarningLevel>
+ <Optimize>false</Optimize>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+ <OutputPath>bin\x86\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <Optimize>true</Optimize>
+ <DebugType>pdbonly</DebugType>
+ <PlatformTarget>x86</PlatformTarget>
+ <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
+ <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
+ <ErrorReport>prompt</ErrorReport>
+ <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'AutomatedRelease|x86' ">
+ <OutputPath>bin\x86\AutomatedRelease\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <Optimize>true</Optimize>
+ <DebugType>pdbonly</DebugType>
+ <PlatformTarget>x86</PlatformTarget>
+ <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
+ <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
+ <ErrorReport>prompt</ErrorReport>
+ <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+ </PropertyGroup>
+ <PropertyGroup>
+ <SignAssembly>true</SignAssembly>
+ </PropertyGroup>
+ <PropertyGroup>
+ <AssemblyOriginatorKeyFile>..\FluentMigrator.snk</AssemblyOriginatorKeyFile>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.Core">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.configuration" />
+ <Reference Include="System.Xml.Linq">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Data.DataSetExtensions">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="..\SolutionInfo.cs">
+ <Link>SolutionInfo.cs</Link>
+ </Compile>
+ <Compile Include="Announcers\Announcer.cs" />
+ <Compile Include="AnnouncerExtensions.cs" />
+ <Compile Include="Announcers\CompositeAnnouncer.cs" />
+ <Compile Include="Announcers\NullAnnouncer.cs" />
+ <Compile Include="Announcers\ConsoleAnnouncer.cs" />
+ <Compile Include="Announcers\TextWriterAnnouncer.cs" />
+ <Compile Include="CompatabilityMode.cs" />
+ <Compile Include="Extensions\SqlServerExtensions.cs" />
+ <Compile Include="Extensions\TagsExtensions.cs" />
+ <Compile Include="Generators\Base\ColumnBase.cs" />
+ <Compile Include="Extensions\CompatabilityModeExtension.cs" />
+ <Compile Include="Generators\Firebird\FirebirdColumn.cs" />
+ <Compile Include="Generators\Firebird\FirebirdGenerator.cs" />
+ <Compile Include="Generators\Firebird\FirebirdTruncator.cs" />
+ <Compile Include="Processors\Firebird\FirebirdProcessedExpression.cs" />
+ <Compile Include="Generators\Firebird\FirebirdQuoter.cs" />
+ <Compile Include="Generators\Firebird\FirebirdTypeMap.cs" />
+ <Compile Include="Generators\Generic\GenericQuoter.cs" />
+ <Compile Include="Generators\Generic\GenericGenerator.cs" />
+ <Compile Include="Generators\IColumn.cs" />
+ <Compile Include="Generators\IQuoter.cs" />
+ <Compile Include="Generators\ITypeMap.cs" />
+ <Compile Include="Generators\Jet\JetColumn.cs" />
+ <Compile Include="Generators\Jet\JetGenerator.cs" />
+ <Compile Include="Generators\Jet\JetQuoter.cs" />
+ <Compile Include="Generators\Jet\JetTypeMap.cs" />
+ <Compile Include="Generators\MySql\MySqlColumn.cs" />
+ <Compile Include="Generators\MySql\MySqlQuoter.cs" />
+ <Compile Include="Generators\MySql\MySqlTypeMap.cs" />
+ <Compile Include="Generators\DatabaseOperationNotSupportedException.cs" />
+ <Compile Include="Generators\Oracle\OracleColumn.cs" />
+ <Compile Include="Generators\Oracle\OracleQuoter.cs" />
+ <Compile Include="Generators\Oracle\OracleTypeMap.cs" />
+ <Compile Include="Generators\Postgres\PostgresQuoter.cs" />
+ <Compile Include="Generators\Postgres\PostgresColumn.cs" />
+ <Compile Include="Generators\Postgres\PostgresGenerator.cs" />
+ <Compile Include="Generators\Postgres\PostgresTypeMap.cs" />
+ <Compile Include="Generators\SQLite\SqliteColumn.cs" />
+ <Compile Include="Generators\SQLite\SqliteQuoter.cs" />
+ <Compile Include="Generators\SQLite\SqliteTypeMap.cs" />
+ <Compile Include="Generators\SqlServer\SqlServer2000TypeMap.cs" />
+ <Compile Include="Generators\SqlServer\SqlServer2005TypeMap.cs" />
+ <Compile Include="Generators\SqlServer\SqlServer2008TypeMap.cs" />
+ <Compile Include="Generators\SqlServer\SqlServerCeGenerator.cs" />
+ <Compile Include="Generators\SqlServer\SqlServerCeTypeMap.cs" />
+ <Compile Include="Generators\SqlServer\SqlServerColumn.cs" />
+ <Compile Include="Generators\Base\TypeMapBase.cs" />
+ <Compile Include="Generators\SqlServer\SqlServerQuoter.cs" />
+ <Compile Include="IAnnouncer.cs" />
+ <Compile Include="Generators\MySql\MySqlGenerator.cs" />
+ <Compile Include="Generators\Base\GeneratorBase.cs" />
+ <Compile Include="Generators\Oracle\OracleGenerator.cs" />
+ <Compile Include="Generators\SqlServer\SqlServer2000Generator.cs" />
+ <Compile Include="Generators\SqlServer\SqlServer2005Generator.cs" />
+ <Compile Include="Generators\SqlServer\SqlServer2008Generator.cs" />
+ <Compile Include="IFormattingAnnouncer.cs" />
+ <Compile Include="IMigrationRunner.cs" />
+ <Compile Include="Initialization\AssemblyLoader\AssemblyLoaderFactory.cs" />
+ <Compile Include="Initialization\AssemblyLoader\AssemblyLoaderFromFile.cs" />
+ <Compile Include="Initialization\AssemblyLoader\AssemblyLoaderFromName.cs" />
+ <Compile Include="Initialization\AssemblyLoader\IAssemblyLoader.cs" />
+ <Compile Include="Initialization\INetConfigManager.cs" />
+ <Compile Include="Initialization\IRunnerContext.cs" />
+ <Compile Include="Initialization\ConnectionStringManager.cs" />
+ <Compile Include="Initialization\NetConfigManager.cs" />
+ <Compile Include="Initialization\ProcessorFactoryNotFoundException.cs" />
+ <Compile Include="Initialization\RunnerContext.cs" />
+ <Compile Include="Initialization\TaskExecutor.cs" />
+ <Compile Include="Initialization\UndeterminableConnectionException.cs" />
+ <Compile Include="IProfileLoader.cs" />
+ <Compile Include="IVersionLoader.cs" />
+ <Compile Include="Processors\Firebird\FirebirdDbFactory.cs" />
+ <Compile Include="Processors\Firebird\FirebirdOptions.cs" />
+ <Compile Include="Processors\Firebird\FirebirdProcessor.cs" />
+ <Compile Include="Processors\Firebird\FirebirdProcessorFactory.cs" />
+ <Compile Include="Processors\Firebird\FirebirdSchemaInfo.cs" />
+ <Compile Include="Processors\Firebird\FirebirdSchemaProvider.cs" />
+ <Compile Include="Processors\Firebird\FirebirdTableSchema.cs" />
+ <Compile Include="Processors\Jet\JetProcessor.cs" />
+ <Compile Include="Processors\Jet\JetProcessorFactory.cs" />
+ <Compile Include="Processors\MigrationProcessorFactory.cs" />
+ <Compile Include="Processors\MySql\MySqlDbFactory.cs" />
+ <Compile Include="Processors\MySql\MySqlProcessor.cs" />
+ <Compile Include="Processors\MySql\MySqlProcessorFactory.cs" />
+ <Compile Include="Processors\Oracle\OracleDbFactory.cs" />
+ <Compile Include="Processors\Oracle\OracleProcessor.cs" />
+ <Compile Include="Processors\Oracle\OracleProcessorFactory.cs" />
+ <Compile Include="Processors\Postgres\PostgresDbFactory.cs" />
+ <Compile Include="Processors\Postgres\PostgresProcessor.cs" />
+ <Compile Include="Processors\Postgres\PostgresProcessorFactory.cs" />
+ <Compile Include="Processors\ProcessorFactory.cs" />
+ <Compile Include="Processors\ProcessorOptions.cs" />
+ <Compile Include="Processors\IDbFactory.cs" />
+ <Compile Include="Processors\DbFactoryBase.cs" />
+ <Compile Include="Processors\ReflectionBasedDbFactory.cs" />
+ <Compile Include="Processors\Sqlite\SqliteDbFactory.cs" />
+ <Compile Include="Processors\SqlServer\SqlServer2000Processor.cs" />
+ <Compile Include="Processors\SqlServer\SqlServerCeDbFactory.cs" />
+ <Compile Include="Processors\SqlServer\SqlServerDbFactory.cs" />
+ <Compile Include="Processors\SqlServer\SqlServerCeProcessor.cs" />
+ <Compile Include="Processors\SqlServer\SqlServer2008ProcessorFactory.cs" />
+ <Compile Include="Processors\SqlServer\SqlServer2005ProcessorFactory.cs" />
+ <Compile Include="Processors\SqlServer\SqlServer2000ProcessorFactory.cs" />
+ <Compile Include="Processors\SqlServer\SqlServerCeProcessorFactory.cs" />
+ <Compile Include="Processors\SqlServer\SqlServerProcessorFactory.cs" />
+ <Compile Include="Processors\IMigrationProcessorFactory.cs" />
+ <Compile Include="MigrationLoader.cs" />
+ <Compile Include="IMigrationLoader.cs" />
+ <Compile Include="MigrationRunner.cs" />
+ <Compile Include="Generators\SQLite\SqliteGenerator.cs" />
+ <Compile Include="Processors\Sqlite\SqliteProcessorFactory.cs" />
+ <Compile Include="Processors\ProcessorBase.cs" />
+ <Compile Include="Processors\Sqlite\SqliteProcessor.cs" />
+ <Compile Include="Processors\SqlServer\SqlServerProcessor.cs" />
+ <Compile Include="ProfileLoader.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="StopWatch.cs" />
+ <Compile Include="Versioning\IVersionInfo.cs" />
+ <Compile Include="Versioning\VersionInfo.cs" />
+ <Compile Include="Versioning\VersionMigration.cs" />
+ <Compile Include="VersionLoader.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\FluentMigrator\FluentMigrator.csproj">
+ <Project>{FD9410F9-6FEA-47F7-A78E-B4F6FB0539B8}</Project>
+ <Name>FluentMigrator</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="..\FluentMigrator.snk">
+ <Link>FluentMigrator.snk</Link>
+ </None>
+ <Content Include="SQLServerCENative\amd64\Microsoft.VC90.CRT\msvcr90.dll">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </Content>
+ <Content Include="SQLServerCENative\amd64\Microsoft.VC90.CRT\README_ENU.txt">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </Content>
+ <Content Include="SQLServerCENative\amd64\sqlceca40.dll">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </Content>
+ <Content Include="SQLServerCENative\amd64\sqlcecompact40.dll">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </Content>
+ <Content Include="SQLServerCENative\amd64\sqlceer40EN.dll">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </Content>
+ <Content Include="SQLServerCENative\amd64\sqlceme40.dll">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </Content>
+ <Content Include="SQLServerCENative\amd64\sqlceqp40.dll">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </Content>
+ <Content Include="SQLServerCENative\amd64\sqlcese40.dll">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </Content>
+ <Content Include="SQLServerCENative\x86\Microsoft.VC90.CRT\msvcr90.dll">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </Content>
+ <Content Include="SQLServerCENative\x86\Microsoft.VC90.CRT\README_ENU.txt">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </Content>
+ <Content Include="SQLServerCENative\x86\sqlceca40.dll">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </Content>
+ <Content Include="SQLServerCENative\x86\sqlcecompact40.dll">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </Content>
+ <Content Include="SQLServerCENative\x86\sqlceer40EN.dll">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </Content>
+ <Content Include="SQLServerCENative\x86\sqlceme40.dll">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </Content>
+ <Content Include="SQLServerCENative\x86\sqlceqp40.dll">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </Content>
+ <Content Include="SQLServerCENative\x86\sqlcese40.dll">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </Content>
+ </ItemGroup>
+ <ItemGroup>
+ <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
+ <Visible>False</Visible>
+ <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
+ <Install>false</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+ <Visible>False</Visible>
+ <ProductName>.NET Framework 3.5 SP1</ProductName>
+ <Install>true</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
+ <Visible>False</Visible>
+ <ProductName>Windows Installer 3.1</ProductName>
+ <Install>true</Install>
+ </BootstrapperPackage>
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="SQLServerCENative\amd64\Microsoft.VC90.CRT\Microsoft.VC90.CRT.manifest">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </Content>
+ <Content Include="SQLServerCENative\x86\Microsoft.VC90.CRT\Microsoft.VC90.CRT.manifest">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </Content>
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <PropertyGroup>
+ <PostBuildEvent>
+ </PostBuildEvent>
+ </PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
- -->
+ -->
</Project>
View
160 src/FluentMigrator.Runner/Generators/Base/GeneratorBase.cs
@@ -1,80 +1,80 @@
-#region License
-//
-// Copyright (c) 2007-2009, Sean Chambers <schambers80@gmail.com>
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-#endregion
-
-using FluentMigrator.Expressions;
-
-namespace FluentMigrator.Runner.Generators.Base
-{
- public abstract class GeneratorBase : IMigrationGenerator
- {
- private readonly IColumn _column;
- private readonly IQuoter _quoter;
-
- public GeneratorBase(IColumn column, IQuoter quoter)
- {
- _column = column;
- _quoter = quoter;
- }
-
- public abstract string Generate(CreateSchemaExpression expression);
- public abstract string Generate(DeleteSchemaExpression expression);
- public abstract string Generate(CreateTableExpression expression);
- public abstract string Generate(AlterColumnExpression expression);
- public abstract string Generate(CreateColumnExpression expression);
- public abstract string Generate(DeleteTableExpression expression);
- public abstract string Generate(DeleteColumnExpression expression);
- public abstract string Generate(CreateForeignKeyExpression expression);
- public abstract string Generate(DeleteForeignKeyExpression expression);
- public abstract string Generate(CreateIndexExpression expression);
- public abstract string Generate(DeleteIndexExpression expression);
- public abstract string Generate(RenameTableExpression expression);
- public abstract string Generate(RenameColumnExpression expression);
- public abstract string Generate(InsertDataExpression expression);
- public abstract string Generate(AlterDefaultConstraintExpression expression);
- public abstract string Generate(DeleteDataExpression expression);
- public abstract string Generate(UpdateDataExpression expression);
- public abstract string Generate(AlterSchemaExpression expression);
- public abstract string Generate(CreateSequenceExpression expression);
- public abstract string Generate(DeleteSequenceExpression expression);
- public abstract string Generate(CreateConstraintExpression expression);
- public abstract string Generate(DeleteConstraintExpression expression);
- public abstract string Generate(DeleteDefaultConstraintExpression expression);
-
- public virtual bool IsAdditionalFeatureSupported(string feature)
- {
- return false;
- }
-
- public string Generate(AlterTableExpression expression)
- {
- // returns nothing because the individual AddColumn and AlterColumn calls
- // create CreateColumnExpression and AlterColumnExpression respectively
- return string.Empty;
- }
-
- protected IColumn Column
- {
- get { return _column; }
- }
-
- protected IQuoter Quoter
- {
- get { return _quoter; }
- }
- }
-}
+#region License
+//
+// Copyright (c) 2007-2009, Sean Chambers <schambers80@gmail.com>
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+