import { pgTable, uuid, varchar, text, integer, timestamp } from 'drizzle-orm/pg-core'; import { servers } from './servers'; export const serverDatabases = pgTable('server_databases', { id: uuid('id').defaultRandom().primaryKey(), serverId: uuid('server_id') .notNull() .references(() => servers.id, { onDelete: 'cascade' }), name: varchar('name', { length: 255 }).notNull(), databaseName: varchar('database_name', { length: 255 }).notNull().unique(), username: varchar('username', { length: 64 }).notNull().unique(), password: text('password').notNull(), host: varchar('host', { length: 255 }).notNull(), port: integer('port').notNull(), phpMyAdminUrl: text('phpmyadmin_url'), createdAt: timestamp('created_at', { withTimezone: true }).defaultNow().notNull(), updatedAt: timestamp('updated_at', { withTimezone: true }).defaultNow().notNull(), });