We continue a series of tips for a home project.

Today I wanted to write a small article, which should slightly improve your life as a developer, as well as the lives of people supporting your application. In our case, ours too :)

About the benefits of writing migrations, we will not today,

I hope everyone knows about it for a long time, today we’ll talk about how to write self-contained applications (one binary)

Let me describe a few advantages of this approach.

Why do we all love Golang? Of course for one executive file after assembly.

We try to drag everything into it, often we collect it together with static dependencies .

Migration is not an exception.

You must admit that having one binary of our service working with the database and being able to roll them with one command is great:

./myapp migrate up

Well, roll back accordingly

./myapp migrate down

Your application is just spreading. You do not need to download and install and store the dependencies of the utilities and the files of the migrations themselves separately.

Now they are all inside your application.

And to do all this is very simple.