Postgresql如果没有UUID-OSSP,然后创建这个UUID-OSSP扩展

版权声明:本文为Martin原创文章,未经Martin允许不得转载。 https://blog.csdn.net/qq_36279445/article/details/88389745
import { MigrationInterface, QueryRunner } from 'typeorm';

export class EnableUuid1551426026001 implements MigrationInterface {

  public async up(queryRunner: QueryRunner): Promise<any> {
    await queryRunner.query(`
        CREATE EXTENSION IF NOT EXISTS "uuid-ossp"`,
    );
  }

  public async down(queryRunner: QueryRunner): Promise<any> {
  }
}

Postgresql如果没有UUID-OSSP,然后创建这个UUID-OSSP扩展

官方文档:https://www.postgresql.org/docs/9.3/uuid-ossp.html

猜你喜欢

转载自blog.csdn.net/qq_36279445/article/details/88389745