15 lines
563 B
TypeScript
15 lines
563 B
TypeScript
import { MigrationInterface, QueryRunner } from 'typeorm';
|
|
|
|
export class AddAdminUser1761581879633 implements MigrationInterface {
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
// add dev user: admin:123456
|
|
await queryRunner.query(
|
|
`insert into "user" ( username, email, password) values ('admin','admin@test.com','$2a$12$sT7bIBfUdAvCzcwyppSX/uVd4EP6ORgWiEg7jqXvMKJErR5jWhnmO');`,
|
|
);
|
|
}
|
|
|
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query("delete from user where username='admin'");
|
|
}
|
|
}
|