From 3230381be40b0c9541d4c6e1a0b6560ca7f8da00 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Mon, 14 Jan 2019 18:12:52 +0100 Subject: [PATCH] Remove last occurences of address_type Signed-off-by: Thomas Citharel --- js/src/components/Event/Create.vue | 223 +++++++++--------- js/src/graphql/event.ts | 8 +- .../20180702150922_add_address_type.exs | 4 - .../20190114162055_remove_address_type.exs | 7 +- 4 files changed, 117 insertions(+), 125 deletions(-) diff --git a/js/src/components/Event/Create.vue b/js/src/components/Event/Create.vue index 3796aa61a..f24f5b4de 100644 --- a/js/src/components/Event/Create.vue +++ b/js/src/components/Event/Create.vue @@ -8,14 +8,8 @@ - - - + + @@ -33,7 +27,7 @@ types="geocode" v-on:placechanged="getAddressData" > - --> + --> - + > Create event @@ -66,125 +59,135 @@ diff --git a/js/src/graphql/event.ts b/js/src/graphql/event.ts index 14906976f..d42ef03f8 100644 --- a/js/src/graphql/event.ts +++ b/js/src/graphql/event.ts @@ -85,19 +85,13 @@ export const CREATE_EVENT = gql` $organizerActorId: Int!, $categoryId: Int!, $beginsOn: DateTime!, - $addressType: AddressType!, ) { createEvent( title: $title, description: $description, beginsOn: $beginsOn, organizerActorId: $organizerActorId, - categoryId: $categoryId, - addressType: $addressType) { - uuid, - title, - description, - } + categoryId: $categoryId } `; diff --git a/priv/repo/migrations/20180702150922_add_address_type.exs b/priv/repo/migrations/20180702150922_add_address_type.exs index d9085e08d..253ede470 100644 --- a/priv/repo/migrations/20180702150922_add_address_type.exs +++ b/priv/repo/migrations/20180702150922_add_address_type.exs @@ -2,9 +2,7 @@ defmodule Mobilizon.Repo.Migrations.AddAddressType do use Ecto.Migration def up do - Mobilizon.Events.AddressTypeEnum.create_type alter table(:events) do - add :address_type, :address_type add :online_address, :string add :phone, :string end @@ -17,11 +15,9 @@ defmodule Mobilizon.Repo.Migrations.AddAddressType do def down do alter table(:events) do - remove :address_type remove :online_address remove :phone end - Mobilizon.Events.AddressTypeEnum.drop_type drop constraint(:events, "events_physical_address_id_fkey") rename table(:events), :physical_address_id, to: :address_id alter table(:events) do diff --git a/priv/repo/migrations/20190114162055_remove_address_type.exs b/priv/repo/migrations/20190114162055_remove_address_type.exs index ead2109fe..74b73b7a3 100644 --- a/priv/repo/migrations/20190114162055_remove_address_type.exs +++ b/priv/repo/migrations/20190114162055_remove_address_type.exs @@ -1,11 +1,10 @@ defmodule Mobilizon.Repo.Migrations.RemoveAddressType do use Ecto.Migration + require Logger def up do - alter table(:events) do - remove(:address_type) - end - execute "DROP TYPE address_type" + execute "DROP TYPE IF EXISTS address_type" + execute "ALTER TABLE \"events\" DROP COLUMN IF EXISTS address_type" rename table(:events), :phone, to: :phone_address end end