Создайте последовательность в Oracle с помощью fluentmigrator
Я новичок в FluentMigrator и Oracle. Мы пытаемся поддерживать MsSql-сервер, Postgres и Oracle в наших скриптах миграции.
Поскольку NHibernate использует последовательность в Oracle и идентичность в двух других, нам нужно добавить последовательность;
public class CreateTagSystem : Migration
{
public override void Up()
{
IfDatabase("MsSql2008", "Postgres").Create.Table("TestTable").WithColumn("Id").AsInt16().PrimaryKey().Identity();
IfDatabase("Oracle").Create.Table("TestTable").WithColumn("Id").AsInt16().PrimaryKey();
IfDatabase("Oracle").Create.Sequence("hibernate_sequence");
}
public override void Down()
{
Delete.Table("TestTable");
}
}
Это приводит к;
System.NullReferenceException : Object reference not set to an instance of an object.
at FluentMigrator.Runner.Generators.Generic.GenericQuoter.IsQuoted(String name) in D:\Development\Code\GitHub\fluentmigrator\src\FluentMigrator.Runner\Generators\Generic\GenericQuoter.cs: line 105
at FluentMigrator.Runner.Generators.Generic.GenericQuoter.QuoteSchemaName(String schemaName) in D:\Development\Code\GitHub\fluentmigrator\src\FluentMigrator.Runner\Generators\Generic\GenericQuoter.cs: line 183
at FluentMigrator.Runner.Generators.Generic.GenericGenerator.Generate(CreateSequenceExpression expression) in D:\Development\Code\GitHub\fluentmigrator\src\FluentMigrator.Runner\Generators\Generic\GenericGenerator.cs: line 360
at FluentMigrator.Runner.Processors.ProcessorBase.Process(CreateSequenceExpression expression) in ProcessorBase.cs: line 138
at FluentMigrator.Expressions.CreateSequenceExpression.ExecuteWith(IMigrationProcessor processor) in D:\Development\Code\GitHub\fluentmigrator\src\FluentMigrator\Expressions\CreateSequenceExpression.cs: line 17
at FluentMigrator.Runner.MigrationRunner.<>c__DisplayClasse.<ExecuteExpressions>b__b() in MigrationRunner.cs: line 349
at FluentMigrator.Runner.MigrationRunner.AnnounceTime(String message, Action action) in MigrationRunner.cs: line 379
at FluentMigrator.Runner.MigrationRunner.ExecuteExpressions(ICollection`1 expressions) in MigrationRunner.cs: line 362
at FluentMigrator.Runner.MigrationRunner.Up(IMigration migration) in MigrationRunner.cs: line 304
at FluentMigrator.Runner.MigrationRunner.ApplyMigrationUp(Int64 version) in MigrationRunner.cs: line 189
at FluentMigrator.Runner.MigrationRunner.MigrateUp(Boolean useAutomaticTransactionManagement) in MigrationRunner.cs: line 96
Глядя на источник мне нужна схема (см. GenericGenerator.cs строка 360)? Но какова схема в этом контексте?