-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Fix customer creation workflow [DEV-4287] (#574)
* fix: Fix customer creation workflow * fix swagger * Generate migrations * Add error handler for webhooks * fix subscription create workflow * Remove subscription-submitter * Improve error handling * fix: Account create validator * Remove duplicate stripe initialization * fix issues --------- Co-authored-by: Ankur Banerjee <[email protected]>
- Loading branch information
1 parent
c85f31a
commit 6e1ca72
Showing
13 changed files
with
466 additions
and
451 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { MigrationInterface, QueryRunner, TableColumn, TableUnique } from 'typeorm'; | ||
|
||
export class AlterCustomerTableUpdateEmail1695740346006 implements MigrationInterface { | ||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
const tableName = 'customer'; | ||
|
||
// Make the email column NOT NULL | ||
await queryRunner.changeColumn( | ||
tableName, | ||
'email', | ||
new TableColumn({ | ||
name: 'email', | ||
type: 'text', | ||
isNullable: false, // Set the column as NOT NULL | ||
}) | ||
); | ||
|
||
// Add a unique constraint to the email column | ||
await queryRunner.createUniqueConstraint( | ||
tableName, | ||
new TableUnique({ | ||
name: 'UQ_customer_email', | ||
columnNames: ['email'], | ||
}) | ||
); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
const tableName = 'customer'; | ||
|
||
// Remove the unique constraint | ||
await queryRunner.dropUniqueConstraint(tableName, 'UQ_customer_email'); | ||
|
||
// Revert the email column back to nullable | ||
await queryRunner.changeColumn( | ||
tableName, | ||
'email', | ||
new TableColumn({ | ||
name: 'email', | ||
type: 'text', | ||
isNullable: true, // Revert to nullable | ||
}) | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.