update table definitions

This commit is contained in:
ksyasuda 2022-06-27 00:41:04 -07:00
parent bd949bb7c7
commit e8054c6cf2

View File

@ -24,7 +24,7 @@ CREATE TABLE IF NOT EXISTS watch_history (
episode_number integer NOT NULL, episode_number integer NOT NULL,
watch_date DATETIME NOT NULL, watch_date DATETIME NOT NULL,
CHECK (LENGTH(anime_name) > 0), CHECK (LENGTH(anime_name) > 0),
UNIQUE (anime_name, episode_number, watch_date) UNIQUE (anime_name, episode_number)
); );
CREATE TABLE IF NOT EXISTS search_history ( CREATE TABLE IF NOT EXISTS search_history (
@ -34,6 +34,6 @@ CREATE TABLE IF NOT EXISTS search_history (
CHECK (LENGTH(anime_name) > 0) CHECK (LENGTH(anime_name) > 0)
); );
CREATE UNIQUE INDEX IF NOT EXISTS anime_search_idx ON search_history (anime_name, search_date); CREATE UNIQUE INDEX IF NOT EXISTS anime_search_idx ON search_history (anime_name);
CREATE UNIQUE INDEX IF NOT EXISTS watch_anime_episode_idx ON watch_history (anime_name, episode_number); CREATE UNIQUE INDEX IF NOT EXISTS watch_anime_episode_idx ON watch_history (anime_name, episode_number);
CREATE UNIQUE INDEX IF NOT EXISTS dir_filename_idx ON file_history (directory, filename); CREATE UNIQUE INDEX IF NOT EXISTS dir_filename_idx ON file_history (directory, filename);