Label new tags for creators + tag categories migration fix (#64)
Some checks are pending
Deploy Supabase Migrations to Production / migrate (push) Waiting to run

* Add ability to see new tags since last update

* Fix some bugs and edge cases

* Add migration fix to appease ci
This commit is contained in:
Jared Schoeny
2026-07-09 23:35:10 -06:00
committed by GitHub
parent 8ea523de3c
commit 6e41bb99f8
11 changed files with 111 additions and 17 deletions

View File

@@ -0,0 +1,18 @@
-- All existing tags will have null created_at values
-- but future tags will default to now()
alter table "public"."tags"
add column "created_at" timestamp with time zone;
alter table "public"."tags"
alter column "created_at" set default now();
-- All existing hacks will use created_at for tags_updated_at
-- but future hacks will default to now()
alter table "public"."hacks"
add column "tags_updated_at" timestamp with time zone;
update "public"."hacks"
set tags_updated_at = created_at
where tags_updated_at is null;
alter table "public"."hacks"
alter column "tags_updated_at" set default now();
alter table "public"."hacks"
alter column "tags_updated_at" set not null;

View File

@@ -0,0 +1,11 @@
DO $$ BEGIN
IF EXISTS (
SELECT 1
FROM pg_enum e
JOIN pg_type t ON e.enumtypid = t.oid
WHERE t.typname = 'Tag Categories'
AND e.enumlabel = 'Sprites'
) THEN
ALTER TYPE public."Tag Categories" RENAME VALUE 'Sprites' TO 'Graphics';
END IF;
END $$;