feat: super charged albums page with people management tools

Signed-off-by: Varun Raj <varun@skcript.com>
This commit is contained in:
Varun Raj committed 2024-11-30 11:30:21 +05:30
1 parent b5bce5050c
commit 6b27686f39
28 files changed
+1004 -105

No files matched your search

+7
View File
@@ -0,0 +1,7 @@
import { pgTable, uuid, timestamp } from 'drizzle-orm/pg-core';
export const albumsAssetsAssets = pgTable('albums_assets_assets', {
albumsId: uuid('albumsId').notNull(),
assetsId: uuid('assetsId').notNull(),
createdAt: timestamp('createdAt', { withTimezone: true }).defaultNow().notNull(),
});
+16 -1
View File
@@ -4,7 +4,8 @@ import { assets } from "./assets.schema";
import { person } from "./person.schema";
import { users } from "./users.schema";
import { faceSearch } from "./faceSearch.schema";
import { albumsAssetsAssets } from "./albumAssetsAssets.schema";
import { albums } from "./albums.schema";
// Assuming there are relations to be defined with `assets` and `person`
export const assetFacesRelations = relations(assetFaces, ({ one }) => ({
asset: one(assets, {
@@ -38,3 +39,17 @@ export const faceSearchRelations = relations(faceSearch, ({ one }) => ({
references: [assetFaces.id],
}),
}));
// Assuming there are relations to be defined with `albums` and `assets`
export const albumsAssetsAssetsRelations = relations(albumsAssetsAssets, ({ one }) => ({
album: one(albums, {
fields: [albumsAssetsAssets.albumsId],
references: [albums.id],
}),
asset: one(assets, {
fields: [albumsAssetsAssets.assetsId],
references: [assets.id],
}),
}));