A decentralized music tracking and discovery platform built on AT Protocol 馃幍
at main 30 lines 1.1 kB view raw
1import { type InferInsertModel, type InferSelectModel, sql } from "drizzle-orm"; 2import { integer, sqliteTable, text } from "drizzle-orm/sqlite-core"; 3 4const artists = sqliteTable("artists", { 5 id: text("id").primaryKey().notNull(), 6 name: text("name").notNull(), 7 biography: text("biography"), 8 born: integer("born", { mode: "timestamp" }), 9 bornIn: text("born_in"), 10 died: integer("died", { mode: "timestamp" }), 11 picture: text("picture"), 12 uri: text("uri").unique(), 13 cid: text("cid").unique().notNull(), 14 appleMusicLink: text("apple_music_link"), 15 spotifyLink: text("spotify_link"), 16 tidalLink: text("tidal_link"), 17 youtubeLink: text("youtube_link"), 18 genres: text("genres"), 19 createdAt: integer("created_at", { mode: "timestamp" }) 20 .notNull() 21 .default(sql`(unixepoch())`), 22 updatedAt: integer("updated_at", { mode: "timestamp" }) 23 .notNull() 24 .default(sql`(unixepoch())`), 25}); 26 27export type SelectArtist = InferSelectModel<typeof artists>; 28export type InsertArtist = InferInsertModel<typeof artists>; 29 30export default artists;