Skip to content

fix(courses): add currency column to Course entity to match migration - #1413

Open
sadiqabubakar826-del wants to merge 1 commit into
rinafcode:mainfrom
sadiqabubakar826-del:fix/add-currency-field-to-course-entity
Open

fix(courses): add currency column to Course entity to match migration#1413
sadiqabubakar826-del wants to merge 1 commit into
rinafcode:mainfrom
sadiqabubakar826-del:fix/add-currency-field-to-course-entity

Conversation

@sadiqabubakar826-del

Copy link
Copy Markdown
Contributor

Here's a PR description you can use:

───────────────────────────────────────────────────────────────────────────────────────────────

fix(courses): declare currency column on Course entity (#1194)

Problem

Migration 1685000001001-add-currency-field-to-courses adds a currency varchar(3) DEFAULT 'USD'
column and IDX_course_currency index to the course table, but the Course entity had no
corresponding @column declaration. This caused two issues:

Fix

Added the missing currency field to src/courses/entities/course.entity.ts:

/** ISO 4217 currency code for the course price (e.g. 'USD', 'EUR'). */
@Index('IDX_course_currency')
@column({ type: 'varchar', length: 3, nullable: true, default: 'USD' })
currency?: string;

The declaration matches the migration exactly:

  • varchar(3) length
  • nullable with DEFAULT 'USD'
  • Explicit @Index('IDX_course_currency') name so TypeORM recognises the existing index rather
    than creating a duplicate or dropping it

No migration needed — the column already exists in the database. This is an entity-only fix to
bring the ORM in sync with the schema.

Testing

  • TypeScript compilation passes
  • Drift checker will no longer flag currency for removal
  • Course objects returned from TypeORM queries will now include the currency field

Closes #1205
Closes #1204

Migration 1685000001001-add-currency-field-to-courses adds a
varchar(3) currency column with DEFAULT 'USD' and index IDX_course_currency
to the course table. Declare the matching @column and @Index on the
Course entity so TypeORM can use multi-currency pricing and the drift
checker no longer tries to drop the column (closes rinafcode#1194).
@drips-wave

drips-wave Bot commented Sep 5, 2026

Copy link
Copy Markdown

@sadiqabubakar826-del Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@RUKAYAT-CODER

Copy link
Copy Markdown
Contributor

Well done on the job done so far!
Kindly fix workflow to pass

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

course entity has no currency column but a migration adds one users entity is missing the location/currency columns migrations add

2 participants