Skip to content

Commit

Permalink
Merge pull request #2812 from BarakStout/master
Browse files Browse the repository at this point in the history
updated sql table schema definition
  • Loading branch information
omnipresent07 authored Jun 14, 2019
2 parents 168753c + 15ed1c7 commit eb01ca2
Showing 1 changed file with 122 additions and 40 deletions.
162 changes: 122 additions & 40 deletions modified-lar/src/main/resources/modified-lar.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,38 @@
CREATE TABLE hmda_user.modifiedlar2018
(
-- SCHEMA: hmda_user

-- DROP SCHEMA hmda_user ;

CREATE SCHEMA hmda_user AUTHORIZATION hmda_user;

--
-- PostgreSQL database dump
--

-- Dumped from database version 10.6
-- Dumped by pg_dump version 10.5

-- Started on 2019-06-05 11:44:49 EDT

SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET client_min_messages = warning;
SET row_security = off;

SET default_tablespace = '';

SET default_with_oids = false;

--
-- TOC entry 282 (class 1259 OID 22057)
-- Name: modifiedlar2018; Type: TABLE; Schema: hmda_user; Owner: hmda_user
--

CREATE TABLE hmda_user.modifiedlar2018 (
id integer NOT NULL,
lei character varying NOT NULL,
loan_type integer,
Expand All @@ -12,28 +45,28 @@ CREATE TABLE hmda_user.modifiedlar2018
state character varying,
county character varying,
tract character varying,
ethnicity_applicant_1 integer,
ethnicity_applicant_2 integer,
ethnicity_applicant_3 integer,
ethnicity_applicant_4 integer,
ethnicity_applicant_5 integer,
ethnicity_observed_applicant int,
ethnicity_co_applicant_1 integer,
ethnicity_co_applicant_2 integer,
ethnicity_co_applicant_3 integer,
ethnicity_co_applicant_4 integer,
ethnicity_co_applicant_5 integer,
ethnicity_observed_co_applicant int,
race_applicant_1 integer,
race_applicant_2 integer,
race_applicant_3 integer,
race_applicant_4 integer,
race_applicant_5 integer,
race_co_applicant_1 integer,
race_co_applicant_2 integer,
race_co_applicant_3 integer,
race_co_applicant_4 integer,
race_co_applicant_5 integer,
ethnicity_applicant_1 character varying,
ethnicity_applicant_2 character varying,
ethnicity_applicant_3 character varying,
ethnicity_applicant_4 character varying,
ethnicity_applicant_5 character varying,
ethnicity_observed_applicant integer,
ethnicity_co_applicant_1 character varying,
ethnicity_co_applicant_2 character varying,
ethnicity_co_applicant_3 character varying,
ethnicity_co_applicant_4 character varying,
ethnicity_co_applicant_5 character varying,
ethnicity_observed_co_applicant integer,
race_applicant_1 character varying,
race_applicant_2 character varying,
race_applicant_3 character varying,
race_applicant_4 character varying,
race_applicant_5 character varying,
race_co_applicant_1 character varying,
race_co_applicant_2 character varying,
race_co_applicant_3 character varying,
race_co_applicant_4 character varying,
race_co_applicant_5 character varying,
race_observed_applicant integer,
race_observed_co_applicant integer,
sex_applicant integer,
Expand Down Expand Up @@ -63,7 +96,7 @@ CREATE TABLE hmda_user.modifiedlar2018
interest_rate character varying,
payment_penalty character varying,
debt_to_incode character varying,
loan_value_ratio character varying,
loan_value_ratio character varying,
loan_term character varying,
rate_spread_intro character varying,
baloon_payment integer,
Expand Down Expand Up @@ -92,31 +125,80 @@ CREATE TABLE hmda_user.modifiedlar2018
owner_occupied_units character varying,
one_to_four_fam_units character varying,
msa_md integer,
msa_md_name character varying,
loan_flag character varying,
created_at timestamp default current_timestamp,
created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
submission_id character varying,
msa_md_name character varying,
filing_year integer,
conforming_loan_limit character varying,
median_age integer,
median_age_calculated integer,
median_age_calculated character varying,
median_income_percentage integer,
percent_median_msa_income integer,
race_categorization character varying,
sex_categorization character varying,
ethnicity_categorization character varying,
uniq_id integer NOT NULL,
percent_median_msa_income character varying,
dwelling_category character varying,
loan_product_type character varying
)
WITH (
OIDS = FALSE
);

ALTER TABLE public.modifiedlar2018
OWNER to postgres;

ALTER TABLE public.modifiedlar2018
ADD COLUMN race_categorization character varying,
ADD COLUMN sex_categorization character varying;
ALTER TABLE hmda_user.modifiedlar2018 OWNER TO hmda_user;

--
-- TOC entry 285 (class 1259 OID 25533)
-- Name: modifiedlar2018_uniq_id_seq; Type: SEQUENCE; Schema: hmda_user; Owner: hmda_user
--

CREATE SEQUENCE hmda_user.modifiedlar2018_uniq_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;


ALTER TABLE hmda_user.modifiedlar2018_uniq_id_seq OWNER TO hmda_user;

--
-- TOC entry 5570 (class 0 OID 0)
-- Dependencies: 285
-- Name: modifiedlar2018_uniq_id_seq; Type: SEQUENCE OWNED BY; Schema: hmda_user; Owner: hmda_user
--

ALTER SEQUENCE hmda_user.modifiedlar2018_uniq_id_seq OWNED BY hmda_user.modifiedlar2018.uniq_id;


--
-- TOC entry 5433 (class 2604 OID 57438)
-- Name: modifiedlar2018 uniq_id; Type: DEFAULT; Schema: hmda_user; Owner: hmda_user
--

ALTER TABLE ONLY hmda_user.modifiedlar2018 ALTER COLUMN uniq_id SET DEFAULT nextval('hmda_user.modifiedlar2018_uniq_id_seq'::regclass);


--
-- TOC entry 5436 (class 2606 OID 25537)
-- Name: modifiedlar2018 modifiedlar2018_pkey; Type: CONSTRAINT; Schema: hmda_user; Owner: hmda_user
--

ALTER TABLE ONLY hmda_user.modifiedlar2018
ADD CONSTRAINT modifiedlar2018_pkey PRIMARY KEY (uniq_id);


--
-- TOC entry 5434 (class 1259 OID 58733)
-- Name: modifiedlar2018_lei_idx; Type: INDEX; Schema: hmda_user; Owner: hmda_user
--

CREATE INDEX modifiedlar2018_lei_idx ON hmda_user.modifiedlar2018 USING btree (lei);


-- Completed on 2019-06-05 11:44:50 EDT

CREATE INDEX ON modifiedlar2018 (lei);

create index on modifiedlar2018prod (race_categorization);
create index on modifiedlar2018prod (action_taken_type);
--
-- PostgreSQL database dump complete
--

0 comments on commit eb01ca2

Please sign in to comment.