Skip to content

Fix duplicate table definitions in schema.ts causing 127 TypeScript compilation errors #509

Description

@DeFiVC

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:

  1. announcements - Lines ~357-378 AND ~595-614
  2. courseShares - Lines ~131-157 AND ~617-641
  3. courseReviews - Lines ~298-327 AND ~644-667
  4. 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

  1. Run npm install
  2. Run npx tsc --noEmit -p tsconfig.test.json
  3. 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programbugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions