How to Use GitHub to Update a Database Automatically

preview_player
Показать описание

Deploying application code automatically is one thing, but did you know it's possible to automatically deploy changes to a database?

In this video, I'll introduce you to the concept of making database changes, and show you how to use GitHub Actions to read an SQL script that we create on our local database and run that same SQL script on a remote database.

Let me know in the comments below what questions, comments, or issues you have with this process and this video!

⏱ TIMESTAMPS:
00:00 - What we are doing
01:13 - Create a database
02:36 - Check in our script
04:51 - Create a YML file
08:39 - View GitHub Actions
10:13 - Update YML to connect to the database
14:37 - See the updated action
15:43 - Update YML to run SQL script
17:56 - Update SQL file

🔗 VIDEO LINKS:
Рекомендации по теме
Комментарии
Автор

Not specifically doing anything wrong, but it can definitely be risky migrating production schema like that if you don’t exactly know what you’re doing ensuring that it’s backwards compatible.

Just got in love with planetscale’s branching and schema deploy request 🥰

Alternatively there are tools you can use instead of planetscale like gh-ost (which Planetscale uses under the hood)

CanRau
Автор

Hello, what if I have multiple .sql file in that case if we just pass the folder will it run all the sql file in database

saketshetty
Автор

Hey I hope you are doing great.

I have been following the same codes and all but I keep on getting this error and been exploring the options on google but haven't got a solution.

Error: -
ERROR 2003 (HY000): Can't connect to MySQL server on '***:3306' (110)
Error: Process completed with exit code 1

What exactly wrong am I doing here? Also, I am using google cloud sql instance for mysql workbench and trying to set up a connection in the same way as you mentioned in your video.

Please help me with this. Your efforts will be highly appreciated. Thanks

satyndragautam
Автор

iam using Entity Framework Migration and i get an error in line 15 😥 could i get help please

bebehzad