A decentralized music tracking and discovery platform built on AT Protocol 馃幍
rocksky.app
spotify
atproto
lastfm
musicbrainz
scrobbling
listenbrainz
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")
6 .primaryKey()
7 .default(sql`xata_id()`),
8 did: text("did").unique().notNull(),
9 displayName: text("display_name"),
10 handle: text("handle").unique().notNull(),
11 avatar: text("avatar").notNull(),
12 createdAt: timestamp("xata_createdat").defaultNow().notNull(),
13 updatedAt: timestamp("xata_updatedat").defaultNow().notNull(),
14 xataVersion: integer("xata_version"),
15});
16
17export type SelectUser = InferSelectModel<typeof users>;
18export type InsertUser = InferSelectModel<typeof users>;
19
20export default users;