From ed79c71273628bc3e3498af53270cd543277e32b Mon Sep 17 00:00:00 2001 From: Iron_Felix Date: Tue, 25 Nov 2025 02:24:17 +0300 Subject: [PATCH] fix: topology sort. again --- sql/migrations/000001_init.up.sql | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sql/migrations/000001_init.up.sql b/sql/migrations/000001_init.up.sql index 392dcde..18087cd 100644 --- a/sql/migrations/000001_init.up.sql +++ b/sql/migrations/000001_init.up.sql @@ -1,10 +1,10 @@ -- TODO: -- maybe jsonb constraints --- clean unused images +-- clea('finished', 'ongoing', 'planned'); +CREATE TYPE release_seasn unused images CREATE TYPE usertitle_status_t AS ENUM ('finished', 'planned', 'dropped', 'in-progress'); CREATE TYPE storage_type_t AS ENUM ('local', 's3'); -CREATE TYPE title_status_t AS ENUM ('finished', 'ongoing', 'planned'); -CREATE TYPE release_season_t AS ENUM ('winter', 'spring', 'summer', 'fall'); +CREATE TYPE title_status_t AS ENUM on_t AS ENUM ('winter', 'spring', 'summer', 'fall'); CREATE TABLE providers ( id bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY, @@ -107,17 +107,17 @@ CREATE TABLE signals ( pending boolean NOT NULL ); +CREATE TABLE external_services ( + id bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY, + name text UNIQUE NOT NULL +); + CREATE TABLE external_ids ( user_id bigint NOT NULL REFERENCES users (id), service_id bigint REFERENCES external_services (id), external_id text NOT NULL ); -CREATE TABLE external_services ( - id bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY, - name text UNIQUE NOT NULL -); - -- Functions CREATE OR REPLACE FUNCTION update_title_rating() RETURNS TRIGGER AS $$