phpMyAdmin says this constraint is incorrectly formed. I’ve used this structure to create them for years and I don’t notice the docs saying to do it any other way. There was no issue when migrating to this server when all such constraints were created this way.
Can anyone assist with this please?
Parent table create stmt
create table if not exists legal_practices_lookup
( practice_name varchar(64) not null primary key
, practice reg_no varchar(64) null
) engine = innodb default CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
child table create stmt
create table if not exists legal_practice_offices_lookup
( id int not null auto_increment primary key
, practice_name varchar(64) not null
, office_unique_key varchar(64) not null unique key /* string of postcode and ph1 numbers */
, property_name varchar(255) null
, address1 varchar(99) not null
, address2 varchar(99) not null
, townCity varchar(64) not null
, county varchar(64) not null
, postCode varchar(12) not null
, ph_1 varchar(16) not null
, ph_2 varchar(16) null
, practice_email varchar(99) not null
, constraint legalPracticeOfficesLookup_legalPracticesLookup_fk
foreign key(practice_name)
references legal_practices_lookup(practice_name) on delete cascade
) engine = innodb default CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;