mirror of
https://github.com/docmost/docmost.git
synced 2026-05-17 06:44:05 +08:00
switch to nx monorepo
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
import { AppDataSource } from './typeorm.config';
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
TypeOrmModule.forRoot({
|
||||
...AppDataSource.options,
|
||||
entities: ['dist/src/**/*.entity.{ts,js}'],
|
||||
migrations: ['dist/src/**/migrations/*.{ts,js}'],
|
||||
autoLoadEntities: true,
|
||||
}),
|
||||
],
|
||||
})
|
||||
export class DatabaseModule {}
|
||||
@@ -0,0 +1,3 @@
|
||||
# don't include frequently changing migrations yet
|
||||
.gitignore
|
||||
!.gitignore
|
||||
@@ -0,0 +1,14 @@
|
||||
import { DataSource } from 'typeorm';
|
||||
import * as dotenv from 'dotenv';
|
||||
dotenv.config();
|
||||
export const AppDataSource: DataSource = new DataSource({
|
||||
type: 'postgres',
|
||||
url:
|
||||
process.env.DATABASE_URL ||
|
||||
'postgresql://postgres:password@localhost:5432/dc?schema=public',
|
||||
entities: ['src/**/*.entity.{ts,js}'],
|
||||
migrations: ['src/**/migrations/*.{ts,js}'],
|
||||
subscribers: [],
|
||||
synchronize: false,
|
||||
logging: process.env.NODE_ENV === 'development',
|
||||
});
|
||||
Reference in New Issue
Block a user