I am trying to define interleave tables and it works when we have same column name of parent tables primary and interleaved tables foreign key. I am already migrating my database from mysql to spanner. All tables have 'id' as primary key column name.
Please consider below example:
CREATE TABLE Singers (
Id INT64 NOT NULL,
FirstName STRING(1024),
LastName STRING(1024),
SingerInfo BYTES(MAX),
) PRIMARY KEY (Id);
CREATE TABLE Albums (
SingerId INT64 NOT NULL,
Id INT64 NOT NULL,
AlbumTitle STRING(MAX),
) PRIMARY KEY (SingerId, Id),
INTERLEAVE IN PARENT Singers ON DELETE CASCADE;
This is not working for me, because parent (Singer) table has 'id' as a primary key column and child table has 'SingerId' as a foreign key.