From c4171455b2a4ec88f86158c19eb8e7ce7207cb19 Mon Sep 17 00:00:00 2001 From: Denise Li Date: Wed, 7 Aug 2024 19:06:35 -0400 Subject: [PATCH] chore: add dbmate to the contrib guide (#2289) --- CONTRIBUTING.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d13e876fb6..990e03fba2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -134,6 +134,15 @@ If you make any changes to the `sqlc` inputs, i.e. all the `sql/queries.sql` fil just build-sqlc ``` +We use [dbmate](https://github.com/amacneil/dbmate) to manage migrations. To create a migration file, run `dbmate new` with the name of your migration. Example: +``` +dbmate new create_users_table +``` + +This will automatically create a migration file in `backend/controller/sql/schema/`. You can refer to any of the existing files in there as examples while writing your own migration. + +[This section](https://github.com/amacneil/dbmate?tab=readme-ov-file#creating-migrations) of the dbmate docs explains how to create a migration if you'd like to learn more. + ## VSCode extension The preferred way to develop the FTL VSCode extension is to open a VSCode instance in the `extensions/vscode` directory. This will load the extension in a new VSCode window. From there, the `launch.json` and `tasks.json` files are configured to run the extension in a new window.