Remove latitude and longitude from database

This commit is contained in:
Eric Schultz 2021-02-03 19:46:34 -06:00 committed by Eric Schultz
parent 16a6b63e05
commit 59ef8d1bde
9 changed files with 14 additions and 20 deletions

View file

@ -83,6 +83,6 @@ class EventsController < ApplicationController
private
def event_params
params.require(:event).permit(:deleted, :name, :tagline, :summary, :body, :end_datetime, :start_datetime, :latitude, :longitude, :location, :city, :state_code, :address, :zip_code, :main_image, :remove_main_image, :background_image, :remove_background_image, :published, :slug, :directions, :venue_name, :profile_id, :ticket_levels_attributes, :show_total_raised, :show_total_count, :hide_activity_feed, :nonprofit_id, :hide_title, :organizer_email, :receipt_message)
params.require(:event).permit(:deleted, :name, :tagline, :summary, :body, :end_datetime, :start_datetime, :location, :city, :state_code, :address, :zip_code, :main_image, :remove_main_image, :background_image, :remove_background_image, :published, :slug, :directions, :venue_name, :profile_id, :ticket_levels_attributes, :show_total_raised, :show_total_count, :hide_activity_feed, :nonprofit_id, :hide_title, :organizer_email, :receipt_message)
end
end

View file

@ -170,8 +170,6 @@ class NonprofitsController < ApplicationController
:published,
:vetted,
:verification_status,
:latitude,
:longitude,
:timezone,
:address,
:thank_you_note,

View file

@ -13,8 +13,6 @@ class Event < ApplicationRecord
# :body, # text (html)
# :end_datetime,
# :start_datetime,
# :latitude, # float
# :longitude, # float
# :location, # str
# :city, # str
# :state_code, # str

View file

@ -19,9 +19,7 @@ class Supporter < ApplicationRecord
# :country,
# :phone,
# :organization,
# :latitude,
# :locale,
# :longitude,
# :zip_code,
# :total_raised,
# :notes,

View file

@ -17,8 +17,6 @@ class User < ApplicationRecord
# :name, # str: created with oauth
# :auto_generated, # bool: flag whether a password was auto-generated for this account
# :referer, # str: ID of the user who referred this account
# :latitude,
# :longitude,
# :reset_password_token,
# :reset_password_sent_at,
# :picture, # str: url for fb or twitter pic

View file

@ -4,7 +4,7 @@
# Full license explanation at https://github.com/houdiniproject/houdini/blob/master/LICENSE
json.extract! nonprofit, :id, :name, #basics
:brand_color, :brand_font, :tagline, #brand
:zip_code, :state_code, :city, :latitude, :longitude, #location
:zip_code, :state_code, :city,
:slug, :state_code_slug, :city_slug, #slugs
:no_anon #options
json.url nonprofit_path(nonprofit)

View file

@ -1003,8 +1003,6 @@ CREATE TABLE public.events (
tagline character varying(255),
summary text,
body text,
latitude double precision,
longitude double precision,
location character varying(255),
main_image character varying(255),
background_image character varying(255),
@ -1500,8 +1498,6 @@ CREATE TABLE public.nonprofits (
address text,
vetted boolean,
zip_code character varying(255),
latitude double precision,
longitude double precision,
pending_balance integer,
state_code_slug character varying(255),
city_slug character varying(255),
@ -2058,8 +2054,6 @@ CREATE TABLE public.supporters (
state_code character varying(255),
anonymous boolean DEFAULT false NOT NULL,
zip_code character varying(255),
latitude double precision,
longitude double precision,
full_contact_info_id integer,
deleted boolean DEFAULT false,
organization character varying(255),
@ -2400,8 +2394,6 @@ CREATE TABLE public.users (
city character varying(255),
state_code character varying(255),
location character varying(255),
latitude double precision,
longitude double precision,
confirmation_token character varying(255),
confirmed_at timestamp without time zone,
confirmation_sent_at timestamp without time zone,

View file

@ -0,0 +1,12 @@
# frozen_string_literal: true
# License: AGPL-3.0-or-later WITH WTO-AP-3.0-or-later
# Full license explanation at https://github.com/houdiniproject/houdini/blob/master/LICENSE
class RemoveLongAndLat < ActiveRecord::Migration[6.1]
def change
[:users, :events, :nonprofits, :supporters].each do |i|
remove_column i, :longitude, "double precision"
remove_column i, :latitude, "double precision"
end
end
end

View file

@ -217,9 +217,7 @@ describe InsertDuplicate do
address: '100 N Appleton St',
city: 'Appleton',
directions: nil,
latitude: nil,
location: nil,
longitude: nil,
organizer_email: nil,
state_code: 'WI',
venue_name: nil,