Does anybody know how to add an unique constraint to ext_tables.sql
without creating problems like TYPO3 wanting to re-generate it every time you use the Database analyzer?
Example:
CREATE TABLE tableName(
CONSTRAINT unique_iban UNIQUE (iban)
)
CREATE TABLE tableName(
iban varchar(255) DEFAULT '' NOT NULL UNIQUE
)
With both ways the database analyzer wants to create the constraints, even if they are already there.
First one additionally creates an error when you execute it:
Error: Duplicate key name 'unique_iban'
Second one creates one new constraint every time you hit execute:
ALTER TABLE tableName DROP KEY iban
ALTER TABLE tableName DROP KEY iban_2
etc.