feat: add originalFilename and fileExtension to images schema
This commit is contained in:
parent
191b8c8501
commit
e57c66f318
|
|
@ -46,7 +46,8 @@ export const images = pgTable(
|
||||||
pendingFlowId: text('pending_flow_id'), // Temporary UUID for lazy flow pattern
|
pendingFlowId: text('pending_flow_id'), // Temporary UUID for lazy flow pattern
|
||||||
apiKeyId: uuid('api_key_id').references(() => apiKeys.id, { onDelete: 'set null' }),
|
apiKeyId: uuid('api_key_id').references(() => apiKeys.id, { onDelete: 'set null' }),
|
||||||
|
|
||||||
// Storage (MinIO path format: orgSlug/projectSlug/category/YYYY-MM/filename.ext)
|
// Storage (MinIO path format: orgSlug/projectSlug/img/{imageId})
|
||||||
|
// Note: imageId = this record's UUID, filename has no extension
|
||||||
storageKey: varchar('storage_key', { length: 500 }).notNull().unique(),
|
storageKey: varchar('storage_key', { length: 500 }).notNull().unique(),
|
||||||
storageUrl: text('storage_url').notNull(),
|
storageUrl: text('storage_url').notNull(),
|
||||||
|
|
||||||
|
|
@ -54,6 +55,8 @@ export const images = pgTable(
|
||||||
mimeType: varchar('mime_type', { length: 100 }).notNull(),
|
mimeType: varchar('mime_type', { length: 100 }).notNull(),
|
||||||
fileSize: integer('file_size').notNull(),
|
fileSize: integer('file_size').notNull(),
|
||||||
fileHash: varchar('file_hash', { length: 64 }), // SHA-256 for deduplication
|
fileHash: varchar('file_hash', { length: 64 }), // SHA-256 for deduplication
|
||||||
|
originalFilename: varchar('original_filename', { length: 255 }), // User's original filename
|
||||||
|
fileExtension: varchar('file_extension', { length: 20 }), // Original extension (png, jpg, etc.)
|
||||||
|
|
||||||
// Dimensions
|
// Dimensions
|
||||||
width: integer('width'),
|
width: integer('width'),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue