Jo Shields a575963da9 Imported Upstream version 3.6.0
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
2014-08-13 10:39:27 +01:00

37 lines
1.1 KiB
C#

// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
namespace System.Data.Entity.Migrations
{
using Xunit;
[Variant(DatabaseProvider.SqlClient, ProgrammingLanguage.CSharp)]
[Variant(DatabaseProvider.SqlServerCe, ProgrammingLanguage.CSharp)]
[Variant(DatabaseProvider.SqlClient, ProgrammingLanguage.VB)]
public class CustomSqlScenarios : DbTestCase
{
private class CustomSqlMigration : DbMigration
{
public override void Up()
{
Sql("CREATE TABLE [Foo](Id [int])");
}
}
[MigrationsTheory]
public void Can_update_when_migration_contains_custom_sql()
{
ResetDatabase();
var migrator = CreateMigrator<ShopContext_v1>();
migrator.Update();
migrator = CreateMigrator<ShopContext_v1>(new CustomSqlMigration());
migrator.Update();
Assert.True(TableExists("Foo"));
}
}
}