feat(game): tasks table + schema v7 backfill, admin registry (#44)
This commit is contained in:
@@ -136,3 +136,20 @@ export const events = sqliteTable('events', {
|
||||
message: text('message').notNull(),
|
||||
createdAt: text('created_at').notNull(),
|
||||
})
|
||||
|
||||
// Queued actions (PR A, spec §3): one row per task assigned to a team. `payload` is a JSON
|
||||
// string whose shape depends on `type` (see the Task interface in lib/game/tasks.ts);
|
||||
// `helpers` is a JSON array of crew ids. Upgraded saves start with an empty queue — the v7
|
||||
// backfill stamps the version, the DDL in client.ts creates the table.
|
||||
export const tasks = sqliteTable('tasks', {
|
||||
id: integer('id').primaryKey({ autoIncrement: true }),
|
||||
saveId: integer('save_id').notNull().references(() => saves.id),
|
||||
type: text('type').notNull(), // TaskType
|
||||
payload: text('payload').notNull(),
|
||||
leadCrewId: integer('lead_crew_id').notNull().references(() => crew.id),
|
||||
helpers: text('helpers').notNull().default('[]'), // JSON array of crew ids
|
||||
duration: integer('duration').notNull(),
|
||||
remaining: integer('remaining').notNull(),
|
||||
status: text('status').notNull().default('ACTIVE'), // 'ACTIVE' | 'PENDING' | 'DONE'
|
||||
queuedAtTurn: integer('queued_at_turn').notNull().default(0),
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user