A decentralized music tracking and discovery platform built on AT Protocol 馃幍
at fix/spotify 20 lines 792 B view raw
1import type { InferInsertModel, InferSelectModel } from "drizzle-orm"; 2import { integer, pgTable, text, timestamp } from "drizzle-orm/pg-core"; 3import users from "./users"; 4 5const spotifyTokens = pgTable("spotify_tokens", { 6 id: text("xata_id").primaryKey(), 7 xataVersion: integer("xata_version").notNull(), 8 accessToken: text("access_token").notNull(), 9 refreshToken: text("refresh_token").notNull(), 10 userId: text("user_id") 11 .notNull() 12 .references(() => users.id), 13 createdAt: timestamp("xata_createdat").defaultNow().notNull(), 14 updatedAt: timestamp("xata_updatedat").defaultNow().notNull(), 15}); 16 17export type SelectSpotifyToken = InferSelectModel<typeof spotifyTokens>; 18export type InsertSpotifyToken = InferInsertModel<typeof spotifyTokens>; 19 20export default spotifyTokens;