ALTER TABLE vn.item ADD editorFk INT UNSIGNED NULL, ADD CONSTRAINT item_fk_editor FOREIGN KEY (editorFk) REFERENCES account.`user`(id); CREATE INDEX itemLog_changedModel_idx USING BTREE ON vn.itemLog (changedModel,changedModelId);