diff --git a/src/NServiceBus.NHibernate.Tests/ApprovalFiles/DDL.Outbox.approved.txt b/src/NServiceBus.NHibernate.Tests/ApprovalFiles/DDL.Outbox_MsSql2012.approved.txt similarity index 100% rename from src/NServiceBus.NHibernate.Tests/ApprovalFiles/DDL.Outbox.approved.txt rename to src/NServiceBus.NHibernate.Tests/ApprovalFiles/DDL.Outbox_MsSql2012.approved.txt diff --git a/src/NServiceBus.NHibernate.Tests/ApprovalFiles/DDL.Outbox_Oracle10g.approved.txt b/src/NServiceBus.NHibernate.Tests/ApprovalFiles/DDL.Outbox_Oracle10g.approved.txt new file mode 100644 index 000000000..c097ff22d --- /dev/null +++ b/src/NServiceBus.NHibernate.Tests/ApprovalFiles/DDL.Outbox_Oracle10g.approved.txt @@ -0,0 +1,20 @@ + + + drop table OutboxRecord cascade constraints + + drop sequence hibernate_sequence + + create table OutboxRecord ( + Id NUMBER(20,0) not null, + MessageId VARCHAR2(255) not null unique, + Dispatched NUMBER(1,0) not null, + DispatchedAt TIMESTAMP(7), + TransportOperations CLOB, + primary key (Id) + ) + + create index OutboxRecord_Dispatched_Idx on OutboxRecord (Dispatched) + + create index OutboxRecord_DispatchedAt_Idx on OutboxRecord (DispatchedAt) + + create sequence hibernate_sequence \ No newline at end of file diff --git a/src/NServiceBus.NHibernate.Tests/ApprovalFiles/DDL.Subscriptions.approved.txt b/src/NServiceBus.NHibernate.Tests/ApprovalFiles/DDL.Subscriptions_MsSql2012.approved.txt similarity index 60% rename from src/NServiceBus.NHibernate.Tests/ApprovalFiles/DDL.Subscriptions.approved.txt rename to src/NServiceBus.NHibernate.Tests/ApprovalFiles/DDL.Subscriptions_MsSql2012.approved.txt index b938298f7..8ed2a1dd2 100644 --- a/src/NServiceBus.NHibernate.Tests/ApprovalFiles/DDL.Subscriptions.approved.txt +++ b/src/NServiceBus.NHibernate.Tests/ApprovalFiles/DDL.Subscriptions_MsSql2012.approved.txt @@ -1,13 +1,13 @@ - + if exists (select * from dbo.sysobjects where id = object_id(N'Subscription') and OBJECTPROPERTY(id, N'IsUserTable') = 1) drop table Subscription create table Subscription ( - SubscriberEndpoint VARCHAR(450) not null, - MessageType VARCHAR(450) not null, - LogicalEndpoint VARCHAR(450) null, - Version VARCHAR(450) null, - TypeName VARCHAR(450) null, + SubscriberEndpoint NVARCHAR(450) not null, + MessageType NVARCHAR(450) not null, + LogicalEndpoint NVARCHAR(450) null, + Version NVARCHAR(450) null, + TypeName NVARCHAR(450) null, primary key (SubscriberEndpoint, MessageType) ) diff --git a/src/NServiceBus.NHibernate.Tests/ApprovalFiles/DDL.Subscriptions_Oracle10g.approved.txt b/src/NServiceBus.NHibernate.Tests/ApprovalFiles/DDL.Subscriptions_Oracle10g.approved.txt new file mode 100644 index 000000000..0726de5f8 --- /dev/null +++ b/src/NServiceBus.NHibernate.Tests/ApprovalFiles/DDL.Subscriptions_Oracle10g.approved.txt @@ -0,0 +1,14 @@ + + + drop table Subscription cascade constraints + + create table Subscription ( + SubscriberEndpoint VARCHAR2(450) not null, + MessageType VARCHAR2(450) not null, + LogicalEndpoint VARCHAR2(450), + Version VARCHAR2(450), + TypeName VARCHAR2(450), + primary key (SubscriberEndpoint, MessageType) + ) + + create index Subscription_TypeNameIdx on Subscription (TypeName) \ No newline at end of file diff --git a/src/NServiceBus.NHibernate.Tests/GenerateScriptsTest.cs b/src/NServiceBus.NHibernate.Tests/GenerateScriptsTest.cs index 1e754fd4a..43ef52730 100644 --- a/src/NServiceBus.NHibernate.Tests/GenerateScriptsTest.cs +++ b/src/NServiceBus.NHibernate.Tests/GenerateScriptsTest.cs @@ -15,7 +15,7 @@ public class DDL { [Test] [MethodImpl(MethodImplOptions.NoInlining)] - public void Outbox() + public void Outbox_MsSql2012() { var script = ScriptGenerator.GenerateOutboxScript(); Approver.Verify(script); @@ -23,12 +23,28 @@ public void Outbox() [Test] [MethodImpl(MethodImplOptions.NoInlining)] - public void Subscriptions() + public void Outbox_Oracle10g() + { + var script = ScriptGenerator.GenerateOutboxScript(); + Approver.Verify(script); + } + + [Test] + [MethodImpl(MethodImplOptions.NoInlining)] + public void Subscriptions_MsSql2012() { var script = ScriptGenerator.GenerateSubscriptionStoreScript(); Approver.Verify(script); } + [Test] + [MethodImpl(MethodImplOptions.NoInlining)] + public void Subscriptions_Oracle10g() + { + var script = ScriptGenerator.GenerateSubscriptionStoreScript(); + Approver.Verify(script); + } + [Test] [MethodImpl(MethodImplOptions.NoInlining)] public void Timeouts() diff --git a/src/NServiceBus.NHibernate/Subscriptions/Config/SubscriptionMap.cs b/src/NServiceBus.NHibernate/Subscriptions/Config/SubscriptionMap.cs index 93d287ded..78239dba0 100644 --- a/src/NServiceBus.NHibernate/Subscriptions/Config/SubscriptionMap.cs +++ b/src/NServiceBus.NHibernate/Subscriptions/Config/SubscriptionMap.cs @@ -12,17 +12,14 @@ public SubscriptionMap() Action columnMapper = col => { col.Length(450); - col.SqlType("VARCHAR(450)"); }; - ComposedId(x => - { - - x.Property(p => p.SubscriberEndpoint, map => map.Column(columnMapper)); - x.Property(p => p.MessageType, map => map.Column(columnMapper)); + { + x.Property(p => p.SubscriberEndpoint, map => map.Column(columnMapper)); + x.Property(p => p.MessageType, map => map.Column(columnMapper)); + }); - }); Property(p => p.LogicalEndpoint, map => { map.Column(columnMapper);