Changeset e7f1bfa for database/drizzle/config
- Timestamp:
- 12/25/25 03:39:56 (7 months ago)
- Branches:
- main
- Children:
- 898cf68
- Parents:
- 83fb5e2
- File:
-
- 1 edited
-
database/drizzle/config/componentFieldConfig.ts (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
database/drizzle/config/componentFieldConfig.ts
r83fb5e2 re7f1bfa 1 import { 2 cablesTable, caseMoboFormFactorsTable, casePsFormFactorsTable, 3 caseStorageFormFactorsTable, coolerCPUSocketsTable, coolersTable, 4 CPUTable, 5 GPUTable, memoryCardsTable, 6 memoryTable, motherboardsTable, 7 networkAdaptersTable, 8 networkCardsTable, opticalDrivesTable, pcCasesTable, powerSupplyTable, 9 soundCardsTable, storageTable 10 } from "../schema"; 11 12 export type ComponentConfig<SelectType = any, InsertType = any> = { 13 table: any; 14 multiTables?: { 15 storageFormFactors?: typeof caseStorageFormFactorsTable; 16 psFormFactors?: typeof casePsFormFactorsTable; 17 moboFormFactors?: typeof caseMoboFormFactorsTable; 18 cpuSockets?: typeof coolerCPUSocketsTable; 19 } 20 }; 21 1 22 export type ComponentType = 2 23 | 'cpu' … … 14 35 | 'network_adapter' 15 36 | 'network_card'; 37 38 export const typeConfigMap: Record<ComponentType, ComponentConfig> = { 39 cpu: { table: CPUTable }, 40 gpu: { table: GPUTable }, 41 memory: { table: memoryTable }, 42 storage: { table: storageTable }, 43 power_supply: { table: powerSupplyTable }, 44 motherboard: { table: motherboardsTable }, 45 case: { 46 table: pcCasesTable, 47 multiTables: { 48 storageFormFactors: caseStorageFormFactorsTable, 49 psFormFactors: casePsFormFactorsTable, 50 moboFormFactors: caseMoboFormFactorsTable, 51 }, 52 }, 53 cooler: { 54 table: coolersTable, 55 multiTables: { 56 cpuSockets: coolerCPUSocketsTable, 57 }, 58 }, 59 memory_card: { table: memoryCardsTable }, 60 optical_drive: { table: opticalDrivesTable }, 61 sound_card: { table: soundCardsTable }, 62 cables: { table: cablesTable }, 63 network_adapter: { table: networkAdaptersTable }, 64 network_card: { table: networkCardsTable }, 65 }; 16 66 17 67 export const requiredFields: Record<ComponentType, string[]> = {
Note:
See TracChangeset
for help on using the changeset viewer.
