integratedhub/drizzle/0003_strong_namora.sql

13 lines
663 B
SQL

CREATE TABLE "rent_changes" (
"id" text PRIMARY KEY NOT NULL,
"property_id" text,
"effective_date" bigint,
"monthly_rent" double precision,
"reason" text,
"previous_rent" double precision,
"created_by" text,
"created_on" bigint
);
--> statement-breakpoint
ALTER TABLE "rent_changes" ADD CONSTRAINT "rent_changes_property_id_properties_id_fk" FOREIGN KEY ("property_id") REFERENCES "public"."properties"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "rent_changes" ADD CONSTRAINT "rent_changes_created_by_users_id_fk" FOREIGN KEY ("created_by") REFERENCES "public"."users"("id") ON DELETE no action ON UPDATE no action;