Forums / General / Cluster mode problem / Comment37319

Author Topic

Bertrand Dunogier

Friday 28 August 2009 3:29:44 am

Comment37319

Yes, that's what I thought. There should be a trigger on ezdbfile_data: this trigger automatically deletes records in ezdbfile_data (blobs that are the actual content) when an entry is removed in ezdbfile.

This is what you should have get:

CREATE TABLE ezdbfile_data (
  name_hash VARCHAR(34)   NOT NULL DEFAULT '',
  offset    INT(11) UNSIGNED NOT NULL,
  filedata  BLOB          NOT NULL,
  PRIMARY KEY (name_hash, offset),
  CONSTRAINT ezdbfile_fk1 FOREIGN KEY (name_hash) REFERENCES ezdbfile (name_hash) ON DELETE CASCADE
) ENGINE=InnoDB;

To fix it, just drop the table and recreate it, or run this:

ALTER TABLE ezdbfile_data ADD CONSTRAINT ezdbfile_fk1 FOREIGN KEY (name_hash) REFERENCES ezdbfile (name_hash) ON DELETE CASCADE;

Bertrand Dunogier
eZ Systems Engineering, Lyon
http://twitter.com/bdunogier
http://gplus.to/BertrandDunogier