Skip to content

Commit fbba7a0

Browse files
committed
wip: schema
1 parent 8a45c68 commit fbba7a0

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

src/lib/server/db/schema/index.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,18 @@
1-
export {}
1+
import { sqliteTable, integer, text } from "drizzle-orm/sqlite-core"
2+
import { relations } from "drizzle-orm"
3+
4+
export const accounts = sqliteTable("accounts", {
5+
id: integer().primaryKey(),
6+
})
7+
8+
export const accountsRelations = relations(accounts, ({ many }) => ({
9+
profiles: many(accounts),
10+
}))
11+
12+
export const profiles = sqliteTable("profiles", {
13+
id: integer().primaryKey(),
14+
account: integer().references(() => accounts.id),
15+
displayName: text("display_name"),
16+
usetname: text(),
17+
server: text(),
18+
})

0 commit comments

Comments
 (0)