nx workspace + nest.js + drizzle

This commit is contained in:
2025-01-17 12:12:58 +00:00
parent 303ba7c4b2
commit ab17db9078
25 changed files with 11468 additions and 281 deletions

30
api/src/db/schema.ts Normal file
View File

@@ -0,0 +1,30 @@
import { sqliteTable as table, text, integer, real } from 'drizzle-orm/sqlite-core';
import * as t from "drizzle-orm/sqlite-core";
export const Deck = table('Deck', {
id: integer('id').primaryKey({ autoIncrement: true }),
deckname: text('deckname'),
bildname: text('bildname'),
bildid: text('bildid'),
iconindex: integer('iconindex'),
x1: real('x1'),
x2: real('x2'),
y1: real('y1'),
y2: real('y2'),
due: integer('due'),
ivl: real('ivl'),
factor: real('factor'),
reps: integer('reps'),
lapses: integer('lapses'),
isGraduated: integer('isGraduated'),
},
(table) => {
return {
index: t.uniqueIndex("email_idx").on(table.id),
};
}
);
export type InsertDeck = typeof Deck.$inferInsert;
export type SelectDeck = typeof Deck.$inferSelect;