A decentralized music tracking and discovery platform built on AT Protocol 馃幍
rocksky.app
spotify
atproto
lastfm
musicbrainz
scrobbling
listenbrainz
1import { type InferInsertModel, type InferSelectModel, sql } from "drizzle-orm";
2import { pgTable, text, timestamp } from "drizzle-orm/pg-core";
3import users from "./users";
4
5const playlists = pgTable("playlists", {
6 id: text("xata_id").primaryKey().default(sql`xata_id()`),
7 name: text("name").notNull(),
8 picture: text("picture"),
9 description: text("description"),
10 uri: text("uri").unique(),
11 spotifyLink: text("spotify_link"),
12 tidalLink: text("tidal_link"),
13 appleMusicLink: text("apple_music_link"),
14 createdBy: text("created_by")
15 .notNull()
16 .references(() => users.id),
17 createdAt: timestamp("xata_createdat").defaultNow().notNull(),
18 updatedAt: timestamp("xata_updatedat").defaultNow().notNull(),
19});
20
21export type SelectPlaylist = InferSelectModel<typeof playlists>;
22export type InsertPlaylist = InferInsertModel<typeof playlists>;
23
24export default playlists;