Commit 60390f7f authored by hellekin's avatar hellekin

Fix various inconsistencies

- remove an extra / from puma config
- remove a call to require in `routes.rb`
- fix integer lengths for `agent_id` and `radius`
- re-add specs after `annotate`
parent 3028a568
......@@ -8,7 +8,7 @@ threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
threads threads_count, threads_count
app_dir = File.expand_path('../..', __FILE__)
shared_dir = "#{app_dir}/tmp/"
shared_dir = "#{app_dir}/tmp"
# Specifies the `port` that Puma will listen on to receive requests; default is 3000.
#
......
require 'incommon/api/constraints'
# frozen_string_literal: true
Rails.application.routes.draw do
root to: 'api#index', via: [:get]
......
class FixMapsIntegers < ActiveRecord::Migration[5.2]
def change
change_column :maps, :agent_id, :bigint
change_column :positions, :radius, :integer
end
end
......@@ -85,7 +85,8 @@ CREATE TABLE public.categories (
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
rank integer,
translations json DEFAULT '{}'::json
translations json DEFAULT '{}'::json,
sections_count integer DEFAULT 0
);
......@@ -511,6 +512,37 @@ CREATE SEQUENCE public.resource_phones_id_seq
ALTER SEQUENCE public.resource_phones_id_seq OWNED BY public.resource_phones.id;
--
-- Name: resource_sections; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.resource_sections (
id bigint NOT NULL,
resource_type character varying,
resource_id bigint,
section_id bigint
);
--
-- Name: resource_sections_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.resource_sections_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: resource_sections_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.resource_sections_id_seq OWNED BY public.resource_sections.id;
--
-- Name: resources; Type: TABLE; Schema: public; Owner: -
--
......@@ -610,7 +642,8 @@ CREATE TABLE public.sections (
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
rank integer,
translations json DEFAULT '{}'::json
translations json DEFAULT '{}'::json,
resources_count integer DEFAULT 0
);
......@@ -643,7 +676,8 @@ CREATE TABLE public.taxonomies (
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
agent_id bigint,
translations json DEFAULT '{}'::json
translations json DEFAULT '{}'::json,
categories_count integer DEFAULT 0
);
......@@ -834,6 +868,13 @@ ALTER TABLE ONLY public.resource_links ALTER COLUMN id SET DEFAULT nextval('publ
ALTER TABLE ONLY public.resource_phones ALTER COLUMN id SET DEFAULT nextval('public.resource_phones_id_seq'::regclass);
--
-- Name: resource_sections id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.resource_sections ALTER COLUMN id SET DEFAULT nextval('public.resource_sections_id_seq'::regclass);
--
-- Name: resources id; Type: DEFAULT; Schema: public; Owner: -
--
......@@ -996,6 +1037,14 @@ ALTER TABLE ONLY public.resource_phones
ADD CONSTRAINT resource_phones_pkey PRIMARY KEY (id);
--
-- Name: resource_sections resource_sections_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.resource_sections
ADD CONSTRAINT resource_sections_pkey PRIMARY KEY (id);
--
-- Name: resources resources_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
......@@ -1192,6 +1241,20 @@ CREATE INDEX index_resource_phones_on_phone_id ON public.resource_phones USING b
CREATE INDEX index_resource_phones_on_resource_type_and_resource_id ON public.resource_phones USING btree (resource_type, resource_id);
--
-- Name: index_resource_sections_on_resource_type_and_resource_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_resource_sections_on_resource_type_and_resource_id ON public.resource_sections USING btree (resource_type, resource_id);
--
-- Name: index_resource_sections_on_section_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_resource_sections_on_section_id ON public.resource_sections USING btree (section_id);
--
-- Name: index_resources_on_agent_id; Type: INDEX; Schema: public; Owner: -
--
......@@ -1341,6 +1404,14 @@ ALTER TABLE ONLY public.maps
ADD CONSTRAINT fk_rails_785bd34e17 FOREIGN KEY (collection_id) REFERENCES public.collections(id);
--
-- Name: resource_sections fk_rails_873f0b3bae; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.resource_sections
ADD CONSTRAINT fk_rails_873f0b3bae FOREIGN KEY (section_id) REFERENCES public.sections(id);
--
-- Name: user_emails fk_rails_a98f61fc58; Type: FK CONSTRAINT; Schema: public; Owner: -
--
......@@ -1445,6 +1516,9 @@ INSERT INTO "schema_migrations" (version) VALUES
('20181026160048'),
('20181027151540'),
('20181028185905'),
('20181028222641');
('20181028222641'),
('20181106092911'),
('20181106094615'),
('20181106153013');
......@@ -10,13 +10,14 @@ end
#
# Table name: categories
#
# id :bigint(8) not null, primary key
# color :string(25)
# rank :integer
# translations :json
# created_at :datetime not null
# updated_at :datetime not null
# taxonomy_id :bigint(8)
# id :bigint(8) not null, primary key
# color :string(25)
# rank :integer
# sections_count :integer default(0)
# translations :json
# created_at :datetime not null
# updated_at :datetime not null
# taxonomy_id :bigint(8)
#
# Indexes
#
......
......@@ -14,12 +14,16 @@ end
#
# id :bigint(8) not null, primary key
# box :json
# elevation :decimal(6, 2)
# elevation :decimal(7, 2)
# geo_type :string
# geometry :text
# geometry :geometry({:srid= geometry, 0
# latitude :decimal(9, 7)
# longitude :decimal(10, 7)
# radius :bigint(8)
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# index_positions_on_geometry (geometry) USING gist
#
......@@ -17,8 +17,9 @@ end
#
# Indexes
#
# index_roles_on_agent_id (agent_id)
# index_roles_on_user_id (user_id)
# index_roles_on_agent_id (agent_id)
# index_roles_on_user_id (user_id)
# index_roles_on_user_id_and_agent_id (user_id,agent_id) UNIQUE
#
# Foreign Keys
#
......
......@@ -10,13 +10,14 @@ end
#
# Table name: sections
#
# id :bigint(8) not null, primary key
# color :string(25)
# rank :integer
# translations :json
# created_at :datetime not null
# updated_at :datetime not null
# category_id :bigint(8)
# id :bigint(8) not null, primary key
# color :string(25)
# rank :integer
# resources_count :integer default(0)
# translations :json
# created_at :datetime not null
# updated_at :datetime not null
# category_id :bigint(8)
#
# Indexes
#
......
......@@ -10,12 +10,13 @@ end
#
# Table name: taxonomies
#
# id :bigint(8) not null, primary key
# translations :json
# uuid :string(36)
# created_at :datetime not null
# updated_at :datetime not null
# agent_id :bigint(8)
# id :bigint(8) not null, primary key
# categories_count :integer default(0)
# translations :json
# uuid :string(36)
# created_at :datetime not null
# updated_at :datetime not null
# agent_id :bigint(8)
#
# Indexes
#
......
......@@ -40,13 +40,14 @@ end
#
# Table name: categories
#
# id :bigint(8) not null, primary key
# color :string(25)
# rank :integer
# translations :json
# created_at :datetime not null
# updated_at :datetime not null
# taxonomy_id :bigint(8)
# id :bigint(8) not null, primary key
# color :string(25)
# rank :integer
# sections_count :integer default(0)
# translations :json
# created_at :datetime not null
# updated_at :datetime not null
# taxonomy_id :bigint(8)
#
# Indexes
#
......
......@@ -10,12 +10,16 @@ end
#
# id :bigint(8) not null, primary key
# box :json
# elevation :decimal(6, 2)
# elevation :decimal(7, 2)
# geo_type :string
# geometry :text
# geometry :geometry({:srid= geometry, 0
# latitude :decimal(9, 7)
# longitude :decimal(10, 7)
# radius :bigint(8)
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# index_positions_on_geometry (geometry) USING gist
#
......@@ -17,8 +17,9 @@ end
#
# Indexes
#
# index_roles_on_agent_id (agent_id)
# index_roles_on_user_id (user_id)
# index_roles_on_agent_id (agent_id)
# index_roles_on_user_id (user_id)
# index_roles_on_user_id_and_agent_id (user_id,agent_id) UNIQUE
#
# Foreign Keys
#
......
......@@ -8,13 +8,14 @@ end
#
# Table name: sections
#
# id :bigint(8) not null, primary key
# color :string(25)
# rank :integer
# translations :json
# created_at :datetime not null
# updated_at :datetime not null
# category_id :bigint(8)
# id :bigint(8) not null, primary key
# color :string(25)
# rank :integer
# resources_count :integer default(0)
# translations :json
# created_at :datetime not null
# updated_at :datetime not null
# category_id :bigint(8)
#
# Indexes
#
......
......@@ -75,12 +75,13 @@ end
#
# Table name: taxonomies
#
# id :bigint(8) not null, primary key
# translations :json
# uuid :string(36)
# created_at :datetime not null
# updated_at :datetime not null
# agent_id :bigint(8)
# id :bigint(8) not null, primary key
# categories_count :integer default(0)
# translations :json
# uuid :string(36)
# created_at :datetime not null
# updated_at :datetime not null
# agent_id :bigint(8)
#
# Indexes
#
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment