Hello,
I am having problems updating the database structure, I use mariadb, connected with firedac, updating the table fields is done correctly, updating the indexes if done the first time, correctly generates the indexes, the second generates an error indicating that one or more indexes are already present with the same name.
It seems that this comparison fails:
function AreColumnsEqual(OldCols, NewCols: TList): boolean;
var
I: integer;
begin
Result := OldCols.Count = NewCols.Count;
if Result then
for I := 0 to OldCols.Count - 1 do
if not SameText(OldCols[I].Name, NewCols[I].Name) then
Exit(false);
end;
This is the attribute indicated in the table [DBIndex('IDXSTATUSMSG', 'Customer,MsgType,Sent,SentTimestamp,QueueTimeStamp')]
This is the table in the db:
CREATE TABLE
MsgOutQueue
(
Active INTEGER(11) NOT NULL ,
CreateDateTime DATETIME NOT NULL ,
ModifyDateTime DATETIME DE FAULT NULL ,
DeleteDateTime DATETIME DEFAULT NULL ,
ID BIGINT(20) NOT NULL AUTO_INCREMENT ,
QueueTimeStamp DATETIME NOT NULL ,
Sent INTEGER(11) NOT NULL ,
MsgType INTEGER(11) NOT NULL ,
Sender VARCHAR(50) COLLATE latin1_swedish_ci NOT NULL ,
Recipient VARCHAR(50) COLLATE latin1_swedish_ci NOT NULL ,
SentTimestamp DATETIME DEFAULT NULL ,
RetryMax INTEGER(11) NOT NULL ,
RetryCount INTEGER(11) NOT NULL ,
Message LONGTEXT COLLATE latin1_swedish_ci DEFAULT NULL ,
Cus tomer BIGINT(20) NOT NULL ,
Attachment LONGTEXT COLLATE latin1_swedish_ci DEFAULT NULL ,
Title VARCHAR(50) COLLATE latin1_swedish_ci DEFAULT NULL ,
PRIMARY KEY USING BTREE (ID) ,
KEY IDXSTATUSMSG USING BTREE (Customer, MsgType, Sent, SentTimestamp, QueueTimeStamp),
CONSTRAINT FK_iDoctor_MsgOutQueue_iDoctor_Customers_Customer FOREIGN KEY (Customer) REFERENCES Customers (ID)
)
ENGINE=InnoDB AUTO_INCREMENT=3 CHARACTER SET 'latin1' COLLATE