Typeorm Migrations

  Рет қаралды 41,528

Ben Awad

Ben Awad

Күн бұрын

Пікірлер: 38
@lucasharca
@lucasharca 4 жыл бұрын
You saved my life. I was stuck with docker and typeorm migrations for a job opporunity test, and the combination of your videos just saved me. Thank you very much
@89Manux
@89Manux 5 жыл бұрын
I rarely get stuck or look for video tutorials, but I was able to make Migrations work with NestJS thanks to your video. You've earned my subscription
@bawad
@bawad 5 жыл бұрын
Awesome!
@bolarinwaowuogba3268
@bolarinwaowuogba3268 3 жыл бұрын
You just saved me a ton of stress Ben, thanks!
@MopeyFand
@MopeyFand 4 жыл бұрын
I don't understand how you initialize a database with the code first approach. I just can't find how to do this.
@sagargopale8718
@sagargopale8718 9 ай бұрын
Thank you for the video. So technically if the "up" script fails the db connection fails and app crashes, right? Is there a way we can recover the db connection if "up" script fails?
@rdvanaltun7668
@rdvanaltun7668 4 жыл бұрын
The way create to migration is same like Django. I thinks this is the best approch to use ORMs. Thanks for the video.
@salemouail627
@salemouail627 3 жыл бұрын
bring back this ben awad
@BioAbner
@BioAbner 3 жыл бұрын
How do I make sure that typeorm never erases any of my data? I lost about a day's work because of the synchronize feature and I'm scared of starting up my typeorm server again.
@OfficialSpimy
@OfficialSpimy 3 жыл бұрын
It's kinda baffling how despite the numerous of JS frameworks there are out there, there still isn't an ORM with a powerful and simple migration system as Django does
@nothingtoseehere2704
@nothingtoseehere2704 3 жыл бұрын
I mean, what about Prisma?
@attranmanh8197
@attranmanh8197 3 жыл бұрын
Can I generate a migration "create table" files by passing some entities?
@willcalltickets
@willcalltickets 6 жыл бұрын
Much more readable - thank you!
@user-viskqlkqudh
@user-viskqlkqudh 6 жыл бұрын
Thank you for nice lecture video, Ben ! But I'm having a trouble with ormconfig.json, which I divide its name property into 'dev' & 'test'. In this case, if I run the command(`npx ts-node ./node_modules/.bin/typeorm migration:generate -n Test`), it goes ERROR ( Can't find connection default ). So i've tried add NODE_ENV=dev, but it didn't work. Is there anything I can do to solve this ?
@user-viskqlkqudh
@user-viskqlkqudh 6 жыл бұрын
Sorry for excuse. There's an option for selecting a db's name by `-c` ! Solved it. Thank you.
@bawad
@bawad 6 жыл бұрын
No worries, nice find
@jonasgroendahl
@jonasgroendahl 4 жыл бұрын
can TypeORM generate all the SQL statements that will eventually create all tables based on the models?
@jsceo
@jsceo 4 жыл бұрын
typeorm migration:generate -n CreateDatabase
@samuelgunter
@samuelgunter 3 жыл бұрын
yes, just make sure when you run the generate command, your database has no tables or anything. Either move the `postgresdata` folder to somewhere else (if you want to preserve data), or just delete the `postgresdata` folder and restart postgres
@noahbartfield3610
@noahbartfield3610 4 жыл бұрын
This was a really helpful tutorial. I'm getting an Error when I try to do a migration:generate, though. Any ideas why I'd be getting 'Error: getaddrinfo ENOTFOUND database database:5432 at GetAddrInfoReqWrap.onlookup [as oncomplete]'? Thanks!
@grygoriishevchenko2196
@grygoriishevchenko2196 4 жыл бұрын
when using docker-compose I fix it with the second ormconfig.json file for cli connections where {host: 'localhost'}. example ./docker-compose.yaml .... db: image: 'mysql:5.7.10' ports: - '3306:3306' ... npm run typeorm migration:generate -- -n User -f ormconfig_2.json
@dawid_dahl
@dawid_dahl 4 жыл бұрын
Such a great feature. Thank you!
@leojkwan
@leojkwan 6 жыл бұрын
dude you saved me like 3 hours of digging, I've been stuck on why my migration commands would throw `function(exports, require, __filename).... Thanks for this tut Ben How did you figure this out?
@bawad
@bawad 6 жыл бұрын
glad it was helpful, I can't remember how I figured that out
@GraxS
@GraxS 5 жыл бұрын
Hey what utility do you use for command tips
@bawad
@bawad 5 жыл бұрын
fish shell
@faiwi9646
@faiwi9646 3 жыл бұрын
It's for how to alter table I am searching for how to create new tables.
@dennistennis5622
@dennistennis5622 6 жыл бұрын
Realy Nice video Ben! Thanks! Going to use it for sure.
@vladimirjean
@vladimirjean 5 жыл бұрын
Great video... Although, I'm getting this error *Error during migration run {password authentication failed for user "", routine: 'auth_failed"} . Can you please help me?
@bawad
@bawad 5 жыл бұрын
did you set a password in your ormconfig.json
@vladimirjean
@vladimirjean 5 жыл бұрын
@@bawadyes I did, I'm still doing some research on a fix, thanks for your quick reply
@RaghavendraGowda7
@RaghavendraGowda7 5 жыл бұрын
I see it doesnt work for one to one relation?
@bawad
@bawad 5 жыл бұрын
I'm not sure
@TheDoktorot
@TheDoktorot 2 жыл бұрын
Migrations do not work with .env file. Its a dealbreaker
@dennistennis5622
@dennistennis5622 6 жыл бұрын
Hi Ben , have you used some kind of clustering in your node apps? Something like this: github.com/gottsohn/multi-core-node-js-example/blob/master/index.js
@bawad
@bawad 6 жыл бұрын
I haven't. Usually I replicate the docker container
@dennistennis5622
@dennistennis5622 6 жыл бұрын
Ben Awad I understand. I am using heroku, so no docket there. Thanks!
@bawad
@bawad 6 жыл бұрын
Oh I see
How to set cookies with GraphQL
9:02
Ben Awad
Рет қаралды 24 М.
The Hidden Cost Of GraphQL And NodeJS
28:35
ThePrimeTime
Рет қаралды 203 М.
UFC 310 : Рахмонов VS Мачадо Гэрри
05:00
Setanta Sports UFC
Рет қаралды 1,2 МЛН
CRUD Operations on Multiple Tables - TypeORM
14:34
Ben Awad
Рет қаралды 50 М.
We Don't Need Migrations Anymore
6:21
Theo - t3․gg
Рет қаралды 62 М.
Creating a TypeORM Entity - Part 1
15:42
Ben Awad
Рет қаралды 25 М.
How to Roll Your Own Auth
13:05
Ben Awad
Рет қаралды 126 М.
The Biggest React Framework You've Never Heard of
20:29
Theo - t3․gg
Рет қаралды 50 М.
Codegen: The good, the bad and the ugly
6:37
Matt Pocock
Рет қаралды 32 М.
Learn Just Enough Fastify to be Productive
29:47
TomDoesTech
Рет қаралды 23 М.