Skip to content

Commit

Permalink
Merge pull request #588 from Particular/fix-subs
Browse files Browse the repository at this point in the history
Use NVARCHAR for Subscription table
  • Loading branch information
Michał Wójcik committed Mar 26, 2021
2 parents 0f3e0b4 + fe716dd commit d0cbaf3
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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)
)

Expand Down
Original file line number Diff line number Diff line change
@@ -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)
20 changes: 18 additions & 2 deletions src/NServiceBus.NHibernate.Tests/GenerateScriptsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,36 @@ public class DDL
{
[Test]
[MethodImpl(MethodImplOptions.NoInlining)]
public void Outbox()
public void Outbox_MsSql2012()
{
var script = ScriptGenerator<MsSql2012Dialect>.GenerateOutboxScript();
Approver.Verify(script);
}

[Test]
[MethodImpl(MethodImplOptions.NoInlining)]
public void Subscriptions()
public void Outbox_Oracle10g()
{
var script = ScriptGenerator<Oracle10gDialect>.GenerateOutboxScript();
Approver.Verify(script);
}

[Test]
[MethodImpl(MethodImplOptions.NoInlining)]
public void Subscriptions_MsSql2012()
{
var script = ScriptGenerator<MsSql2012Dialect>.GenerateSubscriptionStoreScript();
Approver.Verify(script);
}

[Test]
[MethodImpl(MethodImplOptions.NoInlining)]
public void Subscriptions_Oracle10g()
{
var script = ScriptGenerator<Oracle10gDialect>.GenerateSubscriptionStoreScript();
Approver.Verify(script);
}

[Test]
[MethodImpl(MethodImplOptions.NoInlining)]
public void Timeouts()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,14 @@ public SubscriptionMap()
Action<IColumnMapper> 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);
Expand Down

0 comments on commit d0cbaf3

Please sign in to comment.