Skip to content

Commit

Permalink
🐛 use pgcrypto extension for uuid creation (#2977)
Browse files Browse the repository at this point in the history
  • Loading branch information
BHesseldieck authored Mar 11, 2022
1 parent eebed1a commit 55255be
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/cli/src/Db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ export async function init(
migrations: postgresMigrations,
migrationsRun: true,
migrationsTableName: `${entityPrefix}migrations`,
uuidExtension: 'pgcrypto',
ssl,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ export class CreateUserManagement1646992772331 implements MigrationInterface {
tablePrefix = schema + '.' + tablePrefix;
}

await queryRunner.query('CREATE EXTENSION IF NOT EXISTS pgcrypto;');

await queryRunner.query(
`CREATE TABLE ${tablePrefix}role (
"id" serial NOT NULL,
Expand Down
1 change: 1 addition & 0 deletions packages/cli/test/integration/shared/testDb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ export const getPostgresOptions = ({ name }: { name: string }): ConnectionOption
migrations: postgresMigrations,
migrationsRun: true,
migrationsTableName: 'migrations',
uuidExtension: 'pgcrypto',
entities: Object.values(entities),
synchronize: false,
logging: false,
Expand Down

0 comments on commit 55255be

Please sign in to comment.