File tree Expand file tree Collapse file tree 3 files changed +42
-1
lines changed Expand file tree Collapse file tree 3 files changed +42
-1
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ cargo shuttle run
4242
4343### Documentation
4444
45- Explore the [ API documentation ] ( /docs/docs.md ) for detailed information and usage guidelines.
45+ Explore the [ Documentation ] ( /docs/docs.md ) for detailed information and usage guidelines.
4646
4747---
4848
Original file line number Diff line number Diff line change 11# API Documentation
22
33## Contents
4+ - [ Managing Migrations] ( /docs/migrations.md )
45- [ GraphQL Queries] ( /docs/queries.md )
56- [ GraphQL Mutations] ( /docs/mutations.md )
Original file line number Diff line number Diff line change 1+ ## Managing Migrations
2+
3+ ## Contents
4+ - [ Create Migrations] ( #create-migrations )
5+ - [ Run Migrations] ( #run-migrations )
6+
7+ ---
8+
9+ ### Prerequisites
10+ 1 . Install ` sql-cli `
11+ ``` bash
12+ cargo install sqlx-cli
13+ ```
14+
15+ # ## Create Migrations
16+
17+ Run the following command to create migrations
18+
19+ ` ` ` bash
20+ sqlx migrate add < migration_name>
21+ ` ` `
22+
23+ - Replace ` < migration_name> ` with a descriptive name for your migration, e.g.,` create_users_table` .
24+ - This will add a new migration file to the ` migrations` directory.
25+
26+ ---
27+
28+ # ## Run Migrations
29+
30+ Run the following command to apply migrations to your local database
31+
32+ ` ` ` bash
33+ sqlx migrate run
34+ ` ` `
35+
36+ ---
37+
38+ # ## Notes
39+ - Look for logs confirming the migration ran successfully.
40+ - Never rename or alter migration files as their names and contents are used to track applied changes.
You can’t perform that action at this time.
0 commit comments