refactor(server): separate page visibility from workspace permission (#4836)

This commit is contained in:
liuyi
2023-11-06 11:49:39 +08:00
committed by GitHub
parent e8987457ab
commit f491ff94cc
19 changed files with 796 additions and 362 deletions
@@ -3,7 +3,7 @@ import { join } from 'node:path';
import { fileURLToPath } from 'node:url';
import { Logger } from '@nestjs/common';
import { camelCase, snakeCase, upperFirst } from 'lodash-es';
import { camelCase, kebabCase, upperFirst } from 'lodash-es';
import {
Command,
CommandRunner,
@@ -45,7 +45,7 @@ export class CreateCommand extends CommandRunner {
const timestamp = Date.now();
const content = this.createScript(upperFirst(camelCase(name)) + timestamp);
const fileName = `${timestamp}-${snakeCase(name)}.ts`;
const fileName = `${timestamp}-${kebabCase(name)}.ts`;
const filePath = join(
fileURLToPath(import.meta.url),
'../../migrations',
@@ -54,6 +54,7 @@ export class CreateCommand extends CommandRunner {
this.logger.log(`Creating ${fileName}...`);
writeFileSync(filePath, content);
this.logger.log('Migration file created at', filePath);
this.logger.log('Done');
}
@@ -84,6 +84,7 @@ export class RunCommand extends CommandRunner {
done.push(migration);
} catch (e) {
this.logger.error('Failed to run data migration', e);
process.exit(1);
}
}