Bug Description
The database schema file src/database/schema.ts has duplicate table definitions for four tables, plus a duplicate column definition in the users table. This causes the TypeScript compiler to fail with 127 errors, making the project completely uncompilable.
Affected Tables
The following tables are defined twice in src/database/schema.ts:
- announcements - Lines ~357-378 AND ~595-614
- courseShares - Lines ~131-157 AND ~617-641
- courseReviews - Lines ~298-327 AND ~644-667
- notifications - Lines ~331-353 AND ~670-689
Additionally, the users table (lines ~25-64) defines bannedAt twice:
- Line 43:
bannedAt: timestamp("banned_at", { withTimezone: true })
- Line 61:
bannedAt: timestamp("banned_at", { withTimezone: true })
Impact
- TypeScript compilation fails with 127 errors
- Cannot run
npm run typecheck, npm run build, or npm test
- The project is completely broken for development
Steps to Reproduce
- Run
npm install
- Run
npx tsc --noEmit -p tsconfig.test.json
- Observe 127 compilation errors
Expected Behavior
All tables should be defined exactly once in the schema file. The project should compile without errors.
Acceptance Criteria
- Remove duplicate table definitions (keep the first/most complete version of each)
- Remove duplicate
bannedAt column from users table
- Verify
npm run typecheck passes with zero errors
- Verify all imports across the codebase still resolve correctly
Severity
critical - The project cannot be compiled or tested in its current state.
Bug Description
The database schema file
src/database/schema.tshas duplicate table definitions for four tables, plus a duplicate column definition in the users table. This causes the TypeScript compiler to fail with 127 errors, making the project completely uncompilable.Affected Tables
The following tables are defined twice in
src/database/schema.ts:Additionally, the users table (lines ~25-64) defines
bannedAttwice:bannedAt: timestamp("banned_at", { withTimezone: true })bannedAt: timestamp("banned_at", { withTimezone: true })Impact
npm run typecheck,npm run build, ornpm testSteps to Reproduce
npm installnpx tsc --noEmit -p tsconfig.test.jsonExpected Behavior
All tables should be defined exactly once in the schema file. The project should compile without errors.
Acceptance Criteria
bannedAtcolumn from users tablenpm run typecheckpasses with zero errorsSeverity
critical - The project cannot be compiled or tested in its current state.