Skip to content

WIP: Implement Geographic Data Models and Migrations #545

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

Draft
wants to merge 68 commits into
base: main
Choose a base branch
from

Conversation

rsmithlal
Copy link
Member

@rsmithlal rsmithlal commented May 21, 2024

Closes #12

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::Settlement
    • 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 settlements with references to states and regions.
    • Create create_bt_table migration for districts with references to settlements 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::Settlement 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.

Continent, Country, State

Seed: continents, countries, canandian provinces
@rsmithlal rsmithlal added the enhancement New feature or request label May 21, 2024
@rsmithlal rsmithlal self-assigned this May 21, 2024
@rsmithlal rsmithlal linked an issue May 21, 2024 that may be closed by this pull request
33 tasks
rsmithlal and others added 25 commits May 22, 2024 23:22
Initial region, settlement, and region settlement data.

Add primary community for every newly-created community-based data type (geographic locations, platforms, people for now).
Running into errors that I don't have the bandwidth to solve right now
disabled a lot of the not-yet-implemented scaffolded specs for geography models
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.63.5 to 1.64.0.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](rubocop/rubocop@v1.63.5...v1.64.0)

---
updated-dependencies:
- dependency-name: rubocop
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Add support for postgis
Split rubocop out into its own task
Bumps [faker](https://github.com/faker-ruby/faker) from 3.3.1 to 3.4.1.
- [Release notes](https://github.com/faker-ruby/faker/releases)
- [Changelog](https://github.com/faker-ruby/faker/blob/main/CHANGELOG.md)
- [Commits](faker-ruby/faker@v3.3.1...v3.4.1)

---
updated-dependencies:
- dependency-name: faker
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [pundit-resources](https://github.com/better-together-org/pundit-resources) from `16b9030` to `b6218c6`.
- [Commits](better-together-org/pundit-resources@16b9030...b6218c6)

---
updated-dependencies:
- dependency-name: pundit-resources
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.64.0 to 1.64.1.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](rubocop/rubocop@v1.64.0...v1.64.1)

---
updated-dependencies:
- dependency-name: rubocop
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
rsmithlal and others added 30 commits June 17, 2024 19:34
reduce duplication setting url configs
Includes fix for trix active storage attachment direct uploads to S3
Bumps [aws-sdk-s3](https://github.com/aws/aws-sdk-ruby) from 1.152.0 to 1.152.1.
- [Release notes](https://github.com/aws/aws-sdk-ruby/releases)
- [Changelog](https://github.com/aws/aws-sdk-ruby/blob/version-3/gems/aws-sdk-s3/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-ruby/commits)

---
updated-dependencies:
- dependency-name: aws-sdk-s3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [rails](https://github.com/rails/rails) from 7.0.8.3 to 7.1.3.4.
- [Release notes](https://github.com/rails/rails/releases)
- [Commits](rails/rails@v7.0.8.3...v7.1.3.4)

---
updated-dependencies:
- dependency-name: rails
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [aws-sdk-s3](https://github.com/aws/aws-sdk-ruby) from 1.152.1 to 1.152.3.
- [Release notes](https://github.com/aws/aws-sdk-ruby/releases)
- [Changelog](https://github.com/aws/aws-sdk-ruby/blob/version-3/gems/aws-sdk-s3/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-ruby/commits)

---
updated-dependencies:
- dependency-name: aws-sdk-s3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [rubocop-rspec](https://github.com/rubocop/rubocop-rspec) from 2.31.0 to 3.0.1.
- [Release notes](https://github.com/rubocop/rubocop-rspec/releases)
- [Changelog](https://github.com/rubocop/rubocop-rspec/blob/master/CHANGELOG.md)
- [Commits](rubocop/rubocop-rspec@v2.31.0...v3.0.1)

---
updated-dependencies:
- dependency-name: rubocop-rspec
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Store master.key in password manager. Used to edit the encrypted credentials.

Store only SECRET_KEY_BASE in encrypted credentials for now
- Initial dev setup guide
- Initial production deployment guide
- Initial platform setup wizard guide

All guides are very much WIP.
Signed-off-by: Robert Smith <[email protected]>
Signed-off-by: Robert Smith <[email protected]>
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
Status: In progress
Development

Successfully merging this pull request may close these issues.

Implement Geographic Data Models and Migrations
1 participant