Saved for myself 12:19 Start talking about Migration 19:09 Migrations script
@amitavroydev Жыл бұрын
Interesting
@debadipti2 жыл бұрын
You saved me from a lot of pain since ages!! Thank you !
@amitavroydev2 жыл бұрын
Glad I could help!
@mariemmatri8743 Жыл бұрын
Thank you so much! I also liked how you figured out the issues in the video without cutting the video
@amitavroydev Жыл бұрын
Thanks
@CaminoConDiego Жыл бұрын
Dude! Thanks a lot seriously! This video must be at Nestjs and Typeform docs!!! Can not believe that I almost lost the day trying to find a way to create my migration
@amitavroydev Жыл бұрын
Good to know it helped you
@serbanzidaru9438 ай бұрын
Thank you for this. I spent 3 hours on the official nestjs course and wasn't able to run the migrations. With your video literally 15 minutes and it works perfect. Life saver.
@amitavroydev8 ай бұрын
That's great to head. Thanks for the comment
@MrDiGrayMan Жыл бұрын
I've spent hours reading nest js and typeorm docs, and finaly found this video. Eveything works perfect, thank you!
@amitavroydev Жыл бұрын
Great to know it helped you
@nealfarrand12462 жыл бұрын
This was very helpful. Thanks for putting this together. It was very clear to understand.
@amitavroydev2 жыл бұрын
Great to hear!
@angeloem83 Жыл бұрын
No amount of words can explain how thankful I am. Umetisha chief...
@amitavroydev Жыл бұрын
Thank you so much 🙏
@joaovitor-mc5co Жыл бұрын
Thanks for the explanation, this perfectly resolve my problem with migrations in the TypeORM.
@amitavroydev Жыл бұрын
Good to know
@khaledali777 Жыл бұрын
I have been struggling to make it happen. You made my day. 👍
@amitavroydev Жыл бұрын
Glad I could help
@YonatanVigilioUsa2 жыл бұрын
No changes in database schema were found - cannot generate a migration. To create a new empty migration use "typeorm migration:create" command.
@amitavroydev2 жыл бұрын
OK
@rjaysharma3097 Жыл бұрын
I getting the same issue. Are you able to solve it?
@victorm9131 Жыл бұрын
Extremely helpful video. Thanks a lot!
@amitavroydev Жыл бұрын
You are welcome my friend
@ebukaokoye52862 жыл бұрын
Thanks a lot, i have been running around looking for a solution to my migration bugs and you helped me fix them, i appreciate.
@amitavroydev2 жыл бұрын
Glad I could help
@MayabiLinux9 ай бұрын
How do I load the data source , and typeOrmModule.forRoot from same .env file ? anyone has any idea or can give me some hints please ? Thanks
@amitavroydev8 ай бұрын
Haven't tried that yet
@EzequielBinker Жыл бұрын
"No changes in database schema were found - cannot generate a migration" issue. Did anyone solve this ? I'm using typeorm 0.3. Thanks
@amitavroydev Жыл бұрын
This reply from Yaseen shaik might work 1. Stop all the executions. 2. delete the generated sql file. 3. do "npm run start:dev" or "yarn start:dev" 4. Open another terminal in the root directory 5. and enter the migration:generate command as shown in the video. Hope this solve your issue.
@amerhamed17297 ай бұрын
Hi sir I don't know why but when i try to run the second command of migration generate it give me to create an other tables not Alter
@amitavroydev7 ай бұрын
Look at the migration table. Do you already have entries
@amerhamed17297 ай бұрын
@@amitavroydev yes share the code please
@golu8045 Жыл бұрын
Hello sir, can you share a github repo link of this code? because I am getting an error "No changes in database schema were found - cannot generate a migration. To create a new empty migration use "typeorm migration:create" command" or please make a video how to solve this issue
@amitavroydev Жыл бұрын
I don't have a Github repo for just this video
@davisperezguzman3384 Жыл бұрын
could you solve it? I sell the same
@golu8045 Жыл бұрын
@@davisperezguzman3384 if you are using typeorm@0.3.12 then downgrade the version because it is a bug of typeorm for windows laptops.
@sarunmrzn Жыл бұрын
Can you inject the config service to datasource for env vars? I can only get it working with dotenv package, it'd be nice if there was a workaround by using config service itself
@amitavroydev Жыл бұрын
Still couldn't make it happen
@nucleus8706 Жыл бұрын
How did you do it with dotenv?
@okekunleoluwatobiloba91842 жыл бұрын
i'll be honest with you, ATM, you are my GOAT!!!!!!!!!
@amitavroydev2 жыл бұрын
Thank you so much
@vladislavderkach2647 Жыл бұрын
Thank you, bro. It was very helpful!
@amitavroydev Жыл бұрын
Glad it helped!
@rafaeldossantostiburcio5092 жыл бұрын
Great video, congratulations
@amitavroydev2 жыл бұрын
Thank you!
@iamabhirupdatta Жыл бұрын
Hey, i am having issues when doing this in a express-ts project without nextjs. I have a src folder which contains ts files and a dist folder which output js files in same name as ts except with .js extension. Everything is working except the migrations commands. "start": "cross-env NODE_ENV=dev node dist/server.js", "typeorm": "npm run start && ts-node ./node_modules/typeorm/cli", "typeorm:generate-migration:win": "npm run typeorm -- -d ./src/api/database/initialize.ts migration:generate ./dist/api/database/migrations/FirstMigration" The commands run but the migration file doesnot generate. Please help
@amitavroydev Жыл бұрын
Hmm, I haven't looked at the integration of TypeORM with Express yet. However, tell me one thing - does it work properly if sync is set to true?
@jesuscordoba1117 Жыл бұрын
Thank you very much, very useful and worked perfectly.
@amitavroydev Жыл бұрын
Glad it helped
@sagargopale87189 ай бұрын
I do not get DataSourceOptions in typeorm module. What version are you using for @nestjs/typeorm and typeorm?
@amitavroydev9 ай бұрын
I am using 0.3
@jaganath15 Жыл бұрын
Thanks❤, it's working like a charm
@amitavroydev Жыл бұрын
Welcome 😊
@vijayendralolla Жыл бұрын
Your videos are Great. One request is to make another series for writing tests using jest (for this Quiz project)
@amitavroydev Жыл бұрын
will try
@kassimolawale42234 күн бұрын
Thank you I was able to fix my issue with migration
@amitavroydevКүн бұрын
That's good to know.
@nicolagabriel8520 Жыл бұрын
How about if i want to use config service for env when creating a datasource?
@amitavroydev Жыл бұрын
Need to try that
@adesegunadebayo Жыл бұрын
I have been pulling my hair with the breaking changes from typeorm >= 0.3 versions, I'll update this thread if it comes out successful!
@amitavroydev Жыл бұрын
I am trying to do the same. Some issue with typeorm and nestjs configuration
@Айдер-т5з2 жыл бұрын
This is a great guide. I spent a lot of time setting up migrations. like, share, subscribe
@amitavroydev2 жыл бұрын
Thanks my friend
@romanpredein Жыл бұрын
I spent three days with the documentation to no avail. I should have gone here first. Thanks!!!
@amitavroydev Жыл бұрын
Thanks for the comment. Do subscribe if you’re not already a subscriber 🙏
@shalandichannel Жыл бұрын
do you why i might get this error: Error during migration generation: TypeError at Reflect.getMetadat sounds familiar ?
@shalandichannel Жыл бұрын
i am using version 0.3 of typeorm
@amitavroydev Жыл бұрын
Well I am not getting that error Could be some configuration issue
@amitavroydev Жыл бұрын
What node version are you on
@saif_haq_ Жыл бұрын
"No changes in database schema were found - cannot generate a migration. To create a new empty migration use "typeorm migration:create" command" Please tell how to solve this.......... the only difference in my code is that i'm using Postgres and i've used graphql instead of rest api
@amitavroydev Жыл бұрын
This solution by YaseenShaik might work 1. Stop all the executions. 2. delete the generated sql file. 3. do "npm run start:dev" or "yarn start:dev" 4. Open another terminal in the root directory 5. and enter the migration:generate command as shown in the video. Hope this solve your issue.
@JoeJoseph7910 ай бұрын
How do I implement seeding here
@amitavroydev10 ай бұрын
Any problem with the original video that I have created on Seeder?
@nucleus87062 жыл бұрын
if you encounter cannot find ./app.controller - something is wrong in your dist file. I ran prebuilt command to generate dist folder and it worked.
@amitavroydev2 жыл бұрын
Thanks for the help buddy
@nucleus87062 жыл бұрын
@@amitavroydev I must thank you. Your video made things more clear that I was struggling with. How do you load env credentials in datasource with config service?
@souleymanetoure670 Жыл бұрын
You are amazing !
@amitavroydev Жыл бұрын
Thank you
@youwontbelievewhathappensnext22 күн бұрын
Splendid thank you
@amitavroydev20 күн бұрын
Thanks 👍
@ongo9977 Жыл бұрын
how to read database config from env file
@amitavroydev Жыл бұрын
There is already a video in this series where I have done that. You can check that.
@ongo9977 Жыл бұрын
@@amitavroydev tks you
@avivlevinson6245 Жыл бұрын
Thank you very much! In the newer versions of TypeORM, the @EntityRepository() decorator has been deprecated. any idea how to solve that ?
@amitavroydev Жыл бұрын
Normal queries I guess. Haven't checked in details yet
@islamicworld5086 Жыл бұрын
Excellent work
@amitavroydev Жыл бұрын
Many thanks
@TheTomislavb2 жыл бұрын
Great video, thank you
@amitavroydev2 жыл бұрын
You are welcome!
@orjiemmanuel1418 Жыл бұрын
Thank you so much for this video, mine was able to generate the migration file after a created a new entity that wasn't in the database but when I run migration:run command I get "No Migrations are pending"
@orjiemmanuel1418 Жыл бұрын
I made some adjustment in my data-source file and it worked just fine!
@amitavroydev Жыл бұрын
Good to know it finally worked
@shivam.gupta2510 ай бұрын
@@orjiemmanuel1418 what adjustments did you made
@eunjikim2u2 жыл бұрын
You saved me too!!! Thank you so much! You are genius!!! LOL
@amitavroydev2 жыл бұрын
Glad I could help!
@malamhari_2 жыл бұрын
Thanks, it helps me a lot
@amitavroydev2 жыл бұрын
Glad to hear that!
@code-island Жыл бұрын
Very Good Content
@amitavroydev Жыл бұрын
Thank you 🙏
@spoodermen2530 Жыл бұрын
thanks! worked well for me.
@amitavroydev Жыл бұрын
Glad it helped
@zayyanabdillah70314 ай бұрын
is it mandatory to create datasource in root level?
@amitavroydev4 ай бұрын
Not necessary.
@orkhanmammadli17 ай бұрын
thanks a lot for your effort 👍
@amitavroydev7 ай бұрын
You are welcome
@somebody-175468 ай бұрын
Where i can get code ?
@amitavroydev8 ай бұрын
This is an isolated video. You can follow the video to get the code. However, the entire series code can be found here: my-lnk.com/2188012324
@_vlmdr Жыл бұрын
Help me a lot! Thanks man
@amitavroydev Жыл бұрын
Happy to help!
@goikarBaab Жыл бұрын
@Amitav Roy I am getting an error, when i run the migrations. It says there are no migrations to run, even though there are pending scripts in the DB. Can you please share the repo link for this codebase
@amitavroydev Жыл бұрын
Hi ivo costa, I don't have a repo just for this video because I started from the installation. Let me see, if I can work on a series and create a Repo like I have done for the older NestJs project.
@yuliakhitrukhina9 ай бұрын
Nice, thanks!
@amitavroydev9 ай бұрын
Welcome
@djaos-8326 Жыл бұрын
This work for postgresql?
@amitavroydev Жыл бұрын
haven't tried. but typeorm does work with pgsql, so I am assuming it should
@olgabaeva727 Жыл бұрын
+1 for the "No changes in database schema were found - cannot generate a migration. To create a new empty migration use "typeorm migration:create" command" error ((
@yaseenshaik103 Жыл бұрын
1. Stop all the executions. 2. delete the generated sql file. 3. do "npm run start:dev" or "yarn start:dev" 4. Open another terminal in the root directory 5. and enter the migration:generate command as shown in the video. Hope this solve your issue.
@amitavroydev Жыл бұрын
Hope the solution worked
@amitavroydev Жыл бұрын
Thanks for the help
@islamicworld5086 Жыл бұрын
God bless u sir
@amitavroydev Жыл бұрын
Thank you 🙏
@Katie-hb8iq Жыл бұрын
Why on earth would they change this and not update their documentation? They just say, "Make sure to create a database config file and give it the path" and that's gotta be as vague as humanly possible.
@amitavroydev Жыл бұрын
IDK
@matheusrehbein4234 Жыл бұрын
nice thanks... please add in the playlist
@amitavroydev Жыл бұрын
Added
@rudeadyet1992 Жыл бұрын
Thanks very useful. Also, what about Seeding? Is it the same as of you old tutorial.
@amitavroydev Жыл бұрын
Yes, it is
@sargonfromazupiranu65445 ай бұрын
Grate video! But how to insert default data?
@amitavroydev5 ай бұрын
You need to use seeders
@yaumiadz Жыл бұрын
thx, it's useful af. like it
@amitavroydev Жыл бұрын
Glad it helped
@cesarkohl Жыл бұрын
TYVM!
@amitavroydev Жыл бұрын
YAW
@Fill-c6j9 ай бұрын
Thank you! solve my problem
@amitavroydev9 ай бұрын
Glad that it worked
@Nageswararao932 жыл бұрын
Thank you so much for the great video. Can you please do a video on how to run migrations(refersh database) for e2e testing?
@amitavroydev2 жыл бұрын
Will try to first learn myself :)
@liammax7289 Жыл бұрын
Can you givr us a tutorial for the new seeding please ?
@amitavroydev Жыл бұрын
Oh, I haven’t played with nestjs recently. Have been completely busy with the amazing stuff that has come up in the laravel ecosystem. Will check and try to do one video
@sriharsha186 Жыл бұрын
Everyone who gets this warning:'No changes in database schema were found - cannot generate a migration. To create a new empty migration use "typeorm migration:create" command' - This is either because you did not have Entity() decorator or because the table already exists in the DB. Remember, in the video, the table was first deleted before the command to run migrations was run
@amitavroydev Жыл бұрын
Thanks 👍
@ArkojeetMukherjee Жыл бұрын
I dropped all my tables, still I have this message.
@ArkojeetMukherjee Жыл бұрын
I have the @Entity() decorator, but still nothing.
@ArkojeetMukherjee Жыл бұрын
Never mind, I solved it thanks I missed one part of it
@CaminoConDiego Жыл бұрын
this happened to me, take a look on your entities: ['dist/**/*.entity.js'], migrations: ['dist/db/migrations/*.js'], keys at dataSourceOptions object. it must look like the example
@alphaprimeacademy4742 жыл бұрын
very helpful video
@amitavroydev2 жыл бұрын
Glad it was helpful!
@the0FFH Жыл бұрын
Thanks!!
@amitavroydev Жыл бұрын
Welcome
@ManojRai-k2x Жыл бұрын
Very Helpful. What is the exact version of typeorm you are using in this video?
@amitavroydev Жыл бұрын
0.3
@sadamhussain50092 жыл бұрын
Great Video We are facing No changes in database schema were found - cannot generate a migration. To create a new empty migration use "typeorm migration:create" command
@amitavroydev2 жыл бұрын
What the scenario? Ideally it would detect change by default if actually there is a change
@eduardokiriakos6255 Жыл бұрын
I got the same! Did you fix it?
@nicolassavenay4602 Жыл бұрын
@@eduardokiriakos6255 You can try to import migrations files as module (import { migrationName} from './path/to/migrationName';) and use it in the migrations array of dataSourceOptions: migrations: [migrationName]
@eduardokiriakos6255 Жыл бұрын
@@nicolassavenay4602 I did it that way and it works! Thanks! But I would like to find a better way to do it :(
@yaseenshaik103 Жыл бұрын
1. Stop all the executions. 2. delete the generated sql file. 3. do "npm run start:dev" or "yarn start:dev" 4. Open another terminal in the root directory 5. and enter the migration:generate command as shown in the video. Hope this solve your issue.
@aurelinemotouom6202 жыл бұрын
you saved me , A video of seeders please
@amitavroydev2 жыл бұрын
Yes, that's in the pipeline. Have been working on the Electron series so got delayed. Will try to come up with that soon
@killxflip8547 Жыл бұрын
Everyone who gets this warning:'No changes in database schema were found - cannot generate a migration. To create a new empty migration use "typeorm migration:create" command', add the @Entity() docorator to your entity class
@amitavroydev Жыл бұрын
Thanks 🙏
@defaultName-gw1vgАй бұрын
thank you
@amitavroydevАй бұрын
You're welcome
@crescini.adrian Жыл бұрын
Crack +10
@amitavroydev Жыл бұрын
Thanks
@ICOReviewtoken Жыл бұрын
please give me source github bro
@amitavroydev Жыл бұрын
I don’t have code for just this video. You can refer to the main series. You will find the github code
@islamicworld5086 Жыл бұрын
Thanks
@amitavroydev Жыл бұрын
Welcome
@javierrenteria3195 Жыл бұрын
can you share us the repo? thanks
@amitavroydev Жыл бұрын
The main series n Nest has a repo. For this particular video, I have not created a separate repo