-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(db):update schema and fix foreign key references (#159)
This pull request includes significant changes to the database schema and seed data scripts, focusing on refactoring table structures, updating foreign key relationships, and enhancing the seed data. The most important changes include the renaming and restructuring of tables, the addition of new columns, and the removal of certain tables and columns. ### Database Schema Changes: * `database/start-scripts/0-init.sql`: - Renamed `task_types` to `tasks`, `pruning_types` to `element_types`, and added new columns such as `description` and `require_tree_type`. Removed `photo_id` and associated foreign key constraints from multiple tables. - Updated the `zones` table structure by adding new columns and modifying foreign key relationships. Removed the `zones_predefined` and `routes` tables. - Added `deleted_at` and `updated_at` timestamps to several tables including `work_reports`, `work_report_photos`, `sensors`, and `sensor_history`. [[1]](diffhunk://#diff-72bf1e9917f27a912c8b0028f642b9f88128bcbff602cc0d9a40dea20d7cfc4fR209) [[2]](diffhunk://#diff-72bf1e9917f27a912c8b0028f642b9f88128bcbff602cc0d9a40dea20d7cfc4fR218-R219) [[3]](diffhunk://#diff-72bf1e9917f27a912c8b0028f642b9f88128bcbff602cc0d9a40dea20d7cfc4fR234-R235) [[4]](diffhunk://#diff-72bf1e9917f27a912c8b0028f642b9f88128bcbff602cc0d9a40dea20d7cfc4fR249-R250) ### Seed Data Changes: * `database/start-scripts/1-seed.sql`: - Added seed data for `element_types`, `tasks`, `zones`, and `elements`. Updated the seed data for `work_orders`, `work_orders_users`, and `work_reports`. These changes aim to streamline the database structure, improve data integrity, and enhance the initial dataset for better testing and development.
- Loading branch information
Showing
2 changed files
with
140 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.