forked from
rocksky.app/rocksky
A decentralized music tracking and discovery platform built on AT Protocol 馃幍
1import type { InferInsertModel, InferSelectModel } from "drizzle-orm";
2import { integer, pgTable, text, timestamp } from "drizzle-orm/pg-core";
3import albums from "./albums";
4import tracks from "./tracks";
5
6const albumTracks = pgTable("album_tracks", {
7 id: text("xata_id").primaryKey(),
8 albumId: text("album_id")
9 .notNull()
10 .references(() => albums.id),
11 trackId: text("track_id")
12 .notNull()
13 .references(() => tracks.id),
14 createdAt: timestamp("xata_createdat").defaultNow().notNull(),
15 updatedAt: timestamp("xata_updatedat").defaultNow().notNull(),
16 xataVersion: integer("xata_version").notNull(),
17});
18
19export type SelectAlbumTrack = InferSelectModel<typeof albumTracks>;
20export type InsertAlbumTrack = InferInsertModel<typeof albumTracks>;
21
22export default albumTracks;