source-gamepanel/packages/database/src/schema/games.ts

17 lines
853 B
TypeScript

import { pgTable, uuid, varchar, integer, text, jsonb, timestamp } from 'drizzle-orm/pg-core';
export const games = pgTable('games', {
id: uuid('id').defaultRandom().primaryKey(),
slug: varchar('slug', { length: 100 }).notNull().unique(),
name: varchar('name', { length: 255 }).notNull(),
dockerImage: text('docker_image').notNull(),
defaultPort: integer('default_port').notNull(),
configFiles: jsonb('config_files').default([]).notNull(),
automationRules: jsonb('automation_rules').default([]).notNull(),
startupCommand: text('startup_command').notNull(),
stopCommand: text('stop_command'),
environmentVars: jsonb('environment_vars').default([]).notNull(),
createdAt: timestamp('created_at', { withTimezone: true }).defaultNow().notNull(),
updatedAt: timestamp('updated_at', { withTimezone: true }).defaultNow().notNull(),
});