From a831d4fc6117fe49a57336ad0ad196febd074bd3 Mon Sep 17 00:00:00 2001 From: Zynh Ludwig Date: Fri, 15 Nov 2024 10:54:01 -0800 Subject: [PATCH] feat: simple records schema --- migrations/20241115182043_init.down.sql | 2 ++ migrations/20241115182043_init.up.sql | 8 ++++++++ 2 files changed, 10 insertions(+) create mode 100644 migrations/20241115182043_init.down.sql create mode 100644 migrations/20241115182043_init.up.sql diff --git a/migrations/20241115182043_init.down.sql b/migrations/20241115182043_init.down.sql new file mode 100644 index 0000000..9413bae --- /dev/null +++ b/migrations/20241115182043_init.down.sql @@ -0,0 +1,2 @@ +-- Add down migration script here +DROP TABLE IF EXISTS records; diff --git a/migrations/20241115182043_init.up.sql b/migrations/20241115182043_init.up.sql new file mode 100644 index 0000000..2464da2 --- /dev/null +++ b/migrations/20241115182043_init.up.sql @@ -0,0 +1,8 @@ +-- Add up migration script here +CREATE TABLE IF NOT EXISTS records ( + id INTEGER PRIMARY KEY, + uploaded TEXT NOT NULL, + file_path TEXT NOT NULL, + downloads INTEGER NOT NULL DEFAULT 0, + max_downloads INTEGER NOT NULL +) STRICT;