Skip to content

Commit

Permalink
fixed column name
Browse files Browse the repository at this point in the history
  • Loading branch information
domnikl committed Dec 12, 2023
1 parent fd9fbdd commit 7975c06
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/Models/BalanceModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default class BalanceModel extends BaseModel {
@column({ isPrimary: true })
public id: string;

@column({ serializeAs: 'bookingDate' })
@column({ columnName: 'booking_date', serializeAs: 'bookingDate' })
public bookingDate: DateTime;

@column({ columnName: 'account', serializeAs: 'accountIban' })
Expand Down
4 changes: 2 additions & 2 deletions app/Models/CategoryModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ export default class CategoryModel extends BaseModel {
@column()
public summary: string;

@column({ serializeAs: 'expectedAmount' })
@column({ columnName: 'expected_amount', serializeAs: 'expectedAmount' })
public expectedAmount: number;

@column.dateTime({ serializeAs: 'dueDate' })
@column.dateTime({ columnName: 'due_date', serializeAs: 'dueDate' })
public dueDate: null | DateTime;

@column()
Expand Down
4 changes: 2 additions & 2 deletions app/Models/PaymentModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default class PaymentModel extends BaseModel {
@column({ isPrimary: true })
public id: string;

@column.dateTime({ serializeAs: 'bookingDate' })
@column.dateTime({ columnName: 'booking_date', serializeAs: 'bookingDate' })
public bookingDate: DateTime;

@column()
Expand All @@ -18,7 +18,7 @@ export default class PaymentModel extends BaseModel {
@column()
public amount: number;

@column({ serializeAs: 'categoryId' })
@column({ columnName: 'category_id', serializeAs: 'categoryId' })
public categoryId: string;

@belongsTo(() => CategoryModel, { foreignKey: 'categoryId' })
Expand Down
2 changes: 1 addition & 1 deletion app/Models/TransactionModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default class TransactionModel extends BaseModel {
@belongsTo(() => AccountModel, { foreignKey: 'accountIban' })
public account: BelongsTo<typeof AccountModel>;

@column.dateTime({ serializeAs: 'bookingDate' })
@column.dateTime({ columnName: 'booking_date', serializeAs: 'bookingDate' })
public bookingDate: DateTime;

@column.dateTime({ autoCreate: true })
Expand Down

0 comments on commit 7975c06

Please sign in to comment.