Character creation implementation. People and training ready, still need to work on abilities and spells

This commit is contained in:
2025-04-21 21:53:15 +02:00
parent 7beeed8a61
commit f599b561af
30 changed files with 7538 additions and 7 deletions

View File

@@ -53,6 +53,14 @@ export const emailValidationTable = sqliteTable("email_validation", {
timestamp: int({ mode: 'timestamp' }).notNull(),
})
export const characterTable = sqliteTable("character", {
id: int().primaryKey({ autoIncrement: true }),
name: text().notNull(),
owner: int().notNull().references(() => usersTable.id, { onDelete: 'cascade', onUpdate: 'cascade' }),
progress: text({ mode: 'json' }).notNull(),
thumbnail: blob(),
})
export const usersRelation = relations(usersTable, ({ one, many }) => ({
data: one(usersDataTable, { fields: [usersTable.id], references: [usersDataTable.id], }),
session: many(userSessionsTable),
@@ -70,4 +78,7 @@ export const userPermissionsRelation = relations(userPermissionsTable, ({ one })
}));
export const explorerContentRelation = relations(explorerContentTable, ({ one }) => ({
users: one(usersTable, { fields: [explorerContentTable.owner], references: [usersTable.id], }),
}));
export const characterRelation = relations(characterTable, ({ one }) => ({
users: one(usersTable, { fields: [characterTable.owner], references: [usersTable.id], }),
}));