| 1 | CREATE TYPE "public"."custom_field_type" AS ENUM('text', 'number', 'select', 'checkbox', 'date', 'datetime', 'time');--> statement-breakpoint |
| 2 | CREATE TABLE "custom_fields" ( |
| 3 | "id" text PRIMARY KEY |
| 4 | "organization_id" text NOT NULL |
| 5 | "project_id" text, |
| 6 | "label" text NOT NULL |
| 7 | "type" "custom_field_type" NOT NULL |
| 8 | "required" boolean DEFAULT |
| 9 | "visible_to_client" boolean DEFAULT |
| 10 | "default_value" text, |
| 11 | "options" jsonb, |
| 12 | "config" jsonb, |
| 13 | "created_at" timestamp DEFAULT |
| 14 | "updated_at" timestamp DEFAULT |
| 15 | ); |
| 16 | --> statement-breakpoint |
| 17 | ALTER TABLE "time_entries" ADD COLUMN |
| 18 | ALTER TABLE "custom_fields" ADD |
| 19 | ALTER TABLE "custom_fields" ADD |
| 20 | CREATE INDEX "custom_fields_project_idx" ON |
| 21 | CREATE INDEX "custom_fields_organization_idx" ON |