mirror of
https://github.com/Hackdex-App/hackdex-website.git
synced 2026-08-22 08:34:13 -05:00
Label new tags for creators + tag categories migration fix (#64)
Some checks are pending
Deploy Supabase Migrations to Production / migrate (push) Waiting to run
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:
18
supabase/migrations/20260706161539_created_at_for_tags.sql
Normal file
18
supabase/migrations/20260706161539_created_at_for_tags.sql
Normal 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;
|
||||
@@ -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 $$;
|
||||
Reference in New Issue
Block a user