Первоначальные данные
This commit is contained in:
commit
f61fc0016c
4 files changed
+162
No files matched your search
@@ -0,0 +1,36 @@
|
||||
-- ============================================================
|
||||
-- Индексы для быстрого поиска
|
||||
-- ============================================================
|
||||
|
||||
-- Авторы
|
||||
CREATE INDEX IF NOT EXISTS idx_authors_last_name ON authors(last_name);
|
||||
CREATE INDEX IF NOT EXISTS idx_authors_first_letter ON authors(first_letter);
|
||||
CREATE INDEX IF NOT EXISTS idx_authors_name_hash ON authors(name_hash);
|
||||
CREATE INDEX IF NOT EXISTS idx_authors_full_name ON authors(full_name);
|
||||
|
||||
-- Серии
|
||||
CREATE INDEX IF NOT EXISTS idx_series_name_hash ON series(name_hash);
|
||||
CREATE INDEX IF NOT EXISTS idx_series_first_letter ON series(first_letter);
|
||||
|
||||
-- Жанры
|
||||
CREATE INDEX IF NOT EXISTS idx_genres_code ON genres(code);
|
||||
CREATE INDEX IF NOT EXISTS idx_genres_parent ON genres(parent_code);
|
||||
CREATE INDEX IF NOT EXISTS idx_genres_root ON genres(root_code);
|
||||
CREATE INDEX IF NOT EXISTS idx_genres_is_root ON genres(is_root);
|
||||
CREATE INDEX IF NOT EXISTS idx_genres_is_custom ON genres(is_custom);
|
||||
|
||||
-- Книги
|
||||
CREATE INDEX IF NOT EXISTS idx_books_title_hash ON books(title_hash);
|
||||
CREATE INDEX IF NOT EXISTS idx_books_internal_id ON books(internal_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_books_internal_id2 ON books(internal_id2);
|
||||
CREATE INDEX IF NOT EXISTS idx_books_source ON books(source);
|
||||
CREATE INDEX IF NOT EXISTS idx_books_series ON books(series_id, series_number);
|
||||
CREATE INDEX IF NOT EXISTS idx_books_language ON books(language);
|
||||
CREATE INDEX IF NOT EXISTS idx_books_added_date ON books(added_date DESC NULLS LAST);
|
||||
CREATE INDEX IF NOT EXISTS idx_books_fts ON books USING GIN (fts);
|
||||
|
||||
-- Связи
|
||||
CREATE INDEX IF NOT EXISTS idx_book_authors_book ON book_authors(book_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_book_authors_author ON book_authors(author_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_book_genres_book ON book_genres(book_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_book_genres_genre ON book_genres(genre_id);
|
||||
Reference in new issue
Block a user