Mike
Mike

Reputation: 33

NHibernate (and Fluent): Possible to prevent a specific table from being created via SchemaExport.Create?

I'm using Fluent NHibernate (and I'm a newbie). I have mapped a read-only table that already exists in the database (it's actually a view in the db). In addition, I have mapped new classes for which I want to create tables using SchemaExport.Create().

In my fluent mapping, I have specified "ReadOnly()" to mark the view as immutable. However, when I execute SchemaExport.Create(), it still tries to create the table so I get the error "There is already an object named 'vw_Existing'".

Is there a way to prevent NHibernate from trying to create that specific table?

I supposed I could export and modify the sql (SetOutputFile), but it would be nice to use SchemaExport.Create().

Thanks.

Upvotes: 3

Views: 747

Answers (1)

rebelliard
rebelliard

Reputation: 9611

You're looking for

SchemaAction.None();

Upvotes: 5

Related Questions