https://github.com/tienphuckx/anony-box-backbone
An anonymous chatting web
https://github.com/tienphuckx/anony-box-backbone
api-rest axum postg rust socket-programming
Last synced: about 1 month ago
JSON representation
An anonymous chatting web
- Host: GitHub
- URL: https://github.com/tienphuckx/anony-box-backbone
- Owner: tienphuckx
- License: mit
- Created: 2024-10-04T01:51:39.000Z (9 months ago)
- Default Branch: master
- Last Pushed: 2024-12-09T02:12:09.000Z (6 months ago)
- Last Synced: 2025-05-01T16:33:16.837Z (about 2 months ago)
- Topics: api-rest, axum, postg, rust, socket-programming
- Language: Rust
- Homepage:
- Size: 683 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Backbone API for Anonymous ChatBox
Backend API for an anonymous chat application.## Steps to Apply Database Modifications
### 1. Generate a New Migration with `diesel_cli`
To create a new migration file, use the following command:```bash
diesel migration generate migration_name
```This will create two SQL script files in the `migrations` folder:
- **up.sql** - Defines the logic for applying the new changes.
- **down.sql** - Defines the logic for reverting the changes.> **Note**: Follow the naming convention `yyyy-mm-dd-description-of-change` for migration names.
> **Example**: `2024-10-26-create-table-xyz`### 2. Define the Migration Logic
Edit the `up.sql` and `down.sql` files to specify the SQL commands required for your changes.### 3. Apply the Migration to the Database
Run the migration to apply changes to the database:```bash
diesel migration run
```### 4. Update the Database Schema in Code
To reflect the new database schema in your code, use:```bash
diesel print-schema > ./src/database/schema.rs
```This command will update the `schema.rs` file with the latest table definitions.
### 5. Adjust Models for Database Changes
Modify any necessary models in `./src/database/models.rs` to align with the updated schema.