-
Notifications
You must be signed in to change notification settings - Fork 0
DataBase
Welcome to the StateForce database wiki page. This section serves as the central place to understand how our database is structured, how to run it locally, and how to contribute to its data model and structure.
We use PostgreSQL as our relational database engine.
-
Version:
>= 17.4 - Chosen for: stability, strong data integrity, and support for geospatial data.
The full ERD and schema documentation are hosted on dbdocs.io:
π View the full schema on dbdocs.io
This includes:
- Tables and attributes
- Relationships (FKs, associations)
- Descriptions for each model
To spin up the database in your local environment:
Make sure PostgreSQL is installed on your system:
psql --version
brew install postgresql
brew services start postgresqlCheck config/database.yml for credentials and connection settings and set the environment variables at .env file
In your Rails project, run:
rails db:create db:migrate db:seedWe use a db/seeds.rb file to prepopulate the database to development.
To seed the database:
rails db:seedTo reset your local database:
rails db:resetThis will drop, recreate, migrate, and seed the database from scratch.
- If you add or change models, always run
rails db:migrateand ensureschema.rbis updated. - Migrations should be atomic and reversible.
- Keep seed data minimal, clean, and realistic.
We are always looking for feedback and contributions to improve StateForce. Feel free to open issues, suggest edits, or submit pull requests to the repository.
- Repo: StateForce GitHub
- Contact: martinmendozadev@gmail.com
If you encounter issues or need assistance, please reach out via:
- Email: martinmendozadev@gmail.com
- GitHub Issues: Submit an Issue
This documentation and the StateForce platform are licensed under the Apache License 2.0.
Thank you for using StateForce! π¨
Together, we are improving emergency response operations in real-time.
Welcome to the StateForce Wiki! Use this sidebar to navigate through the documentation.
This sidebar provides quick access to all the documentation pages. For detailed information, click on the desired section.