migrated from sqlite to postgres
This commit is contained in:
parent
6600745072
commit
8e7016d15c
5 changed files with 341 additions and 64 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import { Module } from '@nestjs/common';
|
||||
import { AppController } from './app.controller';
|
||||
import { TypeOrmModule, TypeOrmModuleOptions } from '@nestjs/typeorm';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
import { MerchantsModule } from './merchants/merchants.module';
|
||||
import { Merchant } from './merchants/entities/merchant.entity';
|
||||
import { TagsModule } from './tags/tags.module';
|
||||
|
|
@ -12,18 +12,18 @@ import { SubCategory } from './sub-categories/entities/sub-category.entity';
|
|||
import { ExpensesModule } from './expenses/expenses.module';
|
||||
import { Expense } from './expenses/entities/expense.entity';
|
||||
|
||||
const entities = [Merchant, Tag, Category, SubCategory, Expense];
|
||||
|
||||
const sqliteConfig: TypeOrmModuleOptions = {
|
||||
synchronize: true,
|
||||
type: 'sqlite',
|
||||
database: 'common-cents.db',
|
||||
entities
|
||||
}
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
TypeOrmModule.forRoot(sqliteConfig),
|
||||
TypeOrmModule.forRoot({
|
||||
synchronize: true,
|
||||
type: 'postgres',
|
||||
host: 'localhost',
|
||||
port: 5432,
|
||||
username: 'common-cents',
|
||||
password: 'CommonCents_123!',
|
||||
database: 'common-cents',
|
||||
entities: [Merchant, Tag, Category, SubCategory, Expense]
|
||||
}),
|
||||
MerchantsModule,
|
||||
TagsModule,
|
||||
CategoriesModule,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue