UpdateDatabase, Unique Key index, again...

Hi
  When UpdateDatabase  is executed,
"Error(cannot be executed, do it manually): Unique key: SyncLnk.UK_33BE9DF9_SyncLnk - Created",
but the index already exists!!! I believe that attribute Unique Key should have one parameter with the index name
" [UniqueKey('SourceTable, SourceKeyFieldsNames, SourceKeyFieldsValues', idxName)]"
After a while there are a lot of garbage on the log file, that is impossible "..do it manually". O
thanks

UniqueKey is only logical, it doesn't take index name into account. If Aurelius finds an unique constraint with that combination of fields, it will not try to create it again. That existing unique key was created by Aurelius or by you? Please specify the database and the conditions of database structure, mapping, etc.


Hi,
  "That existing unique key was created by Aurelius or by you?"
  R:by me, because aurelius do not have the ability to create indexes when ran UpdateDatabase.

  "Please specify the database"
  R: Firebird

  "conditions of database structure, mapping, etc"
  R:  
  [Entity]
  [Table('SyncLnk')]
  [UniqueKey('SourceTable, SourceKeyFieldsNames, SourceKeyFieldsValues')]
  [Sequence('Id_SyncLnk')]
  [Id('FId', TIdGenerator.IdentityOrSequence)]
  TSyncLnk = class
  private
    [Column('Id', [TColumnProp.Required])]
    FId: Int64;

    [Column('SourceTable', [TColumnProp.Required], 40)]
    FSourceTable: string;
   
    [Column('SourceKeyFieldsNames', [TColumnProp.Required], 60)]
    FSourceKeyFieldsNames: string;
   
    [Column('SourceKeyFieldsValues', [TColumnProp.Required], 60)]
    FSourceKeyFieldsValues: string;
   .....


thanks

For Firebird Aurelius considers only unique constraints. It doesn't take indexes into consideration, not sure if you added the unique constraint or just created a field?

Hi, Wagner
  Add unique constraint instead of a index, works like a charm.

  Thank you master.

Hi
  But I still believe that attribute Unique Key should have one parameter with the constraint name, for easier maintenance, for instance, alter field in the Unique Key.
  thanks 

   I have a Data base in production, now i need add a unique index, because aurelius does not support add unique indexes with updatedatabase, i add manually(SYNCLNK.UNQ_SYNCLNK_1), then when i do ValidateDatabase,
   Unique key: SyncLnk.UK_33BE9DF9_SyncLnk - created
   Unique key: SYNCLNK.UNQ_SYNCLNK_1 - Removed.

  What is that mean? you said "If Aurelius finds an unique constraint with that combination of fields, it will not try to create it again", why ValidateDatabase "generate" DBManager.Errors?
  I use ValidateDatabase to add log file, the log file in this case is a complete mess

Thanks