Git Product home page Git Product logo

Comments (6)

 avatar commented on July 19, 2024

Remember that, according the answer, it will be a prod db connection with sqlite (or mongodb)..

``
const defaultOptions = {
type: 'postgres',
port: 5432,
username: 'user',
password: 'password',
database: 'db',
synchronize: true,
};

@module({
imports: [
TypeOrmModule.forRoot({
...defaultOptions,
host: 'photo_db_host',
entities: [Photo],
})
``
So, according the environment (dev or prod), the connection must be changed. Please attention that in dev mode there is always the sqlite db.

from generator-jhipster-nodejs.

 avatar commented on July 19, 2024

The issue is not more an optional, because we have to provide a migration with typeORM for scripts in dev mode running for sqlite

from generator-jhipster-nodejs.

 avatar commented on July 19, 2024

Consider feature/migration-db and this src/ormconfig.ts:

import { ConnectionOptions } from 'typeorm'; const config: ConnectionOptions = {  type: 'postgres',  host: process.env.POSTGRES_HOST,  port: Number(process.env.POSTGRES_PORT),  username: process.env.POSTGRES_USER,  password: process.env.POSTGRES_PASSWORD,  database: process.env.POSTGRES_DB,  entities: [    __dirname + '/../**/*.entity{.ts,.js}',  ],  cli: {    migrationsDir: 'src/migrations',  }}; export = config;

from generator-jhipster-nodejs.

deepu105 avatar deepu105 commented on July 19, 2024

from generator-jhipster-nodejs.

 avatar commented on July 19, 2024

Hi @deepu105,
now for this blueprint, in the server generator there are only two questions: serverPort and mongoProdDatabase . The other prompts questions for the server generation are been delated, because in this blueprint they haven't sense to be due to their java spring meaning. So if you answer to yes for the mongoProdDatabase there will generated the config for this, otherwise the sqlite is the default. So be sure that there aren't other database questions. For this I have renamed the issue. If it is not clear, feel free to ask me.

from generator-jhipster-nodejs.

deepu105 avatar deepu105 commented on July 19, 2024

from generator-jhipster-nodejs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.