Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem to run migration #25

Open
lmoraobando opened this issue May 22, 2021 · 2 comments
Open

Problem to run migration #25

lmoraobando opened this issue May 22, 2021 · 2 comments

Comments

@lmoraobando
Copy link

lmoraobando commented May 22, 2021

Hi Stefano,

I'd like to implement this backend but I get this error "Error: Cannot register a type name as a singleton without a "to" token"

when I tried to run:
yarn dev:server

do you have any solution?

Regards,

@StefanoSaffran
Copy link
Owner

Hi @lmoraobando,

It is probable a problem with your .env file.

Did you follow this step?

"Also, you have to configure the environment variables in the .env file, based on a .env.example file that is provided in the backend folder, change the variables according to your environment."

Best,

@gondfreecs
Copy link

gondfreecs commented Jul 2, 2021

U need "ormconfig.json" on your backend folder, take this sample just change user,password and database:

[
{
"name": "default",
"type": "postgres",
"host": "localhost",
"post": 5432,
"username": "postgres",
"password": "mdp",
"database": "barberbase",
"entities": [
"./src/modules//infra/typeorm/entities/.ts"
],
"migrations": [
"./src/shared/infra/typeorm/migrations/
.ts"
],
"cli": {
"migrationsDir": "./src/shared/infra/typeorm/migrations"
}
},
{
"name": "mongo",
"type": "mongodb",
"host": "localhost",
"port": 27017,
"database": "myLegendaryDatabase",
"useUnifiedTopology": true,
"entities": [
"./src/modules/
/infra/typeorm/schemas/*.ts"
]
}
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants