4c321a089d
- serve sparse index and config.json for local cargo repos from a cargo_index table - add Web API publish, yank and unyank under the local repo api root - drop index lines when the crate file is deleted
16 lines
586 B
SQL
16 lines
586 B
SQL
-- Local cargo registries: one sparse-index line per published crate version.
|
|
-- line holds the index JSON minus yanked, which flips on yank/unyank.
|
|
CREATE TABLE IF NOT EXISTS cargo_index (
|
|
id BIGSERIAL PRIMARY KEY,
|
|
repo_name TEXT NOT NULL,
|
|
file_path TEXT NOT NULL,
|
|
name TEXT NOT NULL,
|
|
version TEXT NOT NULL,
|
|
line TEXT NOT NULL,
|
|
yanked BOOLEAN NOT NULL DEFAULT FALSE,
|
|
created_at TIMESTAMPTZ DEFAULT NOW(),
|
|
UNIQUE(repo_name, file_path)
|
|
);
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_cargo_index_repo_name ON cargo_index(repo_name, lower(name));
|