And I'm still fighting with something similar. I've narrowed the
issue down a lot. I've got the following:
class Team: ModelBase<Team>, IProjectBidder
{
[HasMany(typeof(ProjectBid), Table = "ProjectBid", ColumnKey =
"BidderID", Lazy = true)]
public IList<ProjectBid> ProjectBids{get;set;}
}
class User: ModelBase<User>, IProjectBidder
{
[HasMany(typeof(ProjectBid), Table = "ProjectBid", ColumnKey =
"BidderID", Lazy = true)]
public IList<ProjectBid> ProjectBids{get;set;}
}
class ProjectBid : ModelBase<ProjectBid>
{
[Any(typeof(int), MetaType = typeof(string), TypeColumn =
"BidderType", IdColumn = "BidderID", Cascade = CascadeEnum.None)]
[Any.MetaValue("USER", typeof(User))]
[Any.MetaValue("TEAM", typeof(Team))]
public IProjectBidder Bidder { get; set; }
}
When ActiveRecord generates the schema for this, it's adding a "Key"
to the ProjectBid table-- that the BidderID column must contain a Team
ID. Why is it creating this constraint? It should allow EITHER a team
or a user, since I'm using the [Any] attribute, right?
I see the following line in my logs:
DEBUG2009-11-18 11:01:20 -
alter table ProjectBid
add constraint FKDD9B6D9169F5A9D0
foreign key (BidderID)
references Team
How do I stop it from creating this constraint? Are there any log
files or anything else I can look at to help track down the problem?
--
You received this message because you are subscribed to the Google Groups
"Castle Project Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/castle-project-users?hl=.