Use Golang Migrate on Docker Compose

Previously I setup docker compose for golang application and PostgreSQL. It can run the application and can connect to PostgreSQL. While doing basic CRUD, I found that I need a tool to migrate my database structure and seed the database for easy onboarding and development. Thus I want to use golang-migrate to do that. What Is Golang Migrate Contrary to the name, it is not a migration tool specifically created for golang development, although we can use it as a golang package in your application. This tool is a CLI tool that can be installed on Windows, Mac, and Linux. As a CLI tool, it means that no matter what language you use to code, your migration can be managed using this golang-migrate. ...

2024-05-25

Laravel 7.x Seeding

Laravel Version: 7.x(7.24) Seeding is one of my favorite tools that helps my development tremendously. This is how you could insert some(I mean whatever amount you want) records to database. Using Faker library to randomize the value, you could specify how far the randomness of your record values are. Check what Faker Provider could do and there’s additional Faker Provider Collection to step up your faking game. Just clone a project from the cloud? migrate then seed the database Think that your database values is confusing to manage? empty then reinsert data Make a new table but too lazy to populate it? just run Seeder Has migration with many tables and its a mess to seed the data? Use Seeder All with a simple CLI command. ...

2020-09-14