A decentralized music tracking and discovery platform built on AT Protocol 馃幍
at main 26 lines 879 B view raw
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.ts"; 5 6const feeds = pgTable("feeds", { 7 id: text("xata_id") 8 .primaryKey() 9 .default(sql`xata_id()`), 10 displayName: text("display_name").notNull(), 11 description: text("description"), 12 did: text("did").notNull(), 13 uri: text("uri").notNull().unique(), 14 avatar: text("avatar"), 15 userId: text("user_id") 16 .notNull() 17 .references(() => users.id), 18 xataVersion: integer("xata_version"), 19 createdAt: timestamp("xata_createdat").defaultNow().notNull(), 20 updatedAt: timestamp("xata_updatedat").defaultNow().notNull(), 21}); 22 23export type SelectFeed = InferSelectModel<typeof feeds>; 24export type InsertFeed = InferInsertModel<typeof feeds>; 25 26export default feeds;