mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-02 10:57:20 +00:00
20 lines
572 B
TypeScript
20 lines
572 B
TypeScript
|
|
import { MigrationInterface, QueryRunner, TableColumn } from 'typeorm';
|
||
|
|
|
||
|
|
export class addLastLoggedInToUserSession1718704694211 implements MigrationInterface {
|
||
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
||
|
|
await queryRunner.addColumn(
|
||
|
|
'user_sessions',
|
||
|
|
new TableColumn({
|
||
|
|
name: 'last_logged_in',
|
||
|
|
type: 'timestamp',
|
||
|
|
isNullable: false,
|
||
|
|
default: 'now()',
|
||
|
|
})
|
||
|
|
);
|
||
|
|
}
|
||
|
|
|
||
|
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
||
|
|
await queryRunner.dropColumn('user_sessions', 'last_logged_in');
|
||
|
|
}
|
||
|
|
}
|