A decentralized music tracking and discovery platform built on AT Protocol 馃幍
listenbrainz
spotify
atproto
lastfm
musicbrainz
scrobbling
1import { type InferSelectModel, sql } from "drizzle-orm";
2import { integer, pgTable, text, timestamp } from "drizzle-orm/pg-core";
3
4const users = pgTable("users", {
5 id: text("xata_id").primaryKey().default(sql`xata_id()`),
6 did: text("did").unique().notNull(),
7 displayName: text("display_name"),
8 handle: text("handle").unique().notNull(),
9 avatar: text("avatar").notNull(),
10 createdAt: timestamp("xata_createdat").defaultNow().notNull(),
11 updatedAt: timestamp("xata_updatedat").defaultNow().notNull(),
12 xataVersion: integer("xata_version"),
13});
14
15export type SelectUser = InferSelectModel<typeof users>;
16export type InsertUser = InferSelectModel<typeof users>;
17
18export default users;