16 lines
602 B
SQL
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';
|