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