Problem creating table in Firebird 3

I'm having a problem using Aurelius to create databases using Firebird 3.


I have created a clean, empty database but keep getting exceptions like this:

Project AureuliusDevApp.exe raised exception class EIBNativeException with message '[FireDAC][Phys][FB]unsuccessful metadata update
CREATE TABLE BUZZ_LOCATION failed
violation of PRIMARY or UNIQUE KEY constraint "RDB$INDEX_15" on table "RDB$RELATION_FIELDS"
Problematic key value is ("RDB$FIELD_NAME" = 'TOWN', "RDB$RELATION_NAME" = 'BUZZ_LOCATION')'.

The Object is declared:

TBuzzLocation = class
private
    FTown: string;
    FName: string;
    FMapData: string;
    FId: integer;
    FAddress2: string;
    FAddress3: string;
    FAddress1: string;
    FPostCode: string;
    FAddressName: string;
    FHostId: integer;
    FCounty: string;
public
  [Column('LOCATIONID')]
  property Id: integer read FId write FId;
  [Column('HOSTID')]
  property HostId: integer read FHostId write FHostId;
  [Column('ADDRESSNAME', [], 150)]
  property AddressName: string read FAddressName write FAddressName;
  [Column('ADDRESS1', [], 50)]
  property Address1: string read FAddress1 write FAddress1;
  [Column('ADDRESS2', [], 50)]
  property Address2: string read FAddress2 write FAddress2;
  [Column('ADDRESS3', [], 50)]
  property Address3: string read FAddress3 write FAddress3;
  [Column('TOWN', [], 75)]
  property Town: string read FTown write FTown;
  [Column('COUNTY', [], 50)]
  property County: string read FCounty write FCounty;
  [Column('POSTCODE', [], 20)]
  property PostCode: string read FPostCode write FPostCode;
  [Column('MAPDATA', [], 50)]
  property MapData: string read FMapData write FMapData;
end;

Any ideas?

thanks


above the object definition:


[Entity]
[Automapping]
[Id('Id', TIdGenerator.IdentityOrSequence)]

(couldn't find an edit option for the post)

The problem is that you are both using [Automapping] attribute, and manually adding [Column] attributes to member. Actually that is not forbidden, you can mix those, but when you use Automapping, it will automatically map all private fields in your class. And then you are explicitly adding [Column] attributes to properties. 

That means both field and property will be mapped, and you will end up with duplicated column names. If you use Automapping you don't need to add Column attributes. If you do with the intention to override automapping, then add Column attribute to the class field, not the class property.

I thought it might be something like that. Many thanks for the explanation