nx workspace + nest.js + drizzle
This commit is contained in:
30
api/src/db/schema.ts
Normal file
30
api/src/db/schema.ts
Normal 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;
|
||||
|
||||
Reference in New Issue
Block a user