I have an application that stores data in database (oracle) I have simple model
public class FileTemplate
{
public string Xml { get; set; }
...
}
and class map
public class FileTemplateMap : ClassMap<FileTemplate>
{
public FileTemplateMap()
{
Table("FILE_TEMPLATE");
Map(f => f.Xml, "XML").CustomSqlType("NCLOB");
...
}
}
A want to add PostgreSql support. But PostgreSql doesn't have NCLOB data type. I modify my mapping:
public class FileTemplateMap : ClassMap<FileTemplate>
{
public FileTemplateMap()
{
Table("FILE_TEMPLATE");
#if POSTGRE
Map(f => f.Xml, "XML").CustomSqlType("TEXT");
#else
Map(f => f.Xml, "XML").CustomSqlType("NCLOB");
#endif
}
}
Now I have to do different builds for oracle and postgresql with defining conditional compilation symbols (for postgresql). And application that build with POSTGRE compilation symbol doesn't work with oracle.
Are there other ways to do this without using conditional compilation symbols? I want to have one build, that works with both databases.