-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.ts
23 lines (20 loc) · 956 Bytes
/
schema.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// import { sql, } from "drizzle-orm";
import {sqliteTable, text, integer, real,} from "drizzle-orm/sqlite-core";
export const TransactionTypes = sqliteTable('TransactionType',{
transactionName: text('transactionName').notNull().unique(),
id: text('id').notNull().primaryKey(),
});
export const Categories = sqliteTable('Categories',{
categoryName: text('categoryName').notNull().unique(),
id: text('id').notNull().primaryKey(),
transactionType: text('transactionType').references(() => TransactionTypes.id),
});
export const TransactionLists = sqliteTable('TransactionLists',{
description: text('description'),
amount: integer('amount').notNull(),
createdDate: real('createdDate').notNull(),
modifiedDate: real('modifiedDate').notNull(),
id: text('id').notNull().primaryKey(),
categoryType: text('categoryType').references(() => Categories.id),
transactionType: text('transactionType').references(() => TransactionTypes.id),
});