vokabeltraining/api/src/db/schema.ts

31 lines
784 B
TypeScript

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').notNull(),
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;