Merge pull request #3147 from betagouv/clean-carto
Remove now useless carto tables
This commit is contained in:
commit
5a30467594
4 changed files with 11 additions and 31 deletions
|
@ -41,7 +41,7 @@ class Champs::CarteController < ApplicationController
|
|||
coordinates = JSON.parse(coordinates)
|
||||
|
||||
if @champ.cadastres?
|
||||
cadastres = ModuleApiCartoService.generate_cadastre(coordinates)
|
||||
cadastres = ApiCartoService.generate_cadastre(coordinates)
|
||||
geo_areas += cadastres.map do |cadastre|
|
||||
cadastre[:source] = GeoArea.sources.fetch(:cadastre)
|
||||
cadastre
|
||||
|
@ -49,7 +49,7 @@ class Champs::CarteController < ApplicationController
|
|||
end
|
||||
|
||||
if @champ.quartiers_prioritaires?
|
||||
quartiers_prioritaires = ModuleApiCartoService.generate_qp(coordinates)
|
||||
quartiers_prioritaires = ApiCartoService.generate_qp(coordinates)
|
||||
geo_areas += quartiers_prioritaires.map do |qp|
|
||||
qp[:source] = GeoArea.sources.fetch(:quartier_prioritaire)
|
||||
qp
|
||||
|
@ -57,7 +57,7 @@ class Champs::CarteController < ApplicationController
|
|||
end
|
||||
|
||||
if @champ.parcelles_agricoles?
|
||||
parcelles_agricoles = ModuleApiCartoService.generate_rpg(coordinates)
|
||||
parcelles_agricoles = ApiCartoService.generate_rpg(coordinates)
|
||||
geo_areas += parcelles_agricoles.map do |parcelle_agricole|
|
||||
parcelle_agricole[:source] = GeoArea.sources.fetch(:parcelle_agricole)
|
||||
parcelle_agricole
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class ModuleApiCartoService
|
||||
class ApiCartoService
|
||||
def self.generate_qp(coordinates)
|
||||
coordinates.flat_map do |coordinate|
|
||||
ApiCarto::QuartiersPrioritairesAdapter.new(
|
6
db/migrate/20181218103212_drop_old_carto.rb
Normal file
6
db/migrate/20181218103212_drop_old_carto.rb
Normal file
|
@ -0,0 +1,6 @@
|
|||
class DropOldCarto < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
drop_table :cadastres
|
||||
drop_table :quartier_prioritaires
|
||||
end
|
||||
end
|
28
db/schema.rb
28
db/schema.rb
|
@ -10,7 +10,7 @@
|
|||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 2018_12_04_125101) do
|
||||
ActiveRecord::Schema.define(version: 2018_12_18_103212) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
|
@ -142,22 +142,6 @@ ActiveRecord::Schema.define(version: 2018_12_04_125101) do
|
|||
t.index ["gestionnaire_id"], name: "index_avis_on_gestionnaire_id"
|
||||
end
|
||||
|
||||
create_table "cadastres", id: :serial, force: :cascade do |t|
|
||||
t.string "surface_intersection"
|
||||
t.float "surface_parcelle"
|
||||
t.string "numero"
|
||||
t.integer "feuille"
|
||||
t.string "section"
|
||||
t.string "code_dep"
|
||||
t.string "nom_com"
|
||||
t.string "code_com"
|
||||
t.string "code_arr"
|
||||
t.text "geometry"
|
||||
t.integer "dossier_id"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
end
|
||||
|
||||
create_table "champs", id: :serial, force: :cascade do |t|
|
||||
t.string "value"
|
||||
t.integer "type_de_champ_id"
|
||||
|
@ -487,16 +471,6 @@ ActiveRecord::Schema.define(version: 2018_12_04_125101) do
|
|||
t.index ["service_id"], name: "index_procedures_on_service_id"
|
||||
end
|
||||
|
||||
create_table "quartier_prioritaires", id: :serial, force: :cascade do |t|
|
||||
t.string "code"
|
||||
t.string "nom"
|
||||
t.string "commune"
|
||||
t.text "geometry"
|
||||
t.integer "dossier_id"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
end
|
||||
|
||||
create_table "received_mails", id: :serial, force: :cascade do |t|
|
||||
t.text "body"
|
||||
t.string "subject"
|
||||
|
|
Loading…
Reference in a new issue