mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
refactor(server): folder structure (#5573)
This commit is contained in:
@@ -4,7 +4,7 @@ import { Logger, Module } from '@nestjs/common';
|
||||
import { CommandFactory } from 'nest-commander';
|
||||
|
||||
import { AppModule as BusinessAppModule } from '../app';
|
||||
import { ConfigModule } from '../config';
|
||||
import { ConfigModule } from '../fundamentals/config';
|
||||
import { CreateCommand, NameQuestion } from './commands/create';
|
||||
import { RevertCommand, RunCommand } from './commands/run';
|
||||
|
||||
@@ -16,9 +16,6 @@ import { RevertCommand, RunCommand } from './commands/run';
|
||||
enableUpdateAutoMerging: false,
|
||||
},
|
||||
},
|
||||
metrics: {
|
||||
enabled: false,
|
||||
},
|
||||
}),
|
||||
BusinessAppModule,
|
||||
],
|
||||
|
||||
@@ -4,15 +4,14 @@ import { fileURLToPath } from 'node:url';
|
||||
|
||||
import { Logger } from '@nestjs/common';
|
||||
import { ModuleRef } from '@nestjs/core';
|
||||
import { PrismaClient } from '@prisma/client';
|
||||
import { Command, CommandRunner } from 'nest-commander';
|
||||
|
||||
import { PrismaService } from '../../prisma';
|
||||
|
||||
interface Migration {
|
||||
file: string;
|
||||
name: string;
|
||||
up: (db: PrismaService, injector: ModuleRef) => Promise<void>;
|
||||
down: (db: PrismaService, injector: ModuleRef) => Promise<void>;
|
||||
up: (db: PrismaClient, injector: ModuleRef) => Promise<void>;
|
||||
down: (db: PrismaClient, injector: ModuleRef) => Promise<void>;
|
||||
}
|
||||
|
||||
export async function collectMigrations(): Promise<Migration[]> {
|
||||
@@ -48,7 +47,7 @@ export async function collectMigrations(): Promise<Migration[]> {
|
||||
export class RunCommand extends CommandRunner {
|
||||
logger = new Logger(RunCommand.name);
|
||||
constructor(
|
||||
private readonly db: PrismaService,
|
||||
private readonly db: PrismaClient,
|
||||
private readonly injector: ModuleRef
|
||||
) {
|
||||
super();
|
||||
@@ -139,7 +138,7 @@ export class RevertCommand extends CommandRunner {
|
||||
logger = new Logger(RevertCommand.name);
|
||||
|
||||
constructor(
|
||||
private readonly db: PrismaService,
|
||||
private readonly db: PrismaClient,
|
||||
private readonly injector: ModuleRef
|
||||
) {
|
||||
super();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { PrismaClient } from '@prisma/client';
|
||||
import { applyUpdate, Doc, encodeStateAsUpdate } from 'yjs';
|
||||
|
||||
import { DocID } from '../../utils/doc';
|
||||
import { DocID } from '../../modules/utils/doc';
|
||||
|
||||
export class Guid1698398506533 {
|
||||
// do the migration
|
||||
|
||||
Reference in New Issue
Block a user