Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ cargo shuttle run

### Documentation

Explore the [API documentation](/docs/docs.md) for detailed information and usage guidelines.
Explore the [Documentation](/docs/docs.md) for detailed information and usage guidelines.

---

Expand Down
1 change: 1 addition & 0 deletions docs/docs.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# API Documentation

## Contents
- [Managing Migrations](/docs/migrations.md)
- [GraphQL Queries](/docs/queries.md)
- [GraphQL Mutations](/docs/mutations.md)
40 changes: 40 additions & 0 deletions docs/migrations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
## Managing Migrations

## Contents
- [Create Migrations](#create-migrations)
- [Run Migrations](#run-migrations)

---

### Prerequisites
1. Install `sql-cli`
```bash
cargo install sqlx-cli
```

### Create Migrations

Run the following command to create migrations

```bash
sqlx migrate add <migration_name>
```

- Replace `<migration_name>` with a descriptive name for your migration, e.g.,`create_users_table`.
- This will add a new migration file to the `migrations` directory.

---

### Run Migrations

Run the following command to apply migrations to your local database

```bash
sqlx migrate run
```

---

### Notes
- Look for logs confirming the migration ran successfully.
- Never rename or alter migration files as their names and contents are used to track applied changes.