1672223738686-add_authenticators.ts 835 B

123456789101112131415
  1. import { MigrationInterface, QueryRunner } from 'typeorm'
  2. export class addAuthenticators1672223738686 implements MigrationInterface {
  3. name = 'addAuthenticators1672223738686'
  4. public async up(queryRunner: QueryRunner): Promise<void> {
  5. await queryRunner.query(
  6. 'CREATE TABLE `authenticators` (`uuid` varchar(36) NOT NULL, `user_uuid` varchar(36) NOT NULL, `credential_id` varbinary(1024) NOT NULL, `credential_public_key` blob NOT NULL, `counter` bigint NOT NULL, `credential_device_type` varchar(32) NOT NULL, `credential_backed_up` tinyint NOT NULL, `transports` varchar(255) NULL, `created_at` bigint NOT NULL, `updated_at` bigint NOT NULL, PRIMARY KEY (`uuid`)) ENGINE=InnoDB',
  7. )
  8. }
  9. public async down(queryRunner: QueryRunner): Promise<void> {
  10. await queryRunner.query('DROP TABLE `authentticators`')
  11. }
  12. }