Skip to content

Commit

Permalink
oracle10g index creation tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tmasternak authored and DavidBoike committed Jul 12, 2019
1 parent 16f330d commit 65ad378
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@


drop table MySaga_CollectionEntry cascade constraints

drop table MySaga cascade constraints

drop table EntriesWithoutId cascade constraints

create table MySaga_CollectionEntry (
Id RAW(16) not null,
Value NUMBER(19,5),
SagaData_id RAW(16),
primary key (Id)
)

create table MySaga (
Id RAW(16) not null,
Originator VARCHAR2(255),
OriginalMessageId VARCHAR2(255),
UniqueId VARCHAR2(255) unique,
primary key (Id)
)

create table EntriesWithoutId (
SagaData_id RAW(16) not null,
Value1 NUMBER(19,5),
Value2 NUMBER(19,5)
)

create index IDX236CFC11C9055018 on MySaga_CollectionEntry (SagaData_id)

alter table MySaga_CollectionEntry
add constraint FK236CFC11C9055018
foreign key (SagaData_id)
references MySaga

create index IDX7519A193C9055018 on EntriesWithoutId (SagaData_id)

alter table EntriesWithoutId
add constraint FK7519A193C9055018
foreign key (SagaData_id)
references MySaga
10 changes: 9 additions & 1 deletion src/NServiceBus.NHibernate.Tests/GenerateScriptsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,19 @@ public void GatewayDeduplication()
// This test is ignored for .NETCore because of the unstable foreign key name generation in NHibernate https://github.com/nhibernate/nhibernate-core/issues/1769
[Test]
[MethodImpl(MethodImplOptions.NoInlining)]
public void MySaga()
public void Sagas_MsSql2012()
{
var script = ScriptGenerator<MsSql2012Dialect>.GenerateSagaScript<MySaga>();
Approver.Verify(script);
}

[Test]
[MethodImpl(MethodImplOptions.NoInlining)]
public void Sagas_Oracle10g()
{
var script = ScriptGenerator<Oracle10gDialect>.GenerateSagaScript<MySaga>();
Approver.Verify(script);
}
#endif
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public static void AddMappings(Configuration configuration, SagaMetadataCollecti
foreach (var collection in mappings.IterateCollections)
{
var table = collection.CollectionTable;

foreach (var foreignKey in table.ForeignKeyIterator)
{
var idx = new Index();
Expand Down

0 comments on commit 65ad378

Please sign in to comment.