Unique key column

Thread is closed for posting
2 posts, 0 answers
  1. Adrian
    Adrian  avatar
    15 posts
    Member since:
    Dec 2010

    Posted 11 Dec 2010 Link to this post

    I have the next problem:
    I have the domain model with 1 MetClass named Products
    First meta property is ID - pk,Int32
    Second meta property is want to be a ProductName data type String with constraint Unique
    I can not do in this domain model to be unique property.
    When I update database from model does not change the DDL to put this property column.
    Do not know where I set this column as a unique

    I use MSSQL Express R2
  2. PetarP
    PetarP avatar
    754 posts

    Posted 15 Dec 2010 Link to this post

    Hello Neagoe,

     Unfortunately this is not currently supported. What you can do is save the ddl script we produce and manually add the Unique constraint. So for example if your script looks something like that:

    CREATE TABLE Products
    ID int IDENTITY,
    ProductName  varchar(255) NOT NULL,
    UNIQUE (ProductName )
    Please find the necessary change highlighted in yellow.
    the Telerik team
    Accelerate your learning with industry's first Telerik OpenAccess ORM SDK. Download today.
Back to Top