mirror of
https://github.com/flibusta-apps/book_library_server.git
synced 2026-03-02 22:55:21 +01:00
Enable sqlx "migrate" feature and add SQL migrations to create the database schema: pg_trgm extension, sources, genres, authors, sequences, books, junction tables, annotations, and supporting indexes
10 lines
352 B
SQL
10 lines
352 B
SQL
-- Create sequences table
|
|
CREATE TABLE IF NOT EXISTS sequences (
|
|
id SERIAL PRIMARY KEY,
|
|
source SMALLINT NOT NULL,
|
|
remote_id INTEGER NOT NULL,
|
|
name VARCHAR(256) NOT NULL,
|
|
CONSTRAINT uc_sequences_source_remote_id UNIQUE (source, remote_id),
|
|
CONSTRAINT fk_sequences_sources_id_source FOREIGN KEY (source) REFERENCES sources(id)
|
|
);
|