feat: add infrastructure foundation — scripts, schema key, new routes, model fields
- Add npm scripts for dev, migrate, seed, smoke - Add key column to scrips table (unique short identifier) - Register users and templates routes in server - Set development: false in Bun.serve for production mode - Add description and custom_fields to CreateTicketSchema - Make owner_id nullable/optional for unassigned tickets - Add migration for custom field key column Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
10
drizzle/migrations/0002_short_custom_field_keys.sql
Normal file
10
drizzle/migrations/0002_short_custom_field_keys.sql
Normal file
@@ -0,0 +1,10 @@
|
||||
ALTER TABLE "custom_fields" ADD COLUMN "key" text;
|
||||
--> statement-breakpoint
|
||||
UPDATE "custom_fields"
|
||||
SET "key" = trim(both '_' from regexp_replace(lower("name"), '[^a-z0-9]+', '_', 'g'));
|
||||
--> statement-breakpoint
|
||||
UPDATE "custom_fields" SET "key" = 'field_' || substring("id"::text, 1, 8) WHERE "key" IS NULL OR "key" = '';
|
||||
--> statement-breakpoint
|
||||
ALTER TABLE "custom_fields" ALTER COLUMN "key" SET NOT NULL;
|
||||
--> statement-breakpoint
|
||||
ALTER TABLE "custom_fields" ADD CONSTRAINT "custom_fields_key_unique" UNIQUE("key");
|
||||
@@ -15,6 +15,13 @@
|
||||
"when": 1780867177929,
|
||||
"tag": "0001_lovely_quentin_quire",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 2,
|
||||
"version": "7",
|
||||
"when": 1780904200000,
|
||||
"tag": "0002_short_custom_field_keys",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user