From b1e97f414251785ed31ccc87544283ba9dc66ff1 Mon Sep 17 00:00:00 2001 From: SoXX Date: Tue, 15 Oct 2024 11:15:49 +0200 Subject: [PATCH] feat(database): scrape history - added migration --- pkg/database/migrations/004_scrape_history.sql | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 pkg/database/migrations/004_scrape_history.sql diff --git a/pkg/database/migrations/004_scrape_history.sql b/pkg/database/migrations/004_scrape_history.sql new file mode 100644 index 0000000..5d23e44 --- /dev/null +++ b/pkg/database/migrations/004_scrape_history.sql @@ -0,0 +1,11 @@ +-- +migrate Up +CREATE TABLE "ScrapeHistory" +( + user_source_id CHAR(25) NOT NULL REFERENCES "UserSource" (id), + scrape_task_id CHAR(25) PRIMARY KEY, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + finished_at TIMESTAMP NULL, + error TEXT NULL, + added_posts INT NOT NULL, + deleted_posts INT NOT NULL +); \ No newline at end of file