otter-space-sdk/pkg/database/migrations/004_scrape_history.sql
SoXX 59f404883e
Some checks failed
Gitea Build Check / Build (pull_request) Failing after 2m54s
fix(database): migration
- primary key is now first in position
2024-10-15 12:28:52 +02:00

11 lines
369 B
SQL

-- +migrate Up
CREATE TABLE "ScrapeHistory"
(
scrape_task_id CHAR(25) PRIMARY KEY,
user_source_id CHAR(25) NOT NULL REFERENCES "UserSource" (id),
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
);