I think there's PrimaryKeyType.Native which will use whatever the current DB
likes best.



On Thu, Dec 17, 2009 at 12:08 AM, Alex Henderson <bitterco...@gmail.com>wrote:

> 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 <i...@deerme.org> 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
>> castle-project-us...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> castle-project-users+unsubscr...@googlegroups.com<castle-project-users%2bunsubscr...@googlegroups.com>
>> .
>> 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 castle-project-users@googlegroups.com
> .
> To unsubscribe from this group, send email to
> castle-project-users+unsubscr...@googlegroups.com<castle-project-users%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/castle-project-users?hl=en.
>



-- 
Ken Egozi.
http://www.kenegozi.com/blog
http://www.delver.com
http://www.musicglue.com
http://www.castleproject.org
http://www.idcc.co.il - הכנס הקהילתי הראשון למפתחי דוטנט - בואו בהמוניכם

--

You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to castle-project-us...@googlegroups.com.
To unsubscribe from this group, send email to 
castle-project-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en.


Reply via email to