diff options
author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-10-14 14:56:29 +0200 |
---|---|---|
committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-10-14 14:56:29 +0200 |
commit | 6c9286857ef8b314962b67f4a16a66e8c35531bc (patch) | |
tree | 9ced4485ec38b39f82cba258c06321a21c40000a /src/storage/video_database/schema.sql | |
parent | build(Cargo.toml): Add further lints (diff) | |
download | yt-6c9286857ef8b314962b67f4a16a66e8c35531bc.tar.gz yt-6c9286857ef8b314962b67f4a16a66e8c35531bc.zip |
refactor(treewide): Combine the separate crates in one workspace
Diffstat (limited to 'src/storage/video_database/schema.sql')
-rw-r--r-- | src/storage/video_database/schema.sql | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/src/storage/video_database/schema.sql b/src/storage/video_database/schema.sql deleted file mode 100644 index 3afd091..0000000 --- a/src/storage/video_database/schema.sql +++ /dev/null @@ -1,57 +0,0 @@ --- yt - A fully featured command line YouTube client --- --- Copyright (C) 2024 Benedikt Peetz <benedikt.peetz@b-peetz.de> --- SPDX-License-Identifier: GPL-3.0-or-later --- --- This file is part of Yt. --- --- You should have received a copy of the License along with this program. --- If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. - --- All tables should be declared STRICT, as I actually like to have types checking (and a --- db that doesn't lie to me). - --- Keep this table in sync with the `Video` structure -CREATE TABLE IF NOT EXISTS videos ( - cache_path TEXT UNIQUE CHECK (CASE WHEN cache_path IS NOT NULL THEN - status == 2 - ELSE - 1 - END), - description TEXT, - duration REAL, - extractor_hash TEXT UNIQUE NOT NULL PRIMARY KEY, - last_status_change INTEGER NOT NULL, - parent_subscription_name TEXT, - priority INTEGER NOT NULL DEFAULT 0, - publish_date INTEGER, - status INTEGER NOT NULL DEFAULT 0 CHECK (status IN (0, 1, 2, 3, 4, 5) AND - CASE WHEN status == 2 THEN - cache_path IS NOT NULL - ELSE - 1 - END AND - CASE WHEN status != 2 THEN - cache_path IS NULL - ELSE - 1 - END), - status_change INTEGER NOT NULL DEFAULT 0 CHECK (status_change IN (0, 1)), - thumbnail_url TEXT, - title TEXT NOT NULL, - url TEXT UNIQUE NOT NULL -) STRICT; - --- Store additional metadata for the videos marked to be watched -CREATE TABLE IF NOT EXISTS video_options ( - extractor_hash TEXT UNIQUE NOT NULL PRIMARY KEY, - subtitle_langs TEXT NOT NULL, - playback_speed REAL NOT NULL, - FOREIGN KEY(extractor_hash) REFERENCES videos (extractor_hash) -) STRICT; - --- Store subscriptions -CREATE TABLE IF NOT EXISTS subscriptions ( - name TEXT UNIQUE NOT NULL PRIMARY KEY, - url TEXT NOT NULL -) STRICT; |