forked from
rocksky.app/rocksky
A decentralized music tracking and discovery platform built on AT Protocol 馃幍
1import { type InferInsertModel, type InferSelectModel, sql } from "drizzle-orm";
2import { integer, sqliteTable, text } from "drizzle-orm/sqlite-core";
3
4const albums = sqliteTable("albums", {
5 id: text("id").primaryKey().notNull(),
6 title: text("title").notNull(),
7 artist: text("artist").notNull(),
8 releaseDate: text("release_date"),
9 year: integer("year"),
10 albumArt: text("album_art"),
11 uri: text("uri").unique(),
12 cid: text("cid").unique().notNull(),
13 artistUri: text("artist_uri"),
14 appleMusicLink: text("apple_music_link").unique(),
15 spotifyLink: text("spotify_link").unique(),
16 tidalLink: text("tidal_link").unique(),
17 youtubeLink: text("youtube_link").unique(),
18 createdAt: integer("created_at", { mode: "timestamp" })
19 .notNull()
20 .default(sql`(unixepoch())`),
21 updatedAt: integer("updated_at", { mode: "timestamp" })
22 .notNull()
23 .default(sql`(unixepoch())`),
24});
25
26export type SelectAlbum = InferSelectModel<typeof albums>;
27export type InsertAlbum = InferInsertModel<typeof albums>;
28
29export default albums;