named more indexes

This commit is contained in:
mrepetto 2019-09-19 19:48:23 -03:00
parent 728f85f4db
commit 22a1a46259

View file

@ -59,8 +59,9 @@ CREATE_FINGERPRINTS_TABLE = f"""
, `{FIELD_OFFSET}` INT UNSIGNED NOT NULL , `{FIELD_OFFSET}` INT UNSIGNED NOT NULL
, `date_created` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP , `date_created` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
, `date_modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP , `date_modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
, INDEX (`{FIELD_HASH}`) , INDEX `ix_{FINGERPRINTS_TABLENAME}_{FIELD_HASH}` (`{FIELD_HASH}`)
, CONSTRAINT `uq_{FINGERPRINTS_TABLENAME}` UNIQUE KEY (`{FIELD_SONG_ID}`, `{FIELD_OFFSET}`, `{FIELD_HASH}`) , CONSTRAINT `uq_{FINGERPRINTS_TABLENAME}_{FIELD_SONG_ID}_{FIELD_OFFSET}_{FIELD_HASH}`
UNIQUE KEY (`{FIELD_SONG_ID}`, `{FIELD_OFFSET}`, `{FIELD_HASH}`)
, CONSTRAINT `fk_{FINGERPRINTS_TABLENAME}_{FIELD_SONG_ID}` FOREIGN KEY (`{FIELD_SONG_ID}`) , CONSTRAINT `fk_{FINGERPRINTS_TABLENAME}_{FIELD_SONG_ID}` FOREIGN KEY (`{FIELD_SONG_ID}`)
REFERENCES `{SONGS_TABLENAME}`(`{FIELD_SONG_ID}`) ON DELETE CASCADE REFERENCES `{SONGS_TABLENAME}`(`{FIELD_SONG_ID}`) ON DELETE CASCADE
) ENGINE=INNODB; ) ENGINE=INNODB;