I haven't done this in a long time, but I remember once doing this by handling the ActiveRecordStarter.ModelCreated event, and then changing the Primary Key model based on the nhibernate dialect that was configured... might be worth investigating?
Cheers, - Alex On Thu, Dec 17, 2009 at 10:29 AM, deerme.org <[email protected]> wrote: > Hi everyone ... > > I'm working on a project with Monorail. > > My Configuration Development was > - S.O : Linux Debian > - Web Server : Apache mod_mono > - Db : Postgresql > > While the Production configuration is : > - S.O : Windows 2003 > - Web Server : IIS 6.0 > - Db : SQL Server 2005 > > Everything works fine, but I have a model for postgresql definitions > and one for sql server. Since PostgreSQL uses sequences while SQL > Server uses the identity (and this must be configured on the primary > key). > > > // Definitions Model Objetivo_archivos for Postgresql > [ActiveRecord] > public class Objetivo_archivos : ActiveRecordBase > { > private Int32 id______oar; > ... > [PrimaryKey(PrimaryKeyType.Sequence, SequenceName = > "objetivo_archivos_id______oar_seq")] > public Int32 Id______oar > { > > // Definitions Model Objetivo_archivos for SQL Server > [ActiveRecord] > public class Objetivo_archivos : ActiveRecordBase > { > private Int32 id______oar; > ... > [PrimaryKey(Generator = PrimaryKeyType.Identity)] > public Int32 Id______oar > { > > > And I do not want to have "two projects independent" ... > > Is there a way to define the model to run on PostgreSQL and SQL > Server (maybe at runtime, constructor ,etc.) ? > > > Thx for the time ... > > -- > > 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]<castle-project-users%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/castle-project-users?hl=en. > > > -- 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=en.
