Skip to content

Commit

Permalink
Initial check-in.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nate Kohari committed Dec 17, 2008
0 parents commit 9acd609
Show file tree
Hide file tree
Showing 58 changed files with 6,539 additions and 0 deletions.
32 changes: 32 additions & 0 deletions FluentMigrator.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FluentMigrator.Runner", "src\FluentMigrator.Runner\FluentMigrator.Runner.csproj", "{CB468AD6-60C2-42E9-B3B0-01968EF94C65}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FluentMigrator.Tests", "src\FluentMigrator.Tests\FluentMigrator.Tests.csproj", "{5DFD1A3B-7258-4C05-88F9-02A1EA3F5D9C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FluentMigrator", "src\FluentMigrator\FluentMigrator.csproj", "{FD9410F9-6FEA-47F7-A78E-B4F6FB0539B8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{CB468AD6-60C2-42E9-B3B0-01968EF94C65}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CB468AD6-60C2-42E9-B3B0-01968EF94C65}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CB468AD6-60C2-42E9-B3B0-01968EF94C65}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CB468AD6-60C2-42E9-B3B0-01968EF94C65}.Release|Any CPU.Build.0 = Release|Any CPU
{5DFD1A3B-7258-4C05-88F9-02A1EA3F5D9C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5DFD1A3B-7258-4C05-88F9-02A1EA3F5D9C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5DFD1A3B-7258-4C05-88F9-02A1EA3F5D9C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5DFD1A3B-7258-4C05-88F9-02A1EA3F5D9C}.Release|Any CPU.Build.0 = Release|Any CPU
{FD9410F9-6FEA-47F7-A78E-B4F6FB0539B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FD9410F9-6FEA-47F7-A78E-B4F6FB0539B8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FD9410F9-6FEA-47F7-A78E-B4F6FB0539B8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FD9410F9-6FEA-47F7-A78E-B4F6FB0539B8}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
Binary file added lib/Moq.dll
Binary file not shown.
2,930 changes: 2,930 additions & 0 deletions lib/Moq.xml

Large diffs are not rendered by default.

Binary file added lib/xunit.dll
Binary file not shown.
2,132 changes: 2,132 additions & 0 deletions lib/xunit.xml

Large diffs are not rendered by default.

65 changes: 65 additions & 0 deletions src/FluentMigrator.Runner/FluentMigrator.Runner.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" 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>
</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>
</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>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<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="MigrationRunner.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\FluentMigrator\FluentMigrator.csproj">
<Project>{FD9410F9-6FEA-47F7-A78E-B4F6FB0539B8}</Project>
<Name>FluentMigrator</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- 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>
36 changes: 36 additions & 0 deletions src/FluentMigrator.Runner/MigrationRunner.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System;
using FluentMigrator.Expressions;
using FluentMigrator.Infrastructure;

namespace FluentMigrator.Runner
{
public class MigrationRunner
{
public MigrationConventions Conventions { get; private set; }
public IMigrationProcessor Processor { get; private set; }

public MigrationRunner(MigrationConventions conventions, IMigrationProcessor processor)
{
Conventions = conventions;
Processor = processor;
}

public void Up(IMigration migration)
{
var context = new MigrationContext(Conventions);
migration.GetUpExpressions(context);

foreach (IMigrationExpression expression in context.Expressions)
expression.ExecuteWith(Processor);
}

public void Down(IMigration migration)
{
var context = new MigrationContext(Conventions);
migration.GetDownExpressions(context);

foreach (IMigrationExpression expression in context.Expressions)
expression.ExecuteWith(Processor);
}
}
}
35 changes: 35 additions & 0 deletions src/FluentMigrator.Runner/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using System;
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("FluentMigrator.Runner")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("FluentMigrator.Runner")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2008")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("507d4f46-c529-4ad9-bcbc-cc51bb0de234")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
77 changes: 77 additions & 0 deletions src/FluentMigrator.Tests/FluentMigrator.Tests.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" 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>{5DFD1A3B-7258-4C05-88F9-02A1EA3F5D9C}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>FluentMigrator.Tests</RootNamespace>
<AssemblyName>FluentMigrator.Tests</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</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>
</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>
</PropertyGroup>
<ItemGroup>
<Reference Include="Moq, Version=2.6.1014.1, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\Moq.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<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" />
<Reference Include="xunit, Version=1.1.0.1323, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\xunit.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="TestMigration.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\FluentMigrator.Runner\FluentMigrator.Runner.csproj">
<Project>{CB468AD6-60C2-42E9-B3B0-01968EF94C65}</Project>
<Name>FluentMigrator.Runner</Name>
</ProjectReference>
<ProjectReference Include="..\FluentMigrator\FluentMigrator.csproj">
<Project>{FD9410F9-6FEA-47F7-A78E-B4F6FB0539B8}</Project>
<Name>FluentMigrator</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- 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>
35 changes: 35 additions & 0 deletions src/FluentMigrator.Tests/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using System;
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("FluentMigrator.Tests")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("FluentMigrator.Tests")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2008")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("62c03e52-5509-4648-b1ca-2197b11e9f78")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
26 changes: 26 additions & 0 deletions src/FluentMigrator.Tests/TestMigration.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using System;

namespace FluentMigrator.Tests
{
public class TestMigration : Migration
{
public override void Up()
{
Create.Table("Users")
.WithColumn("UserId").AsInt32().Identity().PrimaryKey()
.WithColumn("UserName").AsString().WithSize(32).NotNullable();

Create.Column("Foo").OnTable("Users").AsInt16().WithSize(123).Indexed();

Create.ForeignKey().FromTable("Users").ForeignColumn("GroupId").ToTable("Groups").PrimaryColumn("GroupId");
}

public override void Down()
{
Delete.ForeignKey().FromTable("Users").ForeignColumn("GroupId").ToTable("Groups").PrimaryColumn("GroupId");

Delete.Column("Foo").FromTable("Users");
Delete.Table("Users");
}
}
}
Loading

0 comments on commit 9acd609

Please sign in to comment.