refactor(db): 删除去业务化后残留的 device/task 表定义
This commit is contained in:
@@ -1,14 +1,4 @@
|
||||
import { defineRelations } from 'drizzle-orm'
|
||||
import * as schema from './schema'
|
||||
|
||||
export const relations = defineRelations(schema, (r) => ({
|
||||
deviceTable: {
|
||||
tasks: r.many.taskTable(),
|
||||
},
|
||||
taskTable: {
|
||||
device: r.one.deviceTable({
|
||||
from: r.taskTable.deviceId,
|
||||
to: r.deviceTable.id,
|
||||
}),
|
||||
},
|
||||
}))
|
||||
export const relations = defineRelations(schema, () => ({}))
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
import { sqliteTable, text } from 'drizzle-orm/sqlite-core'
|
||||
import { generatedFields } from '../fields'
|
||||
|
||||
export const deviceTable = sqliteTable('device', {
|
||||
...generatedFields,
|
||||
licence: text('licence').notNull().unique(),
|
||||
fingerprint: text('fingerprint').notNull(),
|
||||
platformPublicKey: text('platform_public_key').notNull(),
|
||||
pgpPrivateKey: text('pgp_private_key'),
|
||||
pgpPublicKey: text('pgp_public_key'),
|
||||
})
|
||||
@@ -1,3 +1 @@
|
||||
export * from './device'
|
||||
export * from './task'
|
||||
export * from './ux-config'
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
import { integer, sqliteTable, text } from 'drizzle-orm/sqlite-core'
|
||||
import { generatedFields } from '../fields'
|
||||
|
||||
export const taskTable = sqliteTable('task', {
|
||||
...generatedFields,
|
||||
deviceId: text('device_id').notNull(),
|
||||
taskId: text('task_id').notNull(),
|
||||
enterpriseId: text('enterprise_id'),
|
||||
orgName: text('org_name'),
|
||||
inspectionId: text('inspection_id'),
|
||||
inspectionPerson: text('inspection_person'),
|
||||
issuedAt: integer('issued_at', { mode: 'timestamp_ms' }),
|
||||
status: text('status', { enum: ['pending', 'in_progress', 'done'] })
|
||||
.notNull()
|
||||
.default('pending'),
|
||||
})
|
||||
Reference in New Issue
Block a user