From c906efba0669d3c53e12ec430b709cb83aa7cea4 Mon Sep 17 00:00:00 2001 From: Mostafa Razavi Date: Sun, 23 Apr 2023 00:46:53 +0200 Subject: [PATCH] Add missing migrations --- db/migrations/000014_add_images.down.sql | 1 + db/migrations/000014_add_images.up.sql | 11 +++++++++++ 2 files changed, 12 insertions(+) create mode 100644 db/migrations/000014_add_images.down.sql create mode 100644 db/migrations/000014_add_images.up.sql diff --git a/db/migrations/000014_add_images.down.sql b/db/migrations/000014_add_images.down.sql new file mode 100644 index 0000000..8d6aff9 --- /dev/null +++ b/db/migrations/000014_add_images.down.sql @@ -0,0 +1 @@ +drop table images; diff --git a/db/migrations/000014_add_images.up.sql b/db/migrations/000014_add_images.up.sql new file mode 100644 index 0000000..5d1a71c --- /dev/null +++ b/db/migrations/000014_add_images.up.sql @@ -0,0 +1,11 @@ +-- this table is intentionally de-normalized. already, deleting urls takes quite +-- a long time because of FK checks. +create table images ( + id bigserial primary key, + image_hash text unique not null, + content_hash text not null, + image text not null, + alt text not null, + fetch_time timestamp not null, + url text not null +); -- 2.45.2