tags:

views:

17

answers:

1

I need constraints created in the following manner:

CONSTRAINT [IX_Unique_1] UNIQUE NONCLUSTERED ( [Ordering] ASC, [Description] ASC ), CONSTRAINT [IX_Unique_2] UNIQUE NONCLUSTERED ( [Description] ASC )

I have the following nHibernate mapping:

<property name="Description" column="Description" type="String" unique-key="IX_Seed_Template_Fields_Result" />

<property name="Ordering" column="Ordering" type="Int32" unique-key="IX_Seed_Template_Fields_Result" />

So how can I add a separate unique constraint just for the Description column?

+1  A: 

Use <database-object> to create additional indexes.

5.6. Auxiliary Database Objects

Diego Mijelshon
so if I use this I need to manually write the CREATE INDEX statement?
Hosney
Indexes are always created manually. This integrates them in schema generation.
Diego Mijelshon