added overall rating

This commit is contained in:
2025-07-24 22:38:28 +02:00
parent b084910dc0
commit 4ea6ee17bb
6 changed files with 260 additions and 11 deletions

View File

@@ -1,4 +1,4 @@
import { sqliteTable, integer, text, blob, real, uniqueIndex } from 'drizzle-orm/sqlite-core';
import { sqliteTable, integer, text, blob, real } from 'drizzle-orm/sqlite-core';
import { isNull } from 'drizzle-orm';
export const user = sqliteTable('user', {
@@ -77,3 +77,17 @@ export const participantProgress = sqliteTable('participant_progress', {
maxReachedTime: real('max_reached_time').default(0),
updatedAt: integer('updated_at', { mode: 'timestamp' }).notNull()
});
export const overallRating = sqliteTable('overall_rating', {
id: text('id').primaryKey(),
participantId: text('participant_id')
.notNull()
.references(() => participant.id),
audioFileId: text('audio_file_id')
.notNull()
.references(() => audioFile.id),
value: real('value').notNull(), // 0-100 rating value
createdAt: integer('created_at', { mode: 'timestamp' }).notNull(),
updatedAt: integer('updated_at', { mode: 'timestamp' }).notNull(),
deletedAt: integer('deleted_at', { mode: 'timestamp' }) // Soft delete for potential redos
});