diff --git a/js/src/graphql/address.ts b/js/src/graphql/address.ts
index 3035d9ad8..b45790051 100644
--- a/js/src/graphql/address.ts
+++ b/js/src/graphql/address.ts
@@ -8,7 +8,6 @@ export const ADDRESS = gql`
id,
description,
geom,
- floor,
street,
locality,
postalCode,
diff --git a/js/src/graphql/event.ts b/js/src/graphql/event.ts
index d4620d5ed..a26250b19 100644
--- a/js/src/graphql/event.ts
+++ b/js/src/graphql/event.ts
@@ -18,7 +18,6 @@ const participantQuery = `
const physicalAddressQuery = `
description,
- floor,
street,
locality,
postalCode,
diff --git a/js/src/types/address.model.ts b/js/src/types/address.model.ts
index b26bbfd38..8db566691 100644
--- a/js/src/types/address.model.ts
+++ b/js/src/types/address.model.ts
@@ -1,7 +1,6 @@
export interface IAddress {
id?: number;
description: string;
- floor: string;
street: string;
locality: string;
postalCode: string;
@@ -15,7 +14,6 @@ export interface IAddress {
export class Address implements IAddress {
country: string = '';
description: string = '';
- floor: string = '';
locality: string = '';
postalCode: string = '';
region: string = '';
diff --git a/js/src/views/Event/Event.vue b/js/src/views/Event/Event.vue
index f96290106..465b3d8ec 100644
--- a/js/src/views/Event/Event.vue
+++ b/js/src/views/Event/Event.vue
@@ -116,7 +116,7 @@ import {ParticipantRole} from "@/types/event.model";
{{ event.physicalAddress.description }}
- {{ event.physicalAddress.floor }} {{ event.physicalAddress.street }}
+ {{ event.physicalAddress.street }}
{{ event.physicalAddress.postalCode }} {{ event.physicalAddress.locality }}
diff --git a/lib/mobilizon/addresses/address.ex b/lib/mobilizon/addresses/address.ex
index c7c6453e1..0b2de0930 100644
--- a/lib/mobilizon/addresses/address.ex
+++ b/lib/mobilizon/addresses/address.ex
@@ -14,7 +14,6 @@ defmodule Mobilizon.Addresses.Address do
locality: String.t(),
region: String.t(),
description: String.t(),
- floor: String.t(),
geom: Geo.PostGIS.Geometry.t(),
postal_code: String.t(),
street: String.t(),
@@ -26,7 +25,6 @@ defmodule Mobilizon.Addresses.Address do
@required_attrs [:url]
@optional_attrs [
:description,
- :floor,
:geom,
:country,
:locality,
@@ -42,7 +40,6 @@ defmodule Mobilizon.Addresses.Address do
field(:locality, :string)
field(:region, :string)
field(:description, :string)
- field(:floor, :string)
field(:geom, Geo.PostGIS.Geometry)
field(:postal_code, :string)
field(:street, :string)
diff --git a/lib/mobilizon_web/schema/address.ex b/lib/mobilizon_web/schema/address.ex
index 9a9006f83..da2dbc5ca 100644
--- a/lib/mobilizon_web/schema/address.ex
+++ b/lib/mobilizon_web/schema/address.ex
@@ -7,7 +7,6 @@ defmodule MobilizonWeb.Schema.AddressType do
object :address do
field(:geom, :point, description: "The geocoordinates for the point where this address is")
- field(:floor, :string, description: "The floor this event is at")
field(:street, :string, description: "The address's street name (with number)")
field(:locality, :string, description: "The address's locality")
field(:postal_code, :string)
@@ -32,7 +31,6 @@ defmodule MobilizonWeb.Schema.AddressType do
input_object :address_input do
# Either a full picture object
field(:geom, :point, description: "The geocoordinates for the point where this address is")
- field(:floor, :string, description: "The floor this event is at")
field(:street, :string, description: "The address's street name (with number)")
field(:locality, :string, description: "The address's locality")
field(:postal_code, :string)
diff --git a/lib/service/geospatial/addok.ex b/lib/service/geospatial/addok.ex
index 8dd88d52b..737b233dc 100644
--- a/lib/service/geospatial/addok.ex
+++ b/lib/service/geospatial/addok.ex
@@ -74,7 +74,6 @@ defmodule Mobilizon.Service.Geospatial.Addok do
locality: Map.get(properties, "city"),
region: Map.get(properties, "state"),
description: Map.get(properties, "name") || street_address(properties),
- floor: Map.get(properties, "floor"),
geom: geometry |> Map.get("coordinates") |> Provider.coordinates(),
postal_code: Map.get(properties, "postcode"),
street: properties |> street_address()
diff --git a/lib/service/geospatial/google_maps.ex b/lib/service/geospatial/google_maps.ex
index 72054c095..1b2960d52 100644
--- a/lib/service/geospatial/google_maps.ex
+++ b/lib/service/geospatial/google_maps.ex
@@ -127,7 +127,6 @@ defmodule Mobilizon.Service.Geospatial.GoogleMaps do
locality: Map.get(components, "locality"),
region: Map.get(components, "administrative_area_level_1"),
description: description,
- floor: nil,
geom: [lon, lat] |> Provider.coordinates(),
postal_code: Map.get(components, "postal_code"),
street: street_address(components),
diff --git a/lib/service/geospatial/map_quest.ex b/lib/service/geospatial/map_quest.ex
index 084836a03..5f567224d 100644
--- a/lib/service/geospatial/map_quest.ex
+++ b/lib/service/geospatial/map_quest.ex
@@ -115,7 +115,6 @@ defmodule Mobilizon.Service.Geospatial.MapQuest do
locality: Map.get(address, "adminArea5"),
region: Map.get(address, "adminArea3"),
description: Map.get(address, "street"),
- floor: Map.get(address, "floor"),
geom: [lng, lat] |> Provider.coordinates(),
postal_code: Map.get(address, "postalCode"),
street: Map.get(address, "street")
diff --git a/lib/service/geospatial/nominatim.ex b/lib/service/geospatial/nominatim.ex
index c00e0e936..3f4a6b9c9 100644
--- a/lib/service/geospatial/nominatim.ex
+++ b/lib/service/geospatial/nominatim.ex
@@ -78,7 +78,6 @@ defmodule Mobilizon.Service.Geospatial.Nominatim do
locality: Map.get(address, "city"),
region: Map.get(address, "state"),
description: description(body),
- floor: Map.get(address, "floor"),
geom: [Map.get(body, "lon"), Map.get(body, "lat")] |> Provider.coordinates(),
postal_code: Map.get(address, "postcode"),
street: street_address(address),
diff --git a/lib/service/geospatial/photon.ex b/lib/service/geospatial/photon.ex
index df954305c..a42971c8d 100644
--- a/lib/service/geospatial/photon.ex
+++ b/lib/service/geospatial/photon.ex
@@ -76,7 +76,6 @@ defmodule Mobilizon.Service.Geospatial.Photon do
locality: Map.get(properties, "city"),
region: Map.get(properties, "state"),
description: Map.get(properties, "name") || street_address(properties),
- floor: Map.get(properties, "floor"),
geom: geometry |> Map.get("coordinates") |> Provider.coordinates(),
postal_code: Map.get(properties, "postcode"),
street: properties |> street_address()
diff --git a/priv/repo/migrations/20191106114524_remove_floor_from_addresses.exs b/priv/repo/migrations/20191106114524_remove_floor_from_addresses.exs
new file mode 100644
index 000000000..69112fc18
--- /dev/null
+++ b/priv/repo/migrations/20191106114524_remove_floor_from_addresses.exs
@@ -0,0 +1,15 @@
+defmodule Mobilizon.Storage.Repo.Migrations.RemoveFloorFromAddresses do
+ use Ecto.Migration
+
+ def up do
+ alter table(:addresses) do
+ remove(:floor)
+ end
+ end
+
+ def down do
+ alter table(:addresses) do
+ add(:floor, :string)
+ end
+ end
+end
diff --git a/schema.graphql b/schema.graphql
index fae69d34e..ec149f147 100644
--- a/schema.graphql
+++ b/schema.graphql
@@ -1,5 +1,5 @@
# source: http://localhost:4000/api
-# timestamp: Wed Oct 30 2019 17:12:28 GMT+0100 (Central European Standard Time)
+# timestamp: Wed Nov 06 2019 12:50:45 GMT+0100 (Central European Standard Time)
schema {
query: RootQueryType
@@ -119,9 +119,6 @@ type Address {
country: String
description: String
- """The floor this event is at"""
- floor: String
-
"""The geocoordinates for the point where this address is"""
geom: Point
id: ID
@@ -141,9 +138,6 @@ input AddressInput {
country: String
description: String
- """The floor this event is at"""
- floor: String
-
"""The geocoordinates for the point where this address is"""
geom: Point
id: ID
diff --git a/test/mobilizon/addresses/addresses_test.exs b/test/mobilizon/addresses/addresses_test.exs
index 8be79b2f1..e4e3e8b1e 100644
--- a/test/mobilizon/addresses/addresses_test.exs
+++ b/test/mobilizon/addresses/addresses_test.exs
@@ -12,7 +12,6 @@ defmodule Mobilizon.AddressesTest do
locality: "some addressLocality",
region: "some addressRegion",
description: "some description",
- floor: "some floor",
postal_code: "some postalCode",
street: "some streetAddress",
geom: %Geo.Point{coordinates: {10, -10}, srid: 4326}
@@ -22,7 +21,6 @@ defmodule Mobilizon.AddressesTest do
locality: "some updated addressLocality",
region: "some updated addressRegion",
description: "some updated description",
- floor: "some updated floor",
postal_code: "some updated postalCode",
street: "some updated streetAddress",
geom: %Geo.Point{coordinates: {20, -20}, srid: 4326}
@@ -32,7 +30,6 @@ defmodule Mobilizon.AddressesTest do
# addressLocality: nil,
# addressRegion: nil,
# description: nil,
- # floor: nil,
# postalCode: nil,
# streetAddress: nil,
# geom: nil
@@ -54,7 +51,6 @@ defmodule Mobilizon.AddressesTest do
assert address.locality == "some addressLocality"
assert address.region == "some addressRegion"
assert address.description == "some description"
- assert address.floor == "some floor"
assert address.postal_code == "some postalCode"
assert address.street == "some streetAddress"
end
@@ -66,7 +62,6 @@ defmodule Mobilizon.AddressesTest do
assert address.locality == "some updated addressLocality"
assert address.region == "some updated addressRegion"
assert address.description == "some updated description"
- assert address.floor == "some updated floor"
assert address.postal_code == "some updated postalCode"
assert address.street == "some updated streetAddress"
end
diff --git a/test/support/factory.ex b/test/support/factory.ex
index 336eccdf2..371c73e1c 100644
--- a/test/support/factory.ex
+++ b/test/support/factory.ex
@@ -83,7 +83,6 @@ defmodule Mobilizon.Factory do
description: sequence("MyAddress"),
geom: %Geo.Point{coordinates: {45.75, 4.85}, srid: 4326},
url: "http://mobilizon.test/address/#{Ecto.UUID.generate()}",
- floor: "Myfloor",
country: "My Country",
locality: "My Locality",
region: "My Region",