Every analytics tool wants a subscription. And your data. I built Twiligent instead. YouTube stats. Instagram stats. One dashboard. Runs locally on your machine.
feat(db): remove tracked Reddit posts and tracked_posts.account_id
spacesdrive176b6efb4397
diff --git a/supabase/migrations/20261104222452_alter_tracked_posts_youtube_only.sql b/supabase/migrations/20261104222452_alter_tracked_posts_youtube_only.sqlnew file mode 100644index 0000000..d8a7791--- /dev/null+++ b/supabase/migrations/20261104222452_alter_tracked_posts_youtube_only.sql@@ -0,0 +1,7 @@+-- removes tracked Reddit posts and lets tracked_posts hold YouTube videos only+delete from public.tracked_posts where content_type = 'reddit';+alter table public.tracked_posts+ drop constraint tracked_posts_account_check,+ drop constraint tracked_posts_content_type_check,+ add constraint tracked_posts_content_type_check check (content_type = 'youtube'),+ alter column content_type set default 'youtube';diff --git a/supabase/migrations/20261104222455_drop_tracked_posts_account_id.sql b/supabase/migrations/20261104222455_drop_tracked_posts_account_id.sqlnew file mode 100644index 0000000..243616c--- /dev/null+++ b/supabase/migrations/20261104222455_drop_tracked_posts_account_id.sql@@ -0,0 +1,4 @@+-- removes tracked_posts.account_id, which only named the Reddit account whose cookie read a post+alter table public.tracked_posts+ drop constraint tracked_posts_account_fkey,+ drop column account_id;diff --git a/supabase/rollbacks/20261104222452_alter_tracked_posts_youtube_only.sql b/supabase/rollbacks/20261104222452_alter_tracked_posts_youtube_only.sqlnew file mode 100644index 0000000..fa6a5fd--- /dev/null+++ b/supabase/rollbacks/20261104222452_alter_tracked_posts_youtube_only.sql@@ -0,0 +1,6 @@+-- lets tracked_posts hold Reddit posts again; the deleted rows come back only from the backup taken before the change+alter table public.tracked_posts+ alter column content_type set default 'reddit',+ drop constraint tracked_posts_content_type_check,+ add constraint tracked_posts_content_type_check check (content_type in ('reddit', 'youtube')),+ add constraint tracked_posts_account_check check (content_type = 'reddit' or account_id is null);diff --git a/supabase/rollbacks/20261104222455_drop_tracked_posts_account_id.sql b/supabase/rollbacks/20261104222455_drop_tracked_posts_account_id.sqlnew file mode 100644index 0000000..1d42684--- /dev/null+++ b/supabase/rollbacks/20261104222455_drop_tracked_posts_account_id.sql@@ -0,0 +1,5 @@+-- adds tracked_posts.account_id back, empty, with its link to the account it names+alter table public.tracked_posts add column account_id text;+alter table public.tracked_posts+ add constraint tracked_posts_account_fkey foreign key (account_id, user_id)+ references public.accounts (id, user_id) on delete set null (account_id);diff --git a/supabase/schemas/public/tables/tracked_posts.sql b/supabase/schemas/public/tables/tracked_posts.sqlindex bee54f0..8cc2791 100644--- a/supabase/schemas/public/tables/tracked_posts.sql+++ b/supabase/schemas/public/tables/tracked_posts.sql@@ -1,17 +1,14 @@CREATE TABLE "public"."tracked_posts" ("id" text NOT NULL,"user_id" uuid NOT NULL,- "account_id" text,"url" text NOT NULL,"label" text NOT NULL DEFAULT ''::text,"category" text NOT NULL DEFAULT ''::text,"created_at" timestamp with time zone NOT NULL DEFAULT now(),"updated_at" timestamp with time zone NOT NULL DEFAULT now(),"data" jsonb,- "content_type" text NOT NULL DEFAULT 'reddit'::text,- CONSTRAINT "tracked_posts_account_check" CHECK (((content_type = 'reddit'::text) OR (account_id IS NULL))),- CONSTRAINT "tracked_posts_account_fkey" FOREIGN KEY (account_id, user_id) REFERENCES public.accounts(id, user_id) ON DELETE SET NULL (account_id),- CONSTRAINT "tracked_posts_content_type_check" CHECK ((content_type = ANY (ARRAY['reddit'::text, 'youtube'::text]))),+ "content_type" text NOT NULL DEFAULT 'youtube'::text,+ CONSTRAINT "tracked_posts_content_type_check" CHECK ((content_type = 'youtube'::text)),CONSTRAINT "tracked_posts_data_check" CHECK (((data IS NULL) OR (jsonb_typeof(data) = 'object'::text))),CONSTRAINT "tracked_posts_pkey" PRIMARY KEY (id),CONSTRAINT "tracked_posts_user_id_fkey" FOREIGN KEY (user_id) REFERENCES auth.users(id) ON DELETE CASCADE