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

Add postgis extension - a spatial database extender for PostgreSQL #4843

Merged
merged 3 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions config/initializers/active_record_config.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# frozen_string_literal: true

ActiveRecord::SchemaDumper.ignore_tables |= %w[
geography_columns
geometry_columns
layer
raster_columns
raster_overviews
spatial_ref_sys
topology
]
7 changes: 7 additions & 0 deletions db/migrate/20250121161119_enable_postgis_extension.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# frozen_string_literal: true

class EnablePostgisExtension < ActiveRecord::Migration[8.0]
def change
enable_extension 'postgis' unless extension_enabled?('postgis')
end
end
3 changes: 2 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[8.0].define(version: 2025_01_16_123350) do
ActiveRecord::Schema[8.0].define(version: 2025_01_21_161119) do
# These are extensions that must be enabled in order to support this database
enable_extension "btree_gin"
enable_extension "btree_gist"
enable_extension "citext"
enable_extension "pg_buffercache"
enable_extension "pg_catalog.plpgsql"
enable_extension "pg_stat_statements"
enable_extension "postgis"
enable_extension "uuid-ossp"

create_table "__EFMigrationsHistory", primary_key: "MigrationId", id: { type: :string, limit: 150 }, force: :cascade do |t|
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
- "6379:6379"

db:
image: postgres:14-alpine
image: postgis/postgis:14-3.5-alpine
# To preserve data between runs of docker compose, we mount a folder from the host machine.
volumes:
- dbdata:/var/lib/postgresql/data
Expand Down
Binary file modified docs/database-diagram.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions guides/machine-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ You'll need to have the libraries below to be able to develop the application lo
- [Node.js](https://nodejs.org/en/)
- [Yarn](https://yarnpkg.com/)
- [PostgreSQL](https://www.postgresql.org/)
- [Postgis](https://postgis.net/install/)
- [Redis](https://redis.io/)
- [ChromeDriver](https://chromedriver.chromium.org/)
- [Terraform](https://www.terraform.io/)
Expand Down
1 change: 1 addition & 0 deletions terraform/aks/databases.tf
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,5 @@ module "postgres" {
azure_enable_high_availability = var.postgres_enable_high_availability
azure_maintenance_window = var.postgres_azure_maintenance_window
server_version = "14"
server_docker_image = "postgis/postgis:14-3.5"
}
Loading