You've already forked obsidian-visualiser
Character creation implementation. People and training ready, still need to work on abilities and spells
This commit is contained in:
11
db/schema.ts
11
db/schema.ts
@@ -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], }),
|
||||
}));
|
||||
Reference in New Issue
Block a user