forked from syntaxbullet/AuroraBot-discord
feat: Initialize database and restructure application source code.
This commit is contained in:
19
src/db/schema.ts
Normal file
19
src/db/schema.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { pgTable, integer, text, timestamp, serial } from "drizzle-orm/pg-core";
|
||||
|
||||
export const users = pgTable("users", {
|
||||
userId: text("user_id").primaryKey().notNull(),
|
||||
balance: integer("balance").notNull().default(0),
|
||||
lastDaily: timestamp("last_daily"),
|
||||
dailyStreak: integer("daily_streak").notNull().default(0),
|
||||
createdAt: timestamp("created_at").defaultNow(),
|
||||
});
|
||||
|
||||
export const transactions = pgTable("transactions", {
|
||||
transactionId: serial("transaction_id").primaryKey().notNull(),
|
||||
fromUserId: text("from_user_id").references(() => users.userId),
|
||||
toUserId: text("to_user_id").references(() => users.userId),
|
||||
amount: integer("amount").notNull(),
|
||||
occuredAt: timestamp("occured_at").defaultNow(),
|
||||
type: text("type").notNull(),
|
||||
description: text("description"),
|
||||
});
|
||||
Reference in New Issue
Block a user