Skip to content

Commit

Permalink
Merge pull request #8484 from ever-co/fix/resource-link-migration
Browse files Browse the repository at this point in the history
[Fix] Alter Constraints (ResourceLink Entity)
  • Loading branch information
rahul-rocket authored Oct 25, 2024
2 parents 855bf65 + d7b1d53 commit c6c0984
Show file tree
Hide file tree
Showing 3 changed files with 283 additions and 17 deletions.
3 changes: 2 additions & 1 deletion packages/core/src/database/migration-executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ function queryParams(parameters: any[] | undefined): string {
*/
function getTemplate(connection: DataSource, name: string, timestamp: number, upSqls: string[], downSqls: string[]): string {
return `
import { Logger } from '@nestjs/common';
import { MigrationInterface, QueryRunner } from "typeorm";
import { yellow } from "chalk";
import { DatabaseTypeEnum } from "@gauzy/config";
Expand All @@ -279,7 +280,7 @@ export class ${camelCase(name, true)}${timestamp} implements MigrationInterface
* @param queryRunner
*/
public async up(queryRunner: QueryRunner): Promise<void> {
console.log(yellow(this.name + ' start running!'));
Logger.debug(yellow(this.name + ' start running!'), 'Migration');
switch (queryRunner.connection.options.type) {
case DatabaseTypeEnum.sqlite:
Expand Down
Loading

0 comments on commit c6c0984

Please sign in to comment.