Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add importDate to donation entity #1263

Merged
merged 2 commits into from
Jan 23, 2024

Conversation

mohammadranjbarz
Copy link
Collaborator

No description provided.

src/repositories/donationRepository.ts Show resolved Hide resolved
@@ -110,7 +110,7 @@ export const createBackupDonation = async (
safeTransactionId,
);
const donation = (await findDonationById(Number(donationId))) as Donation;
donation!.createdAt = getCreatedAtFromMongoObjectId(donationData._id);
donation!.importDate = getCreatedAtFromMongoObjectId(donationData._id);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep it as it is, just add a line after and set the importDate to now.

@@ -49,7 +49,7 @@ function createBackupDonationTestCases() {
assert.equal(donation.status, DONATION_STATUS.PENDING);

// should use input createdAt not now time
assert.equal(donation.createdAt.getTime(), 1705577862000);
assert.equal(donation.importDate.getTime(), 1705577862000);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, don't change this as well.

export class addImportDateToDonationEntity1706012712969 implements MigrationInterface {

public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "donation" ADD COLUMN "importDate" TIMESTAMP WITH TIME ZONE`);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
await queryRunner.query(`ALTER TABLE "donation" ADD COLUMN "importDate" TIMESTAMP WITH TIME ZONE`);
await queryRunner.query(`ALTER TABLE "donation" ADD COLUMN IF NOT EXISTS "importDate" TIMESTAMP WITH TIME ZONE`);

@aminlatifi aminlatifi merged commit a0534d0 into staging Jan 23, 2024
3 checks passed
@aminlatifi aminlatifi deleted the import_failed_donation_add_import_date branch January 23, 2024 13:01
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.

2 participants