feat: initial commit

This commit is contained in:
devilreef 2025-11-21 19:04:14 +06:00
commit e54dee08c8
29 changed files with 4857 additions and 0 deletions

View file

@ -0,0 +1,20 @@
import { sql } from 'drizzle-orm'
import { bigint, pgTable, timestamp, uuid, varchar } from 'drizzle-orm/pg-core'
export const roleSchema = pgTable('roles', {
id: uuid('id').primaryKey().defaultRandom(),
slug: varchar('slug', { length: 32 }).notNull(),
aliases: varchar('aliases', { length: 32 }).array().notNull().default([]),
chatId: bigint('chat_id', { mode: 'number' }).notNull(),
createdAt: timestamp('created_at').notNull().defaultNow(),
updatedAt: timestamp('updated_at').notNull().defaultNow().$onUpdate(() => sql`now()`),
})
export const roleMembersSchema = pgTable('role_members', {
id: uuid('id').primaryKey().defaultRandom(),
roleId: uuid('role_id').references(() => roleSchema.id),
userId: bigint('user_id', { mode: 'number' }).notNull(),
createdAt: timestamp('created_at').notNull().defaultNow(),
})