integratedhub/drizzle/0005_user_onboarding_flags.sql
2026-01-20 09:02:26 -06:00

16 lines
602 B
SQL

-- Migration: Track onboarding history for landlord and tenant roles
ALTER TABLE "users"
ADD COLUMN IF NOT EXISTS "onboarded_landlord" boolean DEFAULT false,
ADD COLUMN IF NOT EXISTS "onboarded_tenant" boolean DEFAULT false;
--> statement-breakpoint
UPDATE "users" SET "onboarded_landlord" = false WHERE "onboarded_landlord" IS NULL;
UPDATE "users" SET "onboarded_tenant" = false WHERE "onboarded_tenant" IS NULL;
--> statement-breakpoint
UPDATE "users" SET "onboarded_landlord" = true WHERE "user_type" = 'landlord';
UPDATE "users" SET "onboarded_tenant" = true WHERE "user_type" = 'tenant';