mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
feat: Add new migration for SchemaMigrations
This commit adds a new migration file, MigrationName1720024126646, to the SchemaMigrations directory. This migration will be used to make changes to the database schema.
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
|
||||
export class MigrationName1720024126646 implements MigrationInterface {
|
||||
public name = "MigrationName1720024126646";
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
// change type of secretValue from varchar to text
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "MonitorSecret" ALTER COLUMN "secretValue" TYPE text`,
|
||||
);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "MonitorSecret" ALTER COLUMN "secretValue" TYPE character varying(500)`,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -23,6 +23,7 @@ import { MigrationName1719827175832 } from "./1719827175832-MigrationName";
|
||||
import { MigrationName1719831213463 } from "./1719831213463-MigrationName";
|
||||
import { MigrationName1719838746775 } from "./1719838746775-MigrationName";
|
||||
import { MigrationName1719915433542 } from "./1719915433542-MigrationName";
|
||||
import { MigrationName1720024126646 } from "./1720024126646-MigrationName";
|
||||
|
||||
export default [
|
||||
InitialMigration,
|
||||
@@ -50,4 +51,5 @@ export default [
|
||||
MigrationName1719831213463,
|
||||
MigrationName1719838746775,
|
||||
MigrationName1719915433542,
|
||||
MigrationName1720024126646,
|
||||
];
|
||||
|
||||
@@ -227,7 +227,7 @@ export default class MonitorSecret extends BaseModel {
|
||||
})
|
||||
@TableColumn({
|
||||
required: false,
|
||||
type: TableColumnType.LongText,
|
||||
type: TableColumnType.VeryLongText,
|
||||
encrypted: true,
|
||||
title: "Secret Value",
|
||||
description:
|
||||
@@ -235,8 +235,7 @@ export default class MonitorSecret extends BaseModel {
|
||||
})
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: ColumnType.LongText,
|
||||
length: ColumnLength.LongText,
|
||||
type: ColumnType.VeryLongText,
|
||||
})
|
||||
public secretValue?: string = undefined;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user