CREATE TABLE IF NOT EXISTS user_role (
user_id INT NULL ,
role_id INT NULL ,
CONSTRAINT user_role_user_id_fk
FOREIGN KEY (user_id) REFERENCES user (id),
CONSTRAINT user_role_role_id_fk
FOREIGN KEY (role_id) REFERENCES role (id)
)
ENGINE=InnoDB;
CREATE INDEX user_role_role_id_fk ON user_role (role_id);
CREATE INDEX user_role_user_id_fk ON user_role (user_id);