我正在从 mySQL 转移到 postgreSQL,想知道如何在 postgreSQL 表中添加索引
CREATE TABLE IF NOT EXISTS game_history
(
id SERIAL,
PRIMARY KEY(id),
INDEX fk_game_history_user_idx (game_id ASC) ,
CONSTRAINT fk_game_history_user
FOREIGN KEY (game_id )
REFERENCES mydb.game (id)
ON DELETE NO ACTION
ON UPDATE NO ACTION
)
从
INDEX fk_game_history_user_idx (game_id ASC) ,
CONSTRAINT fk_game_history_user
FOREIGN KEY (game_id )
REFERENCES mydb.game (id)
ON DELETE NO ACTION
ON UPDATE NO ACTION
)
我不确定这一点。