Move to drizzle

This commit is contained in:
2024-11-14 12:57:24 +00:00
parent 3c1a277b37
commit 1e975f56b6
10 changed files with 1352 additions and 945 deletions

22
src/db/schema/photo.ts Normal file
View File

@@ -0,0 +1,22 @@
import { int, sqliteTable, text, blob, real } from "drizzle-orm/sqlite-core";
export const photosTable = sqliteTable(
"photo",
{
id: int().primaryKey({ autoIncrement: true }),
src: text().notNull().unique(),
width: int().notNull(),
height: int().notNull(),
blur: blob().notNull(),
camera: text(),
title: text(),
description: text(),
exposureBiasValue: int(),
fNumber: real(),
isoSpeedRatings: int(),
focalLength: int(),
dateTimeOriginal: int({ mode: 'timestamp' }),
lensModel: text(),
}
);