Skip to content
Mikaela Caron
Go back

Building in Public - Expense Tracker 04: Creating Migrations with Vapor

I’m building an expense tracker app, and live streaming the whole process! This blog series is a written form of each livestream.

See all the previous posts.

FINALLY SOME CODING! 😍

Finally creating the Vapor project, named ExpenseTrackerKit. I go through some basics on how Vapor works, and using Postman, Docker, and DBeaver, to test everything locally.

I started creating the migrations for the different tables. I had to reference the Vapor docs pretty frequently to properly make the primary and foreign key relationships.

Migrations are like a version control system for your database. Each migration defines a change to the database and how to undo it. By modifying your database through migrations, you create a consistent, testable, and shareable way to evolve your databases over time.

Vapor docs - Migrations

I created migrations for:

I ended up changing the data type for how I’m saving currency. I’ll use a string for the currency’s denomination and an integer for the amount. Right now, I’ll most likely make it so that the user sets the currency once and can’t change it, but I may change that later.

Livestream

https://youtu.be/VtLA2\_YO\_RM

04 Expense Tracker - Creating Migrations with Vapor | Building in Public Livestream | Mikaela Caron


Share this post:

Previous Post
Building in Public - Expense Tracker 03: Planning an iOS App
Next Post
Building in Public - Expense Tracker 02: Design and Sketch