Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Geographic Data Models and Migrations #12

Open
10 of 33 tasks
rsmithlal opened this issue Feb 28, 2019 · 0 comments · May be fixed by #545
Open
10 of 33 tasks

Implement Geographic Data Models and Migrations #12

rsmithlal opened this issue Feb 28, 2019 · 0 comments · May be fixed by #545
Assignees
Labels
enhancement New feature or request

Comments

@rsmithlal
Copy link
Member

rsmithlal commented Feb 28, 2019

We need to implement a series of geographic data models within the BetterTogether namespace, nested under a Geography module. These models will represent various geographic entities such as countries, states, regions, cities, districts, neighborhoods, streets, and addresses. Each model will have specific attributes and associations. The migrations will set up the necessary database tables with appropriate columns and relationships.

Tasks:

  1. Create Models:

    • BetterTogether::Geography::Country
    • BetterTogether::Geography::State
    • BetterTogether::Geography::Region
    • BetterTogether::Geography::City
    • BetterTogether::Geography::District
    • BetterTogether::Geography::Neighborhood
    • BetterTogether::Geography::Street
    • BetterTogether::Geography::Address
  2. Define Model Attributes and Associations:

    • Add bt_identifier, bt_protected, and bt_slug attributes to each model.
    • Define associations between models (e.g., belongs_to, has_many).
    • Use bt_references for associations.
  3. Generate Migrations:

    • Create create_bt_table migration for countries.
    • Create create_bt_table migration for states with reference to countries.
    • Create create_bt_table migration for regions with reference to countries.
    • Create create_bt_table migration for cities with references to states and regions.
    • Create create_bt_table migration for districts with references to cities and regions.
    • Create create_bt_table migration for neighborhoods with references to cities and districts.
    • Create create_bt_table migration for streets with references to neighborhoods and cities.
    • Create create_bt_table migration for addresses with references to cities, states, and countries, and a st_point for coordinates.
  4. Implement Models:

    • Implement BetterTogether::Geography::Country model.
    • Implement BetterTogether::Geography::State model.
    • Implement BetterTogether::Geography::Region model.
    • Implement BetterTogether::Geography::City model.
    • Implement BetterTogether::Geography::District model.
    • Implement BetterTogether::Geography::Neighborhood model.
    • Implement BetterTogether::Geography::Street model.
    • Implement BetterTogether::Geography::Address model.
  5. Testing:

    • Write model tests for validations and associations.
    • Write migration tests to ensure database structure is correct.
    • Test CRUD operations for each model.
  6. Documentation:

    • Update README with new models and their attributes.
    • Document the database schema changes.
    • Add usage examples for each geographic entity.

Please make sure to create a branch for this implementation and open a pull request once the tasks are completed. Let’s ensure all tests pass before merging the changes into the main branch.


This checklist covers the major tasks required to implement the geographic data models and their migrations, ensuring that each step is tracked and documented properly.

@rsmithlal rsmithlal added the enhancement New feature or request label Feb 28, 2019
@rsmithlal rsmithlal self-assigned this Feb 28, 2019
@rsmithlal rsmithlal removed their assignment Apr 27, 2024
@rsmithlal rsmithlal changed the title Add Location model Implement Geographic Data Models and Migrations May 20, 2024
@rsmithlal rsmithlal self-assigned this May 20, 2024
@rsmithlal rsmithlal linked a pull request May 21, 2024 that will close this issue
33 tasks
@rsmithlal rsmithlal linked a pull request May 21, 2024 that will close this issue
33 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant