diff --git a/Gemfile b/Gemfile index c8c3256a..ebd451eb 100644 --- a/Gemfile +++ b/Gemfile @@ -61,5 +61,7 @@ group :production do gem 'bleib' end +gem 'rectify', '~> 0.13.0' + # Needs to be loaded after all other delayed_job gems gem 'delayed_cron_job' diff --git a/Gemfile.lock b/Gemfile.lock index efeffd78..5ede9d74 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -493,6 +493,7 @@ GEM railties (>= 5) doorkeeper-i18n (4.0.1) dumb_delegator (1.0.0) + equalizer (0.0.11) erb_lint (0.0.37) activesupport better_html (~> 1.0.7) @@ -822,6 +823,12 @@ GEM rb-fsevent (0.11.2) rb-inotify (0.10.1) ffi (~> 1.0) + rectify (0.13.0) + activemodel (>= 4.1.0) + activerecord (>= 4.1.0) + activesupport (>= 4.1.0) + virtus (~> 1.0.5) + wisper (>= 1.6.1) redcarpet (3.6.0) redis (4.8.1) regexp_parser (2.9.0) @@ -967,10 +974,11 @@ GEM activemodel (>= 3.0.0) public_suffix version_gem (1.1.3) - virtus (2.0.0) + virtus (1.0.5) axiom-types (~> 0.1) coercible (~> 1.0) descendants_tracker (~> 0.0, >= 0.0.3) + equalizer (~> 0.0, >= 0.0.9) w3c_rspec_validators (0.3.0) rails rspec @@ -1052,6 +1060,7 @@ DEPENDENCIES pry-byebug pry-rails puma + rectify (~> 0.13.0) sentry-raven spring spring-watcher-listen diff --git a/config/database.yml b/config/database.yml index 4448c56c..f6cb7219 100644 --- a/config/database.yml +++ b/config/database.yml @@ -1,6 +1,6 @@ --- default: &default - adapter: postgresql + adapter: postgis encoding: unicode pool: <%= ENV.fetch('RAILS_MAX_THREADS') { 5 } %> host: <%= ENV.fetch('RAILS_DB_HOST') { 'localhost' } %> diff --git a/db/schema.rb b/db/schema.rb index 201dbf96..30f6d94b 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,12 +10,13 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2024_02_02_224501) do +ActiveRecord::Schema.define(version: 2024_03_03_000156) do # These are extensions that must be enabled in order to support this database enable_extension "ltree" enable_extension "pg_trgm" enable_extension "plpgsql" + enable_extension "postgis" create_table "active_storage_attachments", force: :cascade do |t| t.string "name", null: false @@ -806,6 +807,27 @@ t.index ["user_id"], name: "index_decidim_gamification_badge_scores_on_user_id" end + create_table "decidim_geo_shapefile_datas", force: :cascade do |t| + t.bigint "decidim_geo_shapefiles_id" + t.jsonb "data" + t.geometry "geom", limit: {:srid=>0, :type=>"multi_polygon"} + t.bigint "decidim_scopes_id" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.index ["decidim_geo_shapefiles_id"], name: "index_decidim_geo_shapefile_datas_on_decidim_geo_shapefiles_id" + t.index ["decidim_scopes_id"], name: "index_decidim_geo_shapefile_datas_on_decidim_scopes_id" + end + + create_table "decidim_geo_shapefiles", force: :cascade do |t| + t.string "title", null: false + t.string "description" + t.string "shapefile", null: false + t.bigint "decidim_scope_types_id" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.index ["decidim_scope_types_id"], name: "index_decidim_geo_shapefiles_on_decidim_scope_types_id" + end + create_table "decidim_hashtags", force: :cascade do |t| t.bigint "decidim_organization_id" t.string "name" @@ -2034,6 +2056,9 @@ add_foreign_key "decidim_debates_debates", "decidim_scopes" add_foreign_key "decidim_editor_images", "decidim_organizations" add_foreign_key "decidim_editor_images", "decidim_users", column: "decidim_author_id" + add_foreign_key "decidim_geo_shapefile_datas", "decidim_geo_shapefiles", column: "decidim_geo_shapefiles_id" + add_foreign_key "decidim_geo_shapefile_datas", "decidim_scopes", column: "decidim_scopes_id" + add_foreign_key "decidim_geo_shapefiles", "decidim_scope_types", column: "decidim_scope_types_id" add_foreign_key "decidim_identities", "decidim_organizations" add_foreign_key "decidim_navigation_maps_blueprint_areas", "decidim_navigation_maps_blueprints" add_foreign_key "decidim_navigation_maps_blueprints", "decidim_content_blocks"