Reputation: 153
I am using Liquibase
to manage my database migrations. There seems to be a difference in MemSQL command as compared to MySQL which is causing a problem.
I am running the following command through Liquibase:-
ALTER TABLE test.T_USER_AUTHORITY
ADD CONSTRAINT fk_authority_name
FOREIGN KEY (name) REFERENCES test.T_AUTHORITY (name)
It is giving an error
"Feature 'FOREIGN (non-SHARD) key to a sharded table' is not supported by MemSQL."
I have no control over Liquibase and I cannot add the word SHARD in between "FOREIGN key" to make it "FOREIGN SHARD key".
Is it possible in MemSQL to configure all foreign keys as SHARD keys so that we don't have to add the SHARD keyword to this command.
Upvotes: 3
Views: 875
Reputation: 146
In MemSQL, FOREIGN SHARD KEYs
cannot be added after a table has been created, so converting this to be a FOREIGN SHARD KEY relationship won't work.
In this case, I can't think of a solution that would work without changing Liquibase
to create an ordinary index on name rather than a foreign key.
Upvotes: 2