feat: add userCharacterHistory table schema and update journal with new version
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { integer, sqliteTable, text, real } from 'drizzle-orm/sqlite-core';
|
||||
import { user } from './auth.schema';
|
||||
|
||||
// Define devil fruit types
|
||||
export type DevilFruitType = 'Paramecia' | 'Zoan' | 'Logia' | 'Unknown';
|
||||
@@ -106,5 +107,16 @@ export const characterHistory = sqliteTable('characterHistory', {
|
||||
updatedAt: integer('updatedAt').notNull().$default(() => Date.now()),
|
||||
});
|
||||
|
||||
// Define the user character history table schema
|
||||
export const userCharacterHistory = sqliteTable('userCharacterHistory', {
|
||||
id: text('id')
|
||||
.primaryKey()
|
||||
.$defaultFn(() => crypto.randomUUID()),
|
||||
userId: text('userId').references(() => user.id),
|
||||
characterHistoryId: text('characterHistoryId').references(() => characterHistory.id),
|
||||
tryCount: integer('tryCount').notNull(),
|
||||
createdAt: integer('createdAt').notNull().$default(() => Date.now())
|
||||
});
|
||||
|
||||
|
||||
export * from './auth.schema';
|
||||
|
||||
Reference in New Issue
Block a user