managarten/apps-archived/techbase/apps/backend/src/db/schema/comments.schema.ts
Till-JS 34c879929b chore: add techbase to apps-archived
Integrated techbase (software comparison platform) into monorepo structure:
- Created NestJS backend with votes and comments modules
- Migrated from external Supabase to own PostgreSQL
- Set up Drizzle ORM schema for votes and comments
- Created API client replacing Supabase in Astro frontend
- Added environment configuration (port 3021)

Archived immediately as it's not yet ready for active development.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 13:47:39 +01:00

17 lines
763 B
TypeScript

import { pgTable, uuid, varchar, text, boolean, timestamp } from 'drizzle-orm/pg-core';
export const comments = pgTable('comments', {
id: uuid('id').defaultRandom().primaryKey(),
softwareId: varchar('software_id', { length: 255 }).notNull(),
userName: varchar('user_name', { length: 100 }).notNull(),
comment: text('comment').notNull(),
ipHash: varchar('ip_hash', { length: 255 }).notNull(),
isApproved: boolean('is_approved').default(false),
isSpam: boolean('is_spam').default(false),
moderatedAt: timestamp('moderated_at'),
moderatedBy: varchar('moderated_by', { length: 255 }),
createdAt: timestamp('created_at').defaultNow().notNull(),
});
export type Comment = typeof comments.$inferSelect;
export type NewComment = typeof comments.$inferInsert;