Search Postgresql Archives

Re: SuperUser permission denied when creating table.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sure thing.  I attached it as a txt file.  Thanks for the help!

On Tue, Jul 9, 2019 at 9:29 AM Achilleas Mantzios <achill@xxxxxxxxxxxxxxxxxxxxx> wrote:
On 9/7/19 3:31 μ.μ., Dave Hughes wrote:
>
> Has anyone ran across something like this before?

can you show your pg_dumpall -x --schema-only
?

--
Achilleas Mantzios
IT DEV Lead
IT DEPT
Dynacom Tankers Mgmt



--
-- PostgreSQL database cluster dump
--

SET default_transaction_read_only = off;

SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;

--
-- Roles
--

CREATE ROLE aficc_creator;
ALTER ROLE aficc_creator WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB NOLOGIN NOREPLICATION NOBYPASSRLS;
CREATE ROLE aficc_users;
ALTER ROLE aficc_users WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB NOLOGIN NOREPLICATION NOBYPASSRLS;
CREATE ROLE afsc448_creator;
ALTER ROLE afsc448_creator WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB NOLOGIN NOREPLICATION NOBYPASSRLS;
CREATE ROLE afsc448_test_user;
ALTER ROLE afsc448_test_user WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB LOGIN NOREPLICATION NOBYPASSRLS PASSWORD 'md5e81272063a36dfc2cdc49e8938522997';
CREATE ROLE afsc448_users;
ALTER ROLE afsc448_users WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB NOLOGIN NOREPLICATION NOBYPASSRLS;
CREATE ROLE aheath;
ALTER ROLE aheath WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB LOGIN NOREPLICATION NOBYPASSRLS PASSWORD 'md5fe8e41e58d3ad3e5a53030442d261e0c';
CREATE ROLE amxasvc;
ALTER ROLE amxasvc WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB LOGIN NOREPLICATION NOBYPASSRLS PASSWORD 'md5b99c6dc1b4ad0ff71c83d203b469a303';
CREATE ROLE ckimmel;
ALTER ROLE ckimmel WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB LOGIN NOREPLICATION NOBYPASSRLS PASSWORD 'md5b60aa0a5723dbd236ce8e2a49fb7e0d5';
CREATE ROLE cmccorkle;
ALTER ROLE cmccorkle WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB LOGIN NOREPLICATION NOBYPASSRLS PASSWORD 'md5a5013c92e682ec71992751c53da6f55c';
CREATE ROLE creator_role;
ALTER ROLE creator_role WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB NOLOGIN NOREPLICATION NOBYPASSRLS;
CREATE ROLE cslavick;
ALTER ROLE cslavick WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB LOGIN NOREPLICATION NOBYPASSRLS PASSWORD 'md54f964c5ec5b7f0a668fac6007e130fd8';
CREATE ROLE cterrian;
ALTER ROLE cterrian WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB LOGIN NOREPLICATION NOBYPASSRLS PASSWORD 'md5d42d53671f680c92e4b985039dcfe818';
CREATE ROLE dcerwinsky;
ALTER ROLE dcerwinsky WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB LOGIN NOREPLICATION NOBYPASSRLS PASSWORD 'md5fc84ac3503a1d570ddd9482dd3c0a1ff';
CREATE ROLE dhughes;
ALTER ROLE dhughes WITH SUPERUSER INHERIT NOCREATEROLE NOCREATEDB LOGIN NOREPLICATION NOBYPASSRLS PASSWORD 'md52801517407fca8271fbe5d94f85e6ece';
CREATE ROLE jackh;
ALTER ROLE jackh WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB LOGIN NOREPLICATION NOBYPASSRLS PASSWORD 'md5b2c6057e79ccef1375e4f9e6b115d492';
CREATE ROLE jlayer;
ALTER ROLE jlayer WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB LOGIN NOREPLICATION NOBYPASSRLS PASSWORD 'md57d31b9c450bcc554adebf8574512bba9';
CREATE ROLE jsteets;
ALTER ROLE jsteets WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB LOGIN NOREPLICATION NOBYPASSRLS PASSWORD 'md57a39e5242a10b6d5401e3be1eb6821fa';
CREATE ROLE jwilkinson;
ALTER ROLE jwilkinson WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB LOGIN NOREPLICATION NOBYPASSRLS PASSWORD 'md5114fd3c0890489bc59c92fa7552bd957';
CREATE ROLE kbuchhalter;
ALTER ROLE kbuchhalter WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB LOGIN NOREPLICATION NOBYPASSRLS PASSWORD 'md52a39af9cfacc497f4aaeb5b7e2e23acf';
CREATE ROLE kbush;
ALTER ROLE kbush WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB LOGIN NOREPLICATION NOBYPASSRLS PASSWORD 'md509e20f3313b726d2de85bae89d85f3d0';
CREATE ROLE kroberts;
ALTER ROLE kroberts WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB LOGIN NOREPLICATION NOBYPASSRLS PASSWORD 'md59859cb741210ef1db2b4f34634af410a';
CREATE ROLE lcorcoran;
ALTER ROLE lcorcoran WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB LOGIN NOREPLICATION NOBYPASSRLS PASSWORD 'md5f455b79be11c9e95b6d1dc835150dcdc';
CREATE ROLE lodm_creator;
ALTER ROLE lodm_creator WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB NOLOGIN NOREPLICATION NOBYPASSRLS;
CREATE ROLE lodm_group;
ALTER ROLE lodm_group WITH NOSUPERUSER NOINHERIT NOCREATEROLE NOCREATEDB NOLOGIN NOREPLICATION NOBYPASSRLS;
CREATE ROLE lodm_test;
ALTER ROLE lodm_test WITH NOSUPERUSER NOINHERIT NOCREATEROLE NOCREATEDB LOGIN NOREPLICATION NOBYPASSRLS PASSWORD 'md539f1563a9182a42db0c1d41b066d95c6';
CREATE ROLE lzia_users;
ALTER ROLE lzia_users WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB NOLOGIN NOREPLICATION NOBYPASSRLS;
CREATE ROLE mavery;
ALTER ROLE mavery WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB LOGIN NOREPLICATION NOBYPASSRLS PASSWORD 'md589854605b7b7ee573f7dcb677b054f1f';
CREATE ROLE postgres;
ALTER ROLE postgres WITH SUPERUSER INHERIT CREATEROLE CREATEDB LOGIN REPLICATION BYPASSRLS PASSWORD 'md5db3725428c0ff7d944f9940de35c74c6';
CREATE ROLE read_only_role;
ALTER ROLE read_only_role WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB NOLOGIN NOREPLICATION NOBYPASSRLS;
CREATE ROLE read_only_user;
ALTER ROLE read_only_user WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB LOGIN NOREPLICATION NOBYPASSRLS PASSWORD 'md5c203924ea26c05218301e9fa5c8659d6';
CREATE ROLE sshaw;
ALTER ROLE sshaw WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB LOGIN NOREPLICATION NOBYPASSRLS PASSWORD 'md517d3204bb17b0b7f8eb7e5cad16cc0ef';
CREATE ROLE superset;
ALTER ROLE superset WITH NOSUPERUSER INHERIT CREATEROLE NOCREATEDB LOGIN NOREPLICATION NOBYPASSRLS PASSWORD 'md5dbcbaf2cd8fc67a00ff663ec83e1bde6';
CREATE ROLE test_user;
ALTER ROLE test_user WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB LOGIN NOREPLICATION NOBYPASSRLS PASSWORD 'md58cd5f90969004f545429913663a7c5cb';


--
-- Role memberships
--

GRANT aficc_creator TO aficc_users GRANTED BY postgres;
GRANT aficc_users TO mavery GRANTED BY postgres;
GRANT afsc448_creator TO afsc448_users GRANTED BY postgres;
GRANT afsc448_users TO afsc448_test_user GRANTED BY postgres;
GRANT afsc448_users TO cmccorkle GRANTED BY postgres;
GRANT afsc448_users TO cslavick GRANTED BY postgres;
GRANT afsc448_users TO kroberts GRANTED BY postgres;
GRANT creator_role TO lodm_test GRANTED BY postgres;
GRANT creator_role TO lzia_users GRANTED BY postgres;
GRANT lodm_creator TO lodm_group GRANTED BY postgres;
GRANT lodm_creator TO lzia_users GRANTED BY postgres;
GRANT lodm_group TO aheath GRANTED BY postgres;
GRANT lodm_group TO kbuchhalter GRANTED BY postgres;
GRANT lodm_group TO lcorcoran GRANTED BY postgres;
GRANT lodm_group TO lodm_test GRANTED BY postgres;
GRANT lodm_group TO sshaw GRANTED BY postgres;
GRANT lzia_users TO amxasvc GRANTED BY postgres;
GRANT lzia_users TO ckimmel GRANTED BY postgres;
GRANT lzia_users TO cterrian GRANTED BY postgres;
GRANT lzia_users TO dcerwinsky GRANTED BY postgres;
GRANT lzia_users TO jlayer GRANTED BY postgres;
GRANT lzia_users TO jwilkinson GRANTED BY postgres;
GRANT lzia_users TO test_user GRANTED BY postgres;
GRANT read_only_role TO jackh GRANTED BY postgres;
GRANT read_only_role TO jsteets GRANTED BY postgres;
GRANT read_only_role TO kbush GRANTED BY postgres;
GRANT read_only_role TO read_only_user GRANTED BY postgres;




--
-- Database creation
--

CREATE DATABASE afleads WITH TEMPLATE = template0 OWNER = postgres;
CREATE DATABASE afscbkp WITH TEMPLATE = template0 OWNER = postgres;
CREATE DATABASE superset WITH TEMPLATE = template0 OWNER = superset;


\connect afleads

SET default_transaction_read_only = off;

--
-- PostgreSQL database dump
--

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

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;

--
-- Name: afcap; Type: SCHEMA; Schema: -; Owner: postgres
--

CREATE SCHEMA afcap;


ALTER SCHEMA afcap OWNER TO postgres;

--
-- Name: aficc; Type: SCHEMA; Schema: -; Owner: postgres
--

CREATE SCHEMA aficc;


ALTER SCHEMA aficc OWNER TO postgres;

--
-- Name: afsc448_onesnapshot; Type: SCHEMA; Schema: -; Owner: postgres
--

CREATE SCHEMA afsc448_onesnapshot;


ALTER SCHEMA afsc448_onesnapshot OWNER TO postgres;

--
-- Name: afsc448_public; Type: SCHEMA; Schema: -; Owner: postgres
--

CREATE SCHEMA afsc448_public;


ALTER SCHEMA afsc448_public OWNER TO postgres;

--
-- Name: afsc448_sandbox; Type: SCHEMA; Schema: -; Owner: postgres
--

CREATE SCHEMA afsc448_sandbox;


ALTER SCHEMA afsc448_sandbox OWNER TO postgres;

--
-- Name: lodm; Type: SCHEMA; Schema: -; Owner: postgres
--

CREATE SCHEMA lodm;


ALTER SCHEMA lodm OWNER TO postgres;

--
-- Name: manpower; Type: SCHEMA; Schema: -; Owner: postgres
--

CREATE SCHEMA manpower;


ALTER SCHEMA manpower OWNER TO postgres;

--
-- Name: master_ref; Type: SCHEMA; Schema: -; Owner: postgres
--

CREATE SCHEMA master_ref;


ALTER SCHEMA master_ref OWNER TO postgres;

--
-- Name: mytest; Type: SCHEMA; Schema: -; Owner: postgres
--

CREATE SCHEMA mytest;


ALTER SCHEMA mytest OWNER TO postgres;

--
-- Name: remis; Type: SCHEMA; Schema: -; Owner: postgres
--

CREATE SCHEMA remis;


ALTER SCHEMA remis OWNER TO postgres;

--
-- Name: sandbox; Type: SCHEMA; Schema: -; Owner: postgres
--

CREATE SCHEMA sandbox;


ALTER SCHEMA sandbox OWNER TO postgres;

--
-- Name: timeline; Type: SCHEMA; Schema: -; Owner: postgres
--

CREATE SCHEMA timeline;


ALTER SCHEMA timeline OWNER TO postgres;

--
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: 
--

CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;


--
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: 
--

COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';


--
-- Name: dblink; Type: EXTENSION; Schema: -; Owner: 
--

CREATE EXTENSION IF NOT EXISTS dblink WITH SCHEMA public;


--
-- Name: EXTENSION dblink; Type: COMMENT; Schema: -; Owner: 
--

COMMENT ON EXTENSION dblink IS 'connect to other PostgreSQL databases from within a database';


--
-- Name: pg_schema_size(text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION public.pg_schema_size(text) RETURNS bigint
    LANGUAGE sql
    AS $_$
SELECT SUM(pg_total_relation_size(quote_ident(schemaname) || '.' || quote_ident(tablename)))::BIGINT FROM pg_tables WHERE schemaname = $1
$_$;


ALTER FUNCTION public.pg_schema_size(text) OWNER TO postgres;

--
-- Name: to_timestamp_from_excel(integer); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION public.to_timestamp_from_excel(exceldate integer) RETURNS timestamp without time zone
    LANGUAGE plpgsql
    AS $$
BEGIN
   IF ExcelDate > 59 THEN
    ExcelDate = ExcelDate - 1;
   END IF;
   RETURN date '1899-12-31' + ExcelDate;
END;
$$;


ALTER FUNCTION public.to_timestamp_from_excel(exceldate integer) OWNER TO postgres;

--
-- Name: trg_create_tbl(); Type: FUNCTION; Schema: timeline; Owner: postgres
--

CREATE FUNCTION timeline.trg_create_tbl() RETURNS event_trigger
    LANGUAGE plpgsql
    AS $$
DECLARE
vlzia boolean;
vlodm boolean;
vafsc448 boolean;
vaficc boolean;

BEGIN
  -- check to see what group the current user belongs to.
  execute format('select pg_has_role(''lzia_users'', ''member'')') into vlzia;
  execute format('select pg_has_role(''lodm_group'', ''member'')') into vlodm;
  execute format('select pg_has_role(''afsc448_users'', ''member'')') into vafsc448;
  execute format('select pg_has_role(''aficc_users'', ''member'')') into vaficc;

  -- if they are, allow the role change.
  IF vlzia is true THEN
    EXECUTE format('SET ROLE creator_role');
  ELSIF vlodm is true THEN
    EXECUTE format('SET ROLE lodm_creator');
  ELSIF vafsc448 is true THEN
    EXECUTE format('SET ROLE afsc448_creator');	
  ELSIF vaficc is true THEN
    EXECUTE format('SET ROLE aficc_creator');	
  END IF;  
  
END;
$$;


ALTER FUNCTION timeline.trg_create_tbl() OWNER TO postgres;

--
-- Name: trg_drop_tbl(); Type: FUNCTION; Schema: timeline; Owner: postgres
--

CREATE FUNCTION timeline.trg_drop_tbl() RETURNS event_trigger
    LANGUAGE plpgsql
    AS $$
DECLARE
vuser varchar(50);
vlzia boolean;
vlodm boolean;
vafsc448 boolean;
vaficc boolean;

BEGIN
  -- check who the current user is.
  execute format('select current_user') into vuser;
  -- check to see what group the current user belongs to.    
  execute format('select pg_has_role(''lzia_users'', ''member'')') into vlzia;
  execute format('select pg_has_role(''lodm_group'', ''member'')') into vlodm;
  execute format('select pg_has_role(''afsc448_users'', ''member'')') into vafsc448;
  execute format('select pg_has_role(''aficc_users'', ''member'')') into vaficc;
  

  IF vuser not in ('postgres', 'dhughes') and vlzia is true THEN
    EXECUTE format('SET ROLE creator_role');
  ELSIF vuser not in ('postgres', 'dhughes') and vlodm is true THEN
    EXECUTE format('SET ROLE lodm_creator');
  ELSIF vuser not in ('postgres', 'dhughes') and vafsc448 is true THEN	
    EXECUTE format('SET ROLE afsc448_creator');
  ELSIF vuser not in ('postgres', 'dhughes') and vaficc is true THEN	
    EXECUTE format('SET ROLE aficc_creator');	
  END IF;   
  
END;
$$;


ALTER FUNCTION timeline.trg_drop_tbl() OWNER TO postgres;

--
-- Name: trg_reset_usr(); Type: FUNCTION; Schema: timeline; Owner: postgres
--

CREATE FUNCTION timeline.trg_reset_usr() RETURNS event_trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
  EXECUTE format('RESET role');
END;
$$;


ALTER FUNCTION timeline.trg_reset_usr() OWNER TO postgres;

SET default_tablespace = '';

SET default_with_oids = false;

--
-- Name: amdsr_data_all; Type: TABLE; Schema: afcap; Owner: creator_role
--

CREATE TABLE afcap.amdsr_data_all (
    coststructure text,
    aftoc_type text,
    md text,
    mds text,
    mds_group text,
    fiscalyear integer,
    amdsrcaiglevel text,
    amdsrelement text,
    inflationcategory text,
    extradata numeric,
    unknown text
);


ALTER TABLE afcap.amdsr_data_all OWNER TO creator_role;

--
-- Name: amdsr_data_cape2014; Type: TABLE; Schema: afcap; Owner: creator_role
--

CREATE TABLE afcap.amdsr_data_cape2014 (
    coststructure text,
    aftoc_type text,
    md text,
    mds text,
    mds_group text,
    fiscalyear integer,
    amdsrcaiglevel text,
    amdsrelement text,
    inflationcategory text,
    grossobs numeric,
    inflcat text
);


ALTER TABLE afcap.amdsr_data_cape2014 OWNER TO creator_role;

--
-- Name: cls_costs_by_eeic; Type: TABLE; Schema: afcap; Owner: creator_role
--

CREATE TABLE afcap.cls_costs_by_eeic (
    fy integer,
    mds text,
    eeic text,
    aftoc_eeic_name text,
    clsgrp text,
    wss_cls_ty numeric
);


ALTER TABLE afcap.cls_costs_by_eeic OWNER TO creator_role;

--
-- Name: cls_eeic_grplst; Type: TABLE; Schema: afcap; Owner: creator_role
--

CREATE TABLE afcap.cls_eeic_grplst (
    clsgrp text,
    cls_eeic text,
    aftoc_eeic_name text,
    grp_source text
);


ALTER TABLE afcap.cls_eeic_grplst OWNER TO creator_role;

--
-- Name: pivot_raw_data; Type: TABLE; Schema: afcap; Owner: creator_role
--

CREATE TABLE afcap.pivot_raw_data (
    majcom text,
    mds text,
    year integer,
    md text,
    mission_operational text,
    mission_aftoc text,
    mds_group_operational text,
    lead_center text,
    logistics_support text,
    hours_aftoc numeric,
    hours_aftoc_operational numeric,
    hours_aftoc_training numeric,
    landings_aftoc_total integer,
    landings_aftoc_operational integer,
    landings_aftoc_training integer,
    sorties_aftoc_total integer,
    sorties_aftoc_operational integer,
    sorties_aftoc_training integer,
    hours_total numeric,
    hours_operational numeric,
    hours_training numeric,
    landings_total integer,
    landings_operational integer,
    landings_training integer,
    sorties_total integer,
    sorties_operational integer,
    sorties_training integer,
    average_inventory integer,
    paa integer,
    yearstartpaa integer,
    yearendpaa integer,
    paa_aftoc integer,
    tai integer,
    ac_available numeric,
    ac_in_depot numeric,
    officer_end_strength integer,
    enlisted_end_strength integer,
    civilian_end_strength integer,
    cannibalizations integer,
    age numeric,
    total_years numeric,
    mc_hrs numeric,
    pmc_hrs numeric,
    nmc_hrs numeric,
    fmc_hrs numeric,
    nmcm_hrs numeric,
    nmcs_hrs numeric,
    possessed_hrs numeric,
    tnmcm_hrs numeric,
    tnmcs_hrs numeric,
    tpmcm_hrs numeric,
    tpmcs_hrs numeric,
    used_hours integer,
    dl_hours_total integer,
    life_completed numeric,
    cat_i integer,
    cat_ii integer,
    cat_iii integer,
    maintenance_actions_induced integer,
    maintenance_actions_inherent integer,
    maintenance_actions_no_defect integer,
    manhours numeric,
    unit_cost numeric,
    inventory_value numeric,
    fuel_cost numeric,
    fuel_gallon integer,
    endofyeartai integer,
    weightedage numeric,
    unitcostsource text,
    dl_hourssource text,
    dl_hoursbestguess text,
    inventorymonths integer,
    ty_approprdte numeric,
    cpm_approprdte numeric,
    inducedfailures integer,
    inherentfailures integer,
    nodefectfailures integer,
    totalfailures integer,
    cpm_gpc numeric,
    ty_gpc numeric,
    cpm_gsd numeric,
    ty_gsd numeric,
    cpm_wss_dpem numeric,
    ty_wss_dpem numeric,
    cpm_wss_cls numeric,
    ty_wss_cls numeric,
    cpm_wss_other numeric,
    ty_wss_other numeric,
    cpm_gross_obs numeric,
    ty_gross_obs numeric,
    ty_missing_manpower_obs numeric,
    cpm_missing_manpower_obs numeric,
    ty_mod_obs numeric,
    cpm_mod_obs numeric,
    ty_missing_ics numeric,
    cpm_missing_ics numeric,
    cpm_civpers numeric,
    ty_civpers numeric,
    cpm_milpers numeric,
    ty_milpers numeric,
    cpm_fixed_costs numeric,
    ty_fixed_costs numeric,
    cpm_variable_costs_fh numeric,
    ty_variable_costs_fh numeric,
    cpm_variable_costs_tai numeric,
    ty_variable_costs_tai numeric,
    cpm_logistics_costs numeric,
    ty_logistics_costs numeric,
    cpm_1_1_1 numeric,
    cpm_1_1_2 numeric,
    cpm_1_1_3 numeric,
    cpm_1_1_4 numeric,
    cpm_1_2_1 numeric,
    cpm_1_2_2 numeric,
    cpm_1_2_3 numeric,
    cpm_1_2_4 numeric,
    cpm_1_3_1 numeric,
    cpm_1_3_2 numeric,
    cpm_1_3_3 numeric,
    cpm_1_3_4 numeric,
    cpm_1_3_5 numeric,
    cpm_2_1_1 numeric,
    cpm_2_1_2 numeric,
    cpm_2_1_5 numeric,
    cpm_2_2_1 numeric,
    cpm_2_2_1_1_1 numeric,
    cpm_2_2_1_1_2 numeric,
    cpm_2_2_1_2 numeric,
    cpm_2_2_2 numeric,
    cpm_2_2_3 numeric,
    cpm_2_3_1 numeric,
    cpm_2_3_1_1 numeric,
    cpm_2_3_1_2 numeric,
    cpm_2_3_2 numeric,
    cpm_2_4_1 numeric,
    cpm_2_4_2 numeric,
    cpm_2_4_3 numeric,
    cpm_2_4_4 numeric,
    cpm_2_4_6 numeric,
    cpm_2_5_1 numeric,
    cpm_2_5_2 numeric,
    cpm_2_5_3 numeric,
    cpm_2_5_4 numeric,
    cpm_3_3 numeric,
    cpm_4_1_1 numeric,
    cpm_4_1_2 numeric,
    cpm_4_1_3 numeric,
    cpm_4_1_4 numeric,
    cpm_4_2 numeric,
    cpm_5_1 numeric,
    cpm_5_2 numeric,
    cpm_5_3 numeric,
    cpm_6_1 numeric,
    cpm_6_2 numeric,
    cpm_6_3 numeric,
    cpm_6_4_1 numeric,
    cpm_6_4_2 numeric,
    cpm_6_5 numeric,
    cpm_6_5_1 numeric,
    cpm_6_5_2 numeric,
    cpm_6_6 numeric,
    cpm_6_7_1 numeric,
    cpm_6_7_2 numeric,
    cpm_7_1_1_1 numeric,
    cpm_7_1_1_2 numeric,
    cpm_7_1_1_3 numeric,
    cpm_7_1_2 numeric,
    cpm_7_1_3 numeric,
    cpm_7_2_1 numeric,
    cpm_7_2_2 numeric,
    ty_1_1_1 numeric,
    ty_1_1_2 numeric,
    ty_1_1_3 numeric,
    ty_1_1_4 numeric,
    ty_1_2_1 numeric,
    ty_1_2_2 numeric,
    ty_1_2_3 numeric,
    ty_1_2_4 numeric,
    ty_1_3_1 numeric,
    ty_1_3_2 numeric,
    ty_1_3_3 numeric,
    ty_1_3_4 numeric,
    ty_1_3_5 numeric,
    ty_2_1_1 numeric,
    ty_2_1_2 numeric,
    ty_2_1_5 numeric,
    ty_2_2_1 numeric,
    ty_2_2_1_1_1 numeric,
    ty_2_2_1_1_2 numeric,
    ty_2_2_1_2 numeric,
    ty_2_2_2 numeric,
    ty_2_2_3 numeric,
    ty_2_3_1 numeric,
    ty_2_3_1_1 numeric,
    ty_2_3_1_2 numeric,
    ty_2_3_2 numeric,
    ty_2_4_1 numeric,
    ty_2_4_2 numeric,
    ty_2_4_3 numeric,
    ty_2_4_4 numeric,
    ty_2_4_6 numeric,
    ty_2_5_1 numeric,
    ty_2_5_2 numeric,
    ty_2_5_3 numeric,
    ty_2_5_4 numeric,
    ty_3_3 numeric,
    ty_4_1_1 numeric,
    ty_4_1_2 numeric,
    ty_4_1_3 numeric,
    ty_4_1_4 numeric,
    ty_4_2 numeric,
    ty_5_1 numeric,
    ty_5_2 numeric,
    ty_5_3 numeric,
    ty_6_1 numeric,
    ty_6_2 numeric,
    ty_6_3 numeric,
    ty_6_4_1 numeric,
    ty_6_4_2 numeric,
    ty_6_5_1 numeric,
    ty_6_5_2 numeric,
    ty_6_6 numeric,
    ty_6_7_1 numeric,
    ty_6_7_2 numeric,
    ty_7_1_1_1 numeric,
    ty_7_1_1_2 numeric,
    ty_7_1_1_3 numeric,
    ty_7_1_1 numeric,
    ty_7_1_2 numeric,
    ty_7_1_3 numeric,
    ty_7_2_1 numeric,
    ty_7_2_2 numeric,
    afweightedaverage integer,
    cpm_totalcontractorsupport numeric,
    ty_totalcontractorsupport numeric,
    cpm_variablecontractorsupport numeric,
    ty_variablecontractorsupport numeric
);


ALTER TABLE afcap.pivot_raw_data OWNER TO creator_role;

--
-- Name: additionalreporting; Type: TABLE; Schema: aficc; Owner: aficc_creator
--

CREATE TABLE aficc.additionalreporting (
    id character(36),
    additionalreportingvalue character varying(10)
);


ALTER TABLE aficc.additionalreporting OWNER TO aficc_creator;

--
-- Name: awardcontractid; Type: TABLE; Schema: aficc; Owner: aficc_creator
--

CREATE TABLE aficc.awardcontractid (
    id character(36) NOT NULL,
    agencyid character(4),
    piid character varying(50),
    modnumber character varying(25),
    transactionnumber integer
);


ALTER TABLE aficc.awardcontractid OWNER TO aficc_creator;

--
-- Name: competitioninformation; Type: TABLE; Schema: aficc; Owner: aficc_creator
--

CREATE TABLE aficc.competitioninformation (
    id character(36) NOT NULL,
    extentcompeted character varying(3),
    reasonnotcompeted character varying(3),
    numberofoffersreceived integer,
    commercialitemacquisitionprocedures character(1),
    commercialitemtestprogram character(1),
    smallbusinesscompetitivenessdemonstrationprogram boolean,
    a76action character(1),
    solicitationprocedures character varying(5),
    typeofsetaside character varying(10),
    evaluatedpreference character varying(6),
    research character(3),
    statutoryexceptiontofairopportunity character varying(4),
    fedbizopps character(1),
    nontraditionalgovernmentcontractorparticipation character(3),
    localareasetaside character(1),
    typeofagreement character(64)
);


ALTER TABLE aficc.competitioninformation OWNER TO aficc_creator;

--
-- Name: contractinformation; Type: TABLE; Schema: aficc; Owner: aficc_creator
--

CREATE TABLE aficc.contractinformation (
    id character(36) NOT NULL,
    typeofcontractpricing character(1),
    undefinitizedaction character(1),
    multiyearcontract character(1),
    typeofidc character(1),
    multipleorsingleawardidc character(1),
    performancebasedservicecontract character(1),
    majorprogramcode character varying(100),
    contingencyhumanitarianpeacekeepingoperation character(1),
    costorpricingdata character(1),
    contractfinancing character(1),
    costaccountingstandardsclause character(1),
    descriptionofcontractrequirement character varying(4000),
    purchasecardaspaymentmethod character(1),
    numberofactions integer,
    nationalinterestactioncode character(4),
    inherentlygovernmentalfunction character varying(1000)
);


ALTER TABLE aficc.contractinformation OWNER TO aficc_creator;

--
-- Name: contractmarketingdata; Type: TABLE; Schema: aficc; Owner: aficc_creator
--

CREATE TABLE aficc.contractmarketingdata (
    id character(36) NOT NULL,
    websiteurl character varying(100),
    whocanuse character varying(255),
    individualorderlimit numeric,
    typeoffeeforuseorservice character varying(3),
    fixedfeevalue numeric,
    feerangelowervalue numeric,
    feerangeuppervalue numeric,
    orderingprocedure character varying(1000),
    feepaidforuseofservice numeric,
    emaileddress character varying(80)
);


ALTER TABLE aficc.contractmarketingdata OWNER TO aficc_creator;

--
-- Name: contractordataa; Type: TABLE; Schema: aficc; Owner: aficc_creator
--

CREATE TABLE aficc.contractordataa (
    id character(36) NOT NULL,
    dunsnumber character(9),
    locationcodestatecodecountrycode character varying(1000),
    principalplaceofperformancename character varying(100),
    countryoforigin character(3),
    congressionaldistrictcontractor character(2),
    congressionaldistrict character(2),
    placeofmanufacture character(1),
    ccrexception character(1),
    placeofperformancezipcode character varying(10),
    cagecode character(5)
);


ALTER TABLE aficc.contractordataa OWNER TO aficc_creator;

--
-- Name: contractordatab; Type: TABLE; Schema: aficc; Owner: aficc_creator
--

CREATE TABLE aficc.contractordatab (
    id character(36) NOT NULL,
    islocalgovernment boolean,
    iscitylocalgovernment boolean,
    iscountylocalgovernment boolean,
    isintermunicipallocalgovernment boolean,
    islocalgovernmentowned boolean,
    ismunicipalitylocalgovernment boolean,
    isschooldistrictlocalgovernment boolean,
    istownshiplocalgovernment boolean,
    isstategovernment boolean,
    isfederalgovernment boolean,
    isfederalgovernmentagency boolean,
    isfederallyfundedresearchanddevelopmentcorp boolean,
    istribalgovernment boolean,
    isforeigngovernment boolean,
    iscommunitydevelopedcorporationownedfirm boolean,
    islaborsurplusareafirm boolean,
    iscorporateentitynottaxexempt boolean,
    iscorporateentitytaxexempt boolean,
    ispartnershiporlimitedliabilitypartnership boolean,
    issolepropreitorship boolean,
    issmallagriculturalcooperative boolean,
    isinternationalorganization boolean,
    isusgovernmententity boolean,
    isverysmallbusiness boolean,
    issbacertified8aprogramparticipant boolean,
    issbacertified8ajointventure boolean,
    isdotcertifieddisadvantagedbusinessenterprise boolean,
    isselfcertifiedsmalldisadvantagedbusiness boolean,
    issbacertifiedhubzone boolean,
    issbacertifiedsmalldisadvantagedbusiness boolean,
    isshelteredworkshop boolean,
    ishistoricallyblackcollegeoruniversity boolean,
    is1862landgrantcollege boolean,
    is1890landgrantcollege boolean,
    is1994landgrantcollege boolean,
    isminorityinstitution boolean,
    isprivateuniversityorcollege boolean,
    isschoolofforestry boolean,
    isstatecontrolledinstitutionofhigherlearning boolean,
    istribalcollege boolean,
    isveterinarycollege boolean,
    iseducationalinstitution boolean,
    isalaskannativeservicinginstitution boolean,
    iscommunitydevelopmentcorporation boolean,
    isnativehawaiianservicinginstitution boolean,
    isdomesticshelter boolean,
    ismanufacturerofgoods boolean,
    ishospital boolean,
    isveterinaryhospital boolean,
    ishispanicservicinginstitution boolean,
    isfoundation boolean,
    iswomenowned boolean,
    isminorityowned boolean,
    iswomenownedsmallbusiness boolean,
    iseconomicallydisadvantagedwomenownedsmallbusiness boolean,
    isjointventurewomenownedsmallbusiness boolean,
    isjointventureeconomicallydisadvantagedwomenownedsmallbusiness boolean,
    isveteranowned boolean,
    isservicerelateddisabledveteranownedbusiness boolean,
    receivescontracts boolean,
    receivesgrants boolean,
    receivescontractsandgrants boolean,
    isairportauthority boolean,
    iscouncilofgovernments boolean,
    ishousingauthoritiespublicortribal boolean,
    isinterstateentity boolean,
    isplanningcommission boolean,
    isportauthority boolean,
    istransitauthority boolean,
    issubchapterscorporation boolean,
    islimitedliabilitycorporation boolean,
    isforeignownedandlocated boolean,
    isamericanindianowned boolean,
    isalaskannativeownedcorporationorfirm boolean,
    isindiantribe boolean,
    isnativehawaiianownedorganizationorfirm boolean,
    istriballyownedfirm boolean,
    isasianpacificamericanownedbusiness boolean,
    isblackamericanownedbusiness boolean,
    ishispanicamericanownedbusiness boolean,
    isnativeamericanownedbusiness boolean,
    issubcontinentasianamericanownedbusiness boolean,
    isotherminorityowned boolean,
    isforprofitorganization boolean,
    isnonprofitorganization boolean,
    isothernotforprofitorganization boolean,
    vendorname character varying(400),
    vendordoingasbusinessname character varying(400),
    streetaddress character varying(150),
    streetaddress2 character varying(150),
    streetaddress3 character varying(150),
    city character varying(40),
    state character varying(55),
    zipcode character varying(50),
    countrycode character varying(3),
    phoneno character varying(30),
    faxno character varying(30)
);


ALTER TABLE aficc.contractordatab OWNER TO aficc_creator;

--
-- Name: dates; Type: TABLE; Schema: aficc; Owner: aficc_creator
--

CREATE TABLE aficc.dates (
    id character(36) NOT NULL,
    signeddate date,
    effectivedate date,
    currentcompletiondate date,
    ultimatecompletiondate date,
    lastdatetoorder date,
    lastmodifieddate date,
    fiscalyear integer,
    solicitationdate date
);


ALTER TABLE aficc.dates OWNER TO aficc_creator;

--
-- Name: documents; Type: TABLE; Schema: aficc; Owner: aficc_creator
--

CREATE TABLE aficc.documents (
    id uuid NOT NULL,
    feed character(10) NOT NULL,
    lastmoddate date NOT NULL,
    start integer NOT NULL,
    document xml NOT NULL
);


ALTER TABLE aficc.documents OWNER TO aficc_creator;

--
-- Name: dollarvalues; Type: TABLE; Schema: aficc; Owner: aficc_creator
--

CREATE TABLE aficc.dollarvalues (
    id character(36) NOT NULL,
    baseandalloptionsvalue numeric,
    baseandexercisedoptionsvalue numeric,
    obligatedamount numeric,
    nongovernmentaldollars numeric,
    totalestimatedordervalue numeric,
    totalbaseandalloptionsvalue numeric,
    totalbaseandexercisedoptionsvalue numeric,
    totalobligatedamount numeric,
    totalnongovernmentaldollars numeric
);


ALTER TABLE aficc.dollarvalues OWNER TO aficc_creator;

--
-- Name: idvid; Type: TABLE; Schema: aficc; Owner: aficc_creator
--

CREATE TABLE aficc.idvid (
    id character(36) NOT NULL,
    agencyid character(4),
    piid character varying(50),
    modnumber character varying(25)
);


ALTER TABLE aficc.idvid OWNER TO aficc_creator;

--
-- Name: legislativemandates; Type: TABLE; Schema: aficc; Owner: aficc_creator
--

CREATE TABLE aficc.legislativemandates (
    id character(36) NOT NULL,
    clingercohenact character(1),
    materialssuppliesarticlesequipment character(1),
    laborstandards character(1),
    constructionwageraterequirements character(1),
    interagencycontractingauthority character(1),
    otherstatutoryauthority character varying(1000)
);


ALTER TABLE aficc.legislativemandates OWNER TO aficc_creator;

--
-- Name: meta; Type: TABLE; Schema: aficc; Owner: aficc_creator
--

CREATE TABLE aficc.meta (
    id character(36) NOT NULL,
    doctype character varying(21),
    fingerprint character varying(4000),
    deleted boolean
);


ALTER TABLE aficc.meta OWNER TO aficc_creator;

--
-- Name: othertransactionawardcontractid; Type: TABLE; Schema: aficc; Owner: aficc_creator
--

CREATE TABLE aficc.othertransactionawardcontractid (
    id character(36) NOT NULL,
    agencyid character(4),
    piid character varying(50),
    modnumber character varying(25)
);


ALTER TABLE aficc.othertransactionawardcontractid OWNER TO aficc_creator;

--
-- Name: othertransactionidvid; Type: TABLE; Schema: aficc; Owner: aficc_creator
--

CREATE TABLE aficc.othertransactionidvid (
    id character(36) NOT NULL,
    agencyid character(4),
    piid character varying(50),
    modnumber character varying(25)
);


ALTER TABLE aficc.othertransactionidvid OWNER TO aficc_creator;

--
-- Name: preferenceprograms; Type: TABLE; Schema: aficc; Owner: aficc_creator
--

CREATE TABLE aficc.preferenceprograms (
    id character(36) NOT NULL,
    contractingofficerbusinesssizedetermination character(1),
    subcontractplan character(1),
    priceevaluationpercentdifference numeric
);


ALTER TABLE aficc.preferenceprograms OWNER TO aficc_creator;

--
-- Name: processed; Type: TABLE; Schema: aficc; Owner: aficc_creator
--

CREATE TABLE aficc.processed (
    id uuid NOT NULL
);


ALTER TABLE aficc.processed OWNER TO aficc_creator;

--
-- Name: productorserviceinformation; Type: TABLE; Schema: aficc; Owner: aficc_creator
--

CREATE TABLE aficc.productorserviceinformation (
    id character(36) NOT NULL,
    productorservicecode character(4),
    systemequipmentcode character varying(4),
    productservicedescription character varying(100),
    claimantprogramcode character varying(3),
    principalnaicscode character(6),
    informationtechnologycommercialitemcategory character(1),
    gfe_gfp character(1),
    useofepadesignatepproducts character(1),
    recoveredmaterialclauses character(1),
    seatransportation character(1),
    contractbundling character(1),
    consolidatedcontract character(1),
    manufacturingorganizationtype character(1)
);


ALTER TABLE aficc.productorserviceinformation OWNER TO aficc_creator;

--
-- Name: purchaserinformation; Type: TABLE; Schema: aficc; Owner: aficc_creator
--

CREATE TABLE aficc.purchaserinformation (
    id character(36) NOT NULL,
    contractingofficeagencyid character(4),
    contractingofficeid character varying(6),
    fundingrequestingagencyid character(4),
    fundingrequestingofficeid character varying(6),
    foreignfunding character(1)
);


ALTER TABLE aficc.purchaserinformation OWNER TO aficc_creator;

--
-- Name: referencedidvid; Type: TABLE; Schema: aficc; Owner: aficc_creator
--

CREATE TABLE aficc.referencedidvid (
    id character(36) NOT NULL,
    agencyid character(4),
    piid character varying(50),
    modnumber character varying(25)
);


ALTER TABLE aficc.referencedidvid OWNER TO aficc_creator;

--
-- Name: solicitationid; Type: TABLE; Schema: aficc; Owner: aficc_creator
--

CREATE TABLE aficc.solicitationid (
    id character(36) NOT NULL,
    solicitationid character varying(25)
);


ALTER TABLE aficc.solicitationid OWNER TO aficc_creator;

--
-- Name: transactioninformation; Type: TABLE; Schema: aficc; Owner: aficc_creator
--

CREATE TABLE aficc.transactioninformation (
    id character(36) NOT NULL,
    contractactiontype character(1),
    reasonformodification character(1)
);


ALTER TABLE aficc.transactioninformation OWNER TO aficc_creator;

--
-- Name: translog; Type: TABLE; Schema: aficc; Owner: aficc_creator
--

CREATE TABLE aficc.translog (
    atom_id uuid NOT NULL,
    record_id uuid NOT NULL,
    transdate timestamp without time zone NOT NULL
);


ALTER TABLE aficc.translog OWNER TO aficc_creator;

--
-- Name: treasuryaccount; Type: TABLE; Schema: aficc; Owner: aficc_creator
--

CREATE TABLE aficc.treasuryaccount (
    id character(36),
    agencyidentifier character(2),
    mainaccountcode character(2),
    subaccountcode character(3),
    initiative character varying(50)
);


ALTER TABLE aficc.treasuryaccount OWNER TO aficc_creator;

--
-- Name: afems_asst_in_tran; Type: TABLE; Schema: lodm; Owner: lodm_creator
--

CREATE TABLE lodm.afems_asst_in_tran (
    bus_view_dt date,
    doc_nr character varying(30),
    doc_nr_sufx_cd character varying(30),
    stk_nbr_id character varying(30),
    gain_sran_id character varying(30),
    lsg_sran_id character varying(30),
    rcevd_svcbl_qy numeric(32,10),
    rcevd_unsvc_qy numeric(32,10),
    shpd_ordnl_dt date,
    rcpt_dt date,
    gain_sran_org_cd character varying(30),
    gain_sran_shop_cd character varying(30),
    gain_sran_in_use_ddn_id character varying(30),
    in_transit_dplymt_in_cd character varying(30),
    intrn_shp_svc_qty numeric(32,10),
    intr_shp_unsvc_qty numeric(32,10),
    ast_intrn_trans_dt date,
    lst_updt_usr_nm character varying(30),
    dw_start_dt_tm timestamp without time zone,
    dw_end_dt_tm timestamp without time zone,
    fil_rcd_nr numeric(32,10),
    dw_batch_nr numeric(32,10),
    data_extrt_id_nr numeric(32,10)
);


ALTER TABLE lodm.afems_asst_in_tran OWNER TO lodm_creator;

--
-- Name: test; Type: TABLE; Schema: lodm; Owner: lodm_creator
--

CREATE TABLE lodm.test (
    name character varying(6)
);


ALTER TABLE lodm.test OWNER TO lodm_creator;

--
-- Name: afsc_civ_auth_asgd; Type: TABLE; Schema: manpower; Owner: creator_role
--

CREATE TABLE manpower.afsc_civ_auth_asgd (
    month_id integer,
    component character varying(25),
    afs character varying(5),
    afs_desc character varying(150),
    afsc_deskill character varying(10),
    afsc character varying(10),
    pec character varying(10),
    pec_desc character varying(100),
    osc character varying(20),
    pas character varying(15),
    majcom character varying(100),
    pas_nr character varying(10),
    uic character varying(10),
    unit_desc character varying(50),
    installation_loc_name character varying(50),
    eofy_auth integer,
    asgd integer,
    req_auth integer
);


ALTER TABLE manpower.afsc_civ_auth_asgd OWNER TO creator_role;

--
-- Name: afsc_military; Type: TABLE; Schema: manpower; Owner: creator_role
--

CREATE TABLE manpower.afsc_military (
    month_id integer,
    component character varying(25),
    cat_employment character varying(15),
    afs character varying(5),
    afs_desc character varying(150),
    afsc_deskill character varying(10),
    afsc_desc character varying(150),
    afsc character varying(10),
    pec character varying(10),
    pec_desc character varying(100),
    skl_lvl character varying(5),
    osc character varying(10),
    pas character varying(15),
    majcom character varying(100),
    pas_nr character varying(10),
    uic character varying(10),
    unit_desc character varying(50),
    installation_loc_name character varying(50),
    eofy_auth integer,
    asgd integer,
    req_auth integer
);


ALTER TABLE manpower.afsc_military OWNER TO creator_role;

--
-- Name: icao; Type: TABLE; Schema: master_ref; Owner: creator_role
--

CREATE TABLE master_ref.icao (
    icao_loc_id character varying(10),
    start_dt_tm timestamp(6) without time zone,
    icao_loc_nm character varying(50),
    st_or_ctry_cd character varying(5),
    st_or_ctry_nm character varying(25),
    stop_dt_tm timestamp(6) without time zone,
    lst_post_dt_tm timestamp(6) without time zone,
    procs_id character varying(10),
    updt_procs_id character varying(10),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba character varying(5),
    two_digit_icao character varying(2),
    ctry_or_region_nm character varying(75)
);


ALTER TABLE master_ref.icao OWNER TO creator_role;

--
-- Name: test; Type: TABLE; Schema: mytest; Owner: creator_role
--

CREATE TABLE mytest.test (
    col1 integer
);


ALTER TABLE mytest.test OWNER TO creator_role;

--
-- Name: acft_config_id; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.acft_config_id (
    config_id character(2) NOT NULL,
    start_dt_tm timestamp(6) without time zone NOT NULL,
    stop_dt_tm timestamp(6) without time zone,
    comments_tx character(54),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.acft_config_id OWNER TO creator_role;

--
-- Name: actn_taken_cd; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.actn_taken_cd (
    actn_taken_cd character(1) NOT NULL,
    start_dt_tm timestamp(6) without time zone NOT NULL,
    on_equip_in character(1),
    off_equip_in character(1),
    nomenclature_tx character(60),
    stop_dt_tm timestamp(6) without time zone,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.actn_taken_cd OWNER TO creator_role;

--
-- Name: actual_config; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.actual_config (
    actual_config_nbr_id numeric(10,0) NOT NULL,
    higher_assy_sn_id character(15),
    higher_assy_equip_desig_id character(15),
    higher_assy_cage_cd character(5),
    higher_assy_lot_number_id character(15),
    equip_desig_id character(15),
    lower_assy_sn_id character(15),
    lower_assy_lot_nbr_id character(15),
    inst_dt_tm timestamp(6) without time zone,
    sn_id character(15),
    remove_dt_tm timestamp(6) without time zone,
    lower_assy_equip_desig_id character(15),
    higher_assy_type_equip_tx character(1),
    lower_assy_cage_cd character(5),
    higher_assy_wuc_cd character(15),
    higher_assy_loc_id character(15),
    lower_assy_type_equip_tx character(1),
    lower_assy_wuc_cd character(15),
    lower_assy_loc_id character(15),
    inst_cmd_cd character(3),
    inst_geo_loc_id character(4),
    inst_unit_id character(1),
    multi_config_cd character(3),
    inst_job_ctrl_nbr_id character(9),
    inst_work_ctr_event_id integer,
    deviation_nbr_id character(5),
    inst_ddr_seq_nbr_id integer,
    inst_on_or_off_in character(1),
    remove_cmd_cd character(3),
    remove_geo_loc_id character(4),
    remove_unit_id character(1),
    remove_job_ctrl_nbr_id character(9),
    remove_work_ctr_event_id integer,
    remove_ddr_seq_nbr_id integer,
    remove_on_or_off_in character(1),
    forced_update_in character(1),
    higher_assy_prev_op_tm numeric(11,1),
    higher_assy_curr_op_tm numeric(11,1),
    lower_assy_prev_op_tm numeric(11,1),
    lower_assy_curr_op_tm numeric(11,1),
    inst_maint_actn_nbr_id numeric(10,0),
    remove_maint_actn_nbr_id numeric(10,0),
    inst_proc_id character(8),
    remove_proc_id character(8),
    inst_org_nbr_id integer,
    inst_org_kind_tx character(3),
    inst_org_type_tx character(2),
    inst_srd_id character(3),
    inst_fsc integer,
    remove_org_nbr_id integer,
    remove_org_kind_tx character(3),
    remove_org_type_tx character(2),
    remove_srd_id character(3),
    remove_fsc integer,
    maint_type_interval_tm character(1),
    inst_last_update_tm timestamp(6) without time zone,
    inst_inspected_by_nm integer,
    remove_last_update_tm timestamp(6) without time zone,
    remove_inpsected_by_nm integer,
    orig_inst_cmd_cd character(3),
    orig_remove_cmd_cd character(3),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.actual_config OWNER TO creator_role;

--
-- Name: actual_config_wuc; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.actual_config_wuc (
    actual_config_nbr_id numeric(10,0) NOT NULL,
    wuc_cd character(15) NOT NULL,
    wuc_in character(1) NOT NULL,
    start_dt_tm timestamp(6) without time zone NOT NULL,
    stop_dt_tm timestamp(6) without time zone,
    stop_yr_mo integer,
    start_yr_mo integer,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.actual_config_wuc OWNER TO creator_role;

--
-- Name: actual_software_inst; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.actual_software_inst (
    software_inst_nbr_id numeric(11,0) NOT NULL,
    higher_assy_equip_desig_id character(15),
    higher_assy_cage_cd character(5),
    higher_assy_sn_id character(15),
    loc_id character(15),
    cptr_prog_id_nbr_prefix_tx character(2),
    cptr_prog_nbr_id character(40),
    stop_dt_tm timestamp(6) without time zone,
    cptr_prog_id_nbr_suffix_tx character(6),
    type_equip_id character(1),
    start_dt_tm timestamp(6) without time zone,
    overwritten_cpin_prefix_tx character(2),
    multi_config_cd character(3),
    overwritten_cpin character(40),
    overwritten_cpin_suffix_tx character(6),
    tcto_data_cd character(7),
    forced_update_in character(1),
    org_nbr_id integer,
    org_kind_tx character(3),
    org_type_tx character(2),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.actual_software_inst OWNER TO creator_role;

--
-- Name: air_staff_alloc; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.air_staff_alloc (
    arbitrary_id numeric(10,0) NOT NULL,
    cmd_cd character(3) NOT NULL,
    equip_desig_id character(15),
    prog_element_cd character(10),
    group_id character(1) NOT NULL,
    purp_cd character(2) NOT NULL,
    as_of_dt_tm timestamp(6) without time zone NOT NULL,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.air_staff_alloc OWNER TO creator_role;

--
-- Name: air_staff_alloc_detail; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.air_staff_alloc_detail (
    arbitrary_id numeric(10,0) NOT NULL,
    yr_id integer NOT NULL,
    qtr_id integer NOT NULL,
    start_cycle_id integer NOT NULL,
    stop_cycle_id integer NOT NULL,
    hrs_alloc_am numeric(7,0) NOT NULL,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.air_staff_alloc_detail OWNER TO creator_role;

--
-- Name: alc_validation; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.alc_validation (
    managing_alc_cd character(2) NOT NULL,
    alc_cd character(2),
    responsible_alc_cd character(1),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.alc_validation OWNER TO creator_role;

--
-- Name: allowable_condition_stat; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.allowable_condition_stat (
    purp_cd character(2) NOT NULL,
    stat_cd character(1) NOT NULL,
    start_dt_tm timestamp(6) without time zone NOT NULL,
    stop_dt_tm timestamp(6) without time zone NOT NULL,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.allowable_condition_stat OWNER TO creator_role;

--
-- Name: approve_indicators; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.approve_indicators (
    equip_desig_id character(15) NOT NULL,
    cage_cd_in character(1),
    block_nbr_in character(1),
    loc_in character(1),
    multi_config_in character(1),
    psn_wuc_in character(1),
    spinob_check_in character(1),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.approve_indicators OWNER TO creator_role;

--
-- Name: appvd_compatibility_edits; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.appvd_compatibility_edits (
    equip_desig_id character(15) NOT NULL,
    block_nbr_id character(3) NOT NULL,
    wuc_cd character(15) NOT NULL,
    part_nbr_id character(15) NOT NULL,
    sn_id character(15) NOT NULL,
    start_dt_tm timestamp(6) without time zone NOT NULL,
    stop_dt_tm timestamp(6) without time zone,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.appvd_compatibility_edits OWNER TO creator_role;

--
-- Name: appvd_config; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.appvd_config (
    alc_cd character(2) NOT NULL,
    equip_desig_id character(15) NOT NULL,
    sn_id character(15) NOT NULL,
    multi_config_cd character(3) NOT NULL,
    start_dt_tm timestamp(6) without time zone NOT NULL,
    stop_dt_tm timestamp(6) without time zone,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.appvd_config OWNER TO creator_role;

--
-- Name: appvd_config_var; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.appvd_config_var (
    alc_cd character(2) NOT NULL,
    equip_desig_id character(15) NOT NULL,
    sn_id character(15) NOT NULL,
    cage_cd character(5) NOT NULL,
    deviation_nbr_id character(5) NOT NULL,
    lot_nbr_id character(15) NOT NULL,
    stop_dt_tm timestamp(6) without time zone,
    start_dt_tm timestamp(6) without time zone,
    appvd_config_var_stat_tx character(1),
    type_equip_id character(1),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.appvd_config_var OWNER TO creator_role;

--
-- Name: appvd_cpin_itm_list; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.appvd_cpin_itm_list (
    alc_cd character(2) NOT NULL,
    equip_desig_id character(15) NOT NULL,
    cptr_prog_id_nbr_prefix_tx character(2) NOT NULL,
    cptr_prog_nbr_id character(40) NOT NULL,
    cptr_prog_id_suffix_tx character(6) NOT NULL,
    multi_config_cd character(3) NOT NULL,
    block_nbr_id character(3) NOT NULL,
    loc_id character(15) NOT NULL,
    lower_assy_equip_desig_id character(15) NOT NULL,
    start_dt_tm timestamp(6) without time zone NOT NULL,
    lower_assy_cage_cd character(5) NOT NULL,
    stop_dt_tm timestamp(6) without time zone,
    basic_in character(1),
    appvd_cpin_roll_in character(1),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.appvd_cpin_itm_list OWNER TO creator_role;

--
-- Name: appvd_end_itm_list; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.appvd_end_itm_list (
    alc_cd character(2) NOT NULL,
    equip_desig_id character(15) NOT NULL,
    multi_config_cd character(3) NOT NULL,
    lower_assy_wuc_cd character(15) NOT NULL,
    block_nbr_id character(3) NOT NULL,
    loc_id character(15) NOT NULL,
    lower_assy_equip_desig_id character(15) NOT NULL,
    start_dt_tm timestamp(6) without time zone NOT NULL,
    lower_assy_cage_cd character(5) NOT NULL,
    stop_dt_tm timestamp(6) without time zone,
    per_loc_qy integer,
    appvd_exceptions_in character(1),
    criticality_in character(1),
    basic_in character(1),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.appvd_end_itm_list OWNER TO creator_role;

--
-- Name: appvd_lower_higher_assy; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.appvd_lower_higher_assy (
    alc_cd character(2) NOT NULL,
    equip_desig_id character(15) NOT NULL,
    higher_assy_equip_desig_id character(15) NOT NULL,
    higher_assy_cage_cd character(5) NOT NULL,
    higher_assy_loc_id character(15) NOT NULL,
    higher_assy_wuc_cd character(15) NOT NULL,
    multi_config_cd character(3) NOT NULL,
    block_nbr_id character(3) NOT NULL,
    lower_assy_equip_desig_id character(15) NOT NULL,
    lower_assy_cage_cd character(5) NOT NULL,
    lower_assy_wuc_cd character(15) NOT NULL,
    start_dt_tm timestamp(6) without time zone NOT NULL,
    loc_id character(15) NOT NULL,
    stop_dt_tm timestamp(6) without time zone,
    per_loc_qy integer,
    appvd_exceptions_in character(1),
    basic_in character(1),
    criticality_in character(1),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.appvd_lower_higher_assy OWNER TO creator_role;

--
-- Name: appvd_sn_exception; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.appvd_sn_exception (
    alc_cd character(2) NOT NULL,
    equip_desig_id character(15) NOT NULL,
    higher_assy_wuc_cd character(15) NOT NULL,
    wuc_cd character(15) NOT NULL,
    higher_assy_loc_id character(15) NOT NULL,
    lower_assy_equip_desig_id character(15) NOT NULL,
    sn_id character(15) NOT NULL,
    lower_assy_cage_cd character(5) NOT NULL,
    higher_assy_equip_desig_id character(15) NOT NULL,
    multi_config_cd character(3) NOT NULL,
    higher_assy_cage_cd character(5) NOT NULL,
    block_nbr_id character(3) NOT NULL,
    start_dt_tm timestamp(6) without time zone NOT NULL,
    loc_id character(15) NOT NULL,
    per_loc_qy integer,
    stop_dt_tm timestamp(6) without time zone,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.appvd_sn_exception OWNER TO creator_role;

--
-- Name: asset_type; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.asset_type (
    alc_cd character(2) NOT NULL,
    equip_desig_id character(15) NOT NULL,
    cage_cd character(5) NOT NULL,
    mission_tx character(1),
    design_tx character(3),
    config_itm_id character(7),
    type_equip_id character(1),
    nomenclature_tx character(35),
    natl_itm_id_nbr_id character(9),
    commodity_cd character(1),
    mgmt_div_tx character(3),
    sys_manager_cd character(3),
    unit_cost_am integer,
    start_dt_tm timestamp(6) without time zone,
    managing_alc_cd character(2),
    stop_dt_tm timestamp(6) without time zone,
    appvd_block_nbr_in character(1),
    appvd_config_in character(1),
    appvd_loc_id_in character(1),
    appvd_cpin_block_nbr_in character(1),
    appvd_cpin_config_in character(1),
    appvd_cpin_loc_id_in character(1),
    fsc_id character(2),
    fsg_id character(2),
    material_mgmt_cd character(2),
    errc_cd character(3),
    technician_desig_id character(2),
    block_managed_in character(1),
    prev_niin_id character(9),
    egress_in character(1),
    egress_confirm_dt_tm timestamp(6) without time zone NOT NULL,
    assig_mission_in character(1) NOT NULL,
    sys_level_rpting_req_in character(1),
    permitted_as_lower_end_itm_in character(1),
    util_rpt_in character(1),
    lcn_in character(1),
    cage_assig_in character(1),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer,
    icbm_in character(1),
    wuc_assig_in character(1) NOT NULL,
    auto_remove_in character(1),
    inst_spin_to_end_itm_only_in character(1)
);


ALTER TABLE remis.asset_type OWNER TO creator_role;

--
-- Name: ate_stat; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.ate_stat (
    arbitrary_id numeric(10,0) NOT NULL,
    stat_cd character(1) NOT NULL,
    wuc_cd character(15) NOT NULL,
    loc_id character(15) NOT NULL,
    stat_type character(1) NOT NULL,
    start_dt_tm timestamp(6) without time zone NOT NULL,
    test_station_broken_idx numeric(3,1) NOT NULL,
    stat_narrative_tx character(30),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.ate_stat OWNER TO creator_role;

--
-- Name: ate_util; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.ate_util (
    arbitrary_id numeric(10,0) NOT NULL,
    lru_equip_desig_id character(15),
    lru_sn_id character(15) NOT NULL,
    lru_wuc_cd character(15) NOT NULL,
    lru_source_cd character(5) NOT NULL,
    actn_taken_cd character(1) NOT NULL,
    how_mal_cd integer NOT NULL,
    yr_id integer NOT NULL,
    mo_id integer NOT NULL,
    start_dt_tm timestamp(6) without time zone NOT NULL,
    stop_dt_tm timestamp(6) without time zone NOT NULL,
    test_complete_in numeric(1,0) NOT NULL,
    test_narrative_cd character(4) NOT NULL,
    hrs_am numeric(6,1) NOT NULL,
    ate_type_util_cd character(1) NOT NULL,
    end_itm_equip_desig_id character(15) NOT NULL,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.ate_util OWNER TO creator_role;

--
-- Name: ce_active_inactive; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.ce_active_inactive (
    arbitrary_id numeric(10,0) NOT NULL,
    active_inactive_in character(1) NOT NULL,
    start_dt_tm timestamp(6) without time zone NOT NULL,
    stop_dt_tm timestamp(6) without time zone NOT NULL,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer,
    cams_error_correct_seq_nbr_id character(11) NOT NULL
);


ALTER TABLE remis.ce_active_inactive OWNER TO creator_role;

--
-- Name: ce_comment; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.ce_comment (
    arbitrary_id numeric(10,0) NOT NULL,
    rpting_nbr_id character(9) NOT NULL,
    start_dt_tm timestamp(6) without time zone NOT NULL,
    comment_seq_nr numeric(5,0) NOT NULL,
    comment_tx character(40) NOT NULL,
    archive_in character(1) NOT NULL,
    cams_error_correct_seq_nbr_id character(11) NOT NULL,
    stat_delay_in character(1),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.ce_comment OWNER TO creator_role;

--
-- Name: ce_delay_comment; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.ce_delay_comment (
    arbitrary_id numeric(10,0) NOT NULL,
    rpting_nbr_id character(9) NOT NULL,
    rpting_seq_id character(1) NOT NULL,
    delay_seq_id character(1) NOT NULL,
    comment_seq_id character(1) NOT NULL,
    comment_tx character(54) NOT NULL,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer,
    cams_error_correct_seq_nbr_id character(11) NOT NULL
);


ALTER TABLE remis.ce_delay_comment OWNER TO creator_role;

--
-- Name: ce_possession; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.ce_possession (
    arbitrary_id numeric(10,0) NOT NULL,
    equip_desig_id character(15),
    sn_id character(15) NOT NULL,
    start_dt_tm timestamp(6) without time zone NOT NULL,
    stop_dt_tm timestamp(6) without time zone NOT NULL,
    cmd_cd character(3) NOT NULL,
    org_nbr_id integer,
    org_kind_tx character(3),
    org_type_tx character(2),
    detachment_nbr_id character(2) NOT NULL,
    geo_loc_id character(4) NOT NULL,
    req_cmd_cd character(3) NOT NULL,
    cmd_option_tx character(13) NOT NULL,
    rpting_level_cd character(1) NOT NULL,
    type_equip_id character(1),
    data_proc_ctr_nbr_id integer NOT NULL,
    install_dt_tm timestamp(6) without time zone NOT NULL,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer,
    cams_error_correct_seq_nbr_id character(11) NOT NULL
);


ALTER TABLE remis.ce_possession OWNER TO creator_role;

--
-- Name: ce_reason_cd; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.ce_reason_cd (
    type_cd character(8) NOT NULL,
    downtime_delay_cd character(9) NOT NULL,
    start_dt_tm timestamp(6) without time zone NOT NULL,
    stop_dt_tm timestamp(6) without time zone NOT NULL,
    reason_cd character(1) NOT NULL,
    reason_narrative_tx character(54) NOT NULL,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.ce_reason_cd OWNER TO creator_role;

--
-- Name: ce_stat; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.ce_stat (
    arbitrary_id numeric(10,0) NOT NULL,
    rpting_nbr_id character(9) NOT NULL,
    rpting_seq_id character(1) NOT NULL,
    start_dt_tm timestamp(6) without time zone NOT NULL,
    stop_dt_tm timestamp(6) without time zone NOT NULL,
    down_time_cd character(1) NOT NULL,
    wuc_cd character(15) NOT NULL,
    capability_impact_cd character(1) NOT NULL,
    status_channel_in character(3) NOT NULL,
    cmd_option_tx character(13) NOT NULL,
    active_inactive_in character(1) NOT NULL,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.ce_stat OWNER TO creator_role;

--
-- Name: ce_stat_cd; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.ce_stat_cd (
    status_acronym_id character(5) NOT NULL,
    start_dt_tm timestamp(6) without time zone NOT NULL,
    stop_dt_tm timestamp(6) without time zone NOT NULL,
    status_cd character(1) NOT NULL,
    status_narrative_tx character(54) NOT NULL,
    severity_in integer NOT NULL,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.ce_stat_cd OWNER TO creator_role;

--
-- Name: ce_stat_comment; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.ce_stat_comment (
    arbitrary_id numeric(10,0) NOT NULL,
    rpting_nbr_id character(9) NOT NULL,
    rpting_seq_id character(1) NOT NULL,
    comment_seq_id character(1) NOT NULL,
    comment_tx character(54) NOT NULL,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer,
    cams_error_correct_seq_nbr_id character(11) NOT NULL
);


ALTER TABLE remis.ce_stat_comment OWNER TO creator_role;

--
-- Name: ce_stat_delay; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.ce_stat_delay (
    arbitrary_id numeric(10,0) NOT NULL,
    rpting_nbr_id character(9) NOT NULL,
    rpting_seq_id character(1) NOT NULL,
    delay_seq_id character(1) NOT NULL,
    start_dt_tm timestamp(6) without time zone NOT NULL,
    stop_dt_tm timestamp(6) without time zone NOT NULL,
    delay_cd character(1) NOT NULL,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.ce_stat_delay OWNER TO creator_role;

--
-- Name: ce_status; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.ce_status (
    arbitrary_id numeric(10,0) NOT NULL,
    rpting_nbr_id character(9) NOT NULL,
    start_dt_tm timestamp(6) without time zone NOT NULL,
    stop_dt_tm timestamp(6) without time zone NOT NULL,
    start_processed_dt_tm timestamp(6) without time zone NOT NULL,
    stop_processed_dt_tm timestamp(6) without time zone NOT NULL,
    status_cd character(1) NOT NULL,
    reason_cd character(1),
    wuc_cd character(15) NOT NULL,
    status_channel_in character(3) NOT NULL,
    cmd_option_tx character(13) NOT NULL,
    active_inactive_in character(1) NOT NULL,
    recon_dt_tm character(9) NOT NULL,
    archive_in character(1) NOT NULL,
    cams_error_correct_seq_nbr_id character(11) NOT NULL,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.ce_status OWNER TO creator_role;

--
-- Name: cmd_cd; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.cmd_cd (
    cmd_cd character(3) NOT NULL,
    nomenclature_tx character(35),
    major_cmd_cd character(2),
    cmd_id character(3),
    start_dt_tm timestamp(6) without time zone NOT NULL,
    stop_dt_tm timestamp(6) without time zone,
    type_alloc_in integer,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.cmd_cd OWNER TO creator_role;

--
-- Name: cmd_purp_cd; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.cmd_purp_cd (
    cmd_cd character(3) NOT NULL,
    start_dt_tm timestamp(6) without time zone NOT NULL,
    purp_cd character(2) NOT NULL,
    allowable_assig_purp character(1),
    allowable_possess_purp character(1),
    stop_dt_tm timestamp(6) without time zone,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.cmd_purp_cd OWNER TO creator_role;

--
-- Name: cndctv_pth_fail_caus; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.cndctv_pth_fail_caus (
    cndctv_pth_failed_elem_typ_cd character(10) NOT NULL,
    cndctv_pth_fail_caus_tx character varying(50) NOT NULL,
    strt_dt_tm timestamp(6) without time zone NOT NULL,
    stp_dt_tm timestamp(6) without time zone,
    rmk_tx character varying(80),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.cndctv_pth_fail_caus OWNER TO creator_role;

--
-- Name: cndctv_pth_fail_md; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.cndctv_pth_fail_md (
    cndctv_pth_fail_md_cd character(15) NOT NULL,
    strt_dt_tm timestamp(6) without time zone NOT NULL,
    stp_dt_tm timestamp(6) without time zone,
    rmk_tx character varying(80),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.cndctv_pth_fail_md OWNER TO creator_role;

--
-- Name: cndctv_pth_failed_elem_typ; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.cndctv_pth_failed_elem_typ (
    cndctv_pth_failed_elem_typ_cd character(10) NOT NULL,
    strt_dt_tm timestamp(6) without time zone NOT NULL,
    stp_dt_tm timestamp(6) without time zone,
    rmk_tx character varying(80),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.cndctv_pth_failed_elem_typ OWNER TO creator_role;

--
-- Name: cndctv_pth_soln; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.cndctv_pth_soln (
    cndctv_pth_failed_elem_typ_cd character(10) NOT NULL,
    cndctv_pth_soln_tx character varying(50) NOT NULL,
    strt_dt_tm timestamp(6) without time zone NOT NULL,
    stp_dt_tm timestamp(6) without time zone,
    rmk_tx character varying(80),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.cndctv_pth_soln OWNER TO creator_role;

--
-- Name: comm_electnc_smry; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.comm_electnc_smry (
    arb_id numeric(10,0) NOT NULL,
    yr_id numeric(4,0) NOT NULL,
    mo_id numeric(2,0) NOT NULL,
    actv_inactv_in character(1) NOT NULL,
    stat_acron_tx character varying(32) NOT NULL,
    unt_of_msr_tx character varying(32) NOT NULL,
    val_qy numeric(6,1),
    lm_dt_tm timestamp(6) without time zone,
    remis_rba integer,
    remis_dt_tm timestamp(6) without time zone
);


ALTER TABLE remis.comm_electnc_smry OWNER TO creator_role;

--
-- Name: config_cd; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.config_cd (
    alc_cd character(2) NOT NULL,
    equip_desig_id character(15) NOT NULL,
    multi_config_cd character(3) NOT NULL,
    block_nbr_id character(3) NOT NULL,
    start_dt_tm timestamp(6) without time zone NOT NULL,
    stop_dt_tm timestamp(6) without time zone,
    config_tx character(100),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.config_cd OWNER TO creator_role;

--
-- Name: contr_mnem; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.contr_mnem (
    rcd_mnem_cd character(16) NOT NULL,
    contr_cd character(5) NOT NULL,
    start_dt_tm timestamp(6) without time zone NOT NULL,
    stop_dt_tm timestamp(6) without time zone NOT NULL,
    data_proc_ctr_nbr_id character(4) NOT NULL,
    nomen_tx character(35) NOT NULL,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.contr_mnem OWNER TO creator_role;

--
-- Name: contr_outbd_crit; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.contr_outbd_crit (
    rcd_mnem_cd character(16) NOT NULL,
    contr_cd character(5) NOT NULL,
    equip_desig_id character(15) NOT NULL,
    srd_id character(3) NOT NULL,
    wuc_cd character(15) NOT NULL,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.contr_outbd_crit OWNER TO creator_role;

--
-- Name: cpin_software_config; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.cpin_software_config (
    master_cpin_prefix_tx character(2) NOT NULL,
    master_cpin_id character(40) NOT NULL,
    cptr_prog_id_nbr_prefix_tx character(2) NOT NULL,
    master_cpin_suffix_tx character(6) NOT NULL,
    cptr_prog_id_nbr_id character(40) NOT NULL,
    cptr_prog_id_nbr_suffix_tx character(6) NOT NULL,
    as_of_dt_tm timestamp(6) without time zone,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.cpin_software_config OWNER TO creator_role;

--
-- Name: cptr_prg_id_nbr; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.cptr_prg_id_nbr (
    cptr_prog_id_nbr_prefix_tx character(2) NOT NULL,
    cptr_prog_id_nbr_id character(40) NOT NULL,
    equip_desig_id character(15),
    cptr_id_nbr_suffix_tx character(6) NOT NULL,
    csci_prog_title_tx character(86),
    natl_itm_id_nbr_id character(9),
    test_station_id character(40),
    subsys_nbr_id character(15),
    software_dt timestamp(6) without time zone,
    del_flag_in character(1),
    software_type_cd character(1),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.cptr_prg_id_nbr OWNER TO creator_role;

--
-- Name: debrief_deviation; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.debrief_deviation (
    mission_chargeable_in character(1) NOT NULL,
    deviation_remarks_tx character(80) NOT NULL,
    deviation_cd character(2) NOT NULL,
    debrief_nbr_id numeric(10,0),
    cause_cd character(3) NOT NULL,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.debrief_deviation OWNER TO creator_role;

--
-- Name: debrief_discrep; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.debrief_discrep (
    debrief_nbr_id numeric(10,0) NOT NULL,
    unit_id character(1) NOT NULL,
    job_ctrl_nbr_id character(9) NOT NULL,
    subsys_block_nbr_id integer,
    subsys_wuc_cd character(15),
    capability_cd integer,
    repeat_nbr_am integer,
    recur_nbr_am integer,
    fault_cd character(15),
    maint_fault_1_cd character(8),
    maint_fault_2_cd character(8),
    discrep_narrative_tx character varying(540),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.debrief_discrep OWNER TO creator_role;

--
-- Name: debrief_flight; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.debrief_flight (
    debrief_nbr_id numeric(10,0) NOT NULL,
    equip_desig_id character(15),
    sn_id character(15),
    cmd_cd character(3),
    org_nbr_id integer,
    org_kind_tx character(3),
    org_type_tx character(2),
    geo_loc_id character(4),
    sortie_mod integer,
    sortie_of_day_am integer,
    scheduled_start_dt_tm timestamp(6) without time zone,
    mission_cd character(7),
    block_nbr_id character(3),
    sortie_effectiveness_am character(1),
    noneffectiveness_cause_cd character(3),
    sortie_nbr_id integer,
    scheduled_in character(1),
    landing_stat_cd integer,
    subsys_wuc_cd character(3),
    flight_remarks_tx character varying(180),
    sortie_dt integer,
    sortie_integer_dt timestamp(6) without time zone,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.debrief_flight OWNER TO creator_role;

--
-- Name: debrief_sys; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.debrief_sys (
    debrief_nbr_id numeric(10,0) NOT NULL,
    subsys_block_nbr_id integer NOT NULL,
    subsys_wuc_cd character(3),
    capability_cd integer,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.debrief_sys OWNER TO creator_role;

--
-- Name: detachment_nbr; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.detachment_nbr (
    org_nbr_id integer,
    org_kind_tx character(3) NOT NULL,
    org_type_tx character(2) NOT NULL,
    start_dt_tm timestamp(6) without time zone NOT NULL,
    detachment_nbr_id character(2) NOT NULL,
    cmd_cd character(3),
    stop_dt_tm timestamp(6) without time zone,
    org_level character(1),
    stock_rec_acct_nbr_id character(6),
    inst_cmd_cd character(3),
    state_or_ctry_cd character(2),
    data_proc_ctr_nbr_id integer,
    data_sys_desig_id character(5),
    geo_loc_id character(4) NOT NULL,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer,
    last_post_dt_tm timestamp(6) without time zone NOT NULL
);


ALTER TABLE remis.detachment_nbr OWNER TO creator_role;

--
-- Name: deviation_cd; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.deviation_cd (
    deviation_cd character(2) NOT NULL,
    start_dt_tm timestamp(6) without time zone NOT NULL,
    deviation_type character(1),
    narrative_tx character(30),
    stop_dt_tm timestamp(6) without time zone,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.deviation_cd OWNER TO creator_role;

--
-- Name: deviation_waiver; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.deviation_waiver (
    alc_cd character(2) NOT NULL,
    equip_desig_id character(15) NOT NULL,
    cage_cd character(5) NOT NULL,
    deviation_nbr_id character(5) NOT NULL,
    lower_assy_equip_desig_id character(15) NOT NULL,
    lower_assy_cage_cd character(5) NOT NULL,
    type_equip_id character(1),
    srd_id character(3),
    del_flag_in character(1),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.deviation_waiver OWNER TO creator_role;

--
-- Name: deviation_waiver_txt; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.deviation_waiver_txt (
    alc_cd character(2) NOT NULL,
    equip_desig_id character(15) NOT NULL,
    cage_cd character(5) NOT NULL,
    deviation_nbr_id character(5) NOT NULL,
    ecp_nbr_id character(12),
    severity_in character(2),
    type_equip_id character(1),
    initial_ver_in character(1),
    deviation_tx character varying(540),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.deviation_waiver_txt OWNER TO creator_role;

--
-- Name: elem; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.elem (
    elem_mnmnc_id character(16) NOT NULL,
    nm_tx character(80) NOT NULL,
    abbrv_tx character(30) NOT NULL,
    tot_len_nr integer NOT NULL,
    precision_nr integer NOT NULL,
    char_typ_nr integer NOT NULL,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.elem OWNER TO creator_role;

--
-- Name: err_susp_log; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.err_susp_log (
    cmd_cd character(3) NOT NULL,
    procs_id character(8) NOT NULL,
    jln_da_nr integer NOT NULL,
    ctrl_cntr_nr integer NOT NULL,
    rcd_mnmnc_id character(16),
    data_procg_ctr_nr character(4) NOT NULL,
    pgm_lin_nbr_id character(2) NOT NULL,
    gang_nbr_id character(1) NOT NULL,
    unt_id character(1) NOT NULL,
    cams_err_corr_seq_nbr_id character(11) NOT NULL,
    err_bit_map_nr numeric(5,0) NOT NULL,
    advsry_msg_tx character(50) NOT NULL,
    procs_dt_tm timestamp(6) without time zone NOT NULL,
    shadowbytes_bitset_tx character varying(400) NOT NULL,
    moa_tx text NOT NULL,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.err_susp_log OWNER TO creator_role;

--
-- Name: fsc; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.fsc (
    fsc_id character(2),
    fsg_id character(2),
    nomenclature_tx character(35),
    itm_manager_cd character(3),
    alc_cd character(2),
    del_flag_in character(1),
    xb3_allowed_in character(1),
    egress_in character(1),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.fsc OWNER TO creator_role;

--
-- Name: geo_loc; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.geo_loc (
    geo_loc_id character(4) NOT NULL,
    start_dt_tm timestamp(6) without time zone NOT NULL,
    stop_dt_tm timestamp(6) without time zone,
    geo_area_cd character(1),
    loc_nm character(20),
    theater_cmd_id character(2),
    type_inst_in character(1),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer,
    last_post_dt_tm timestamp(6) without time zone NOT NULL
);


ALTER TABLE remis.geo_loc OWNER TO creator_role;

--
-- Name: ggs_stat; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.ggs_stat (
    stat_dt_tm timestamp(6) without time zone NOT NULL,
    source_node_id character(8) NOT NULL,
    source_code_id character(10) NOT NULL,
    node_id character(8) NOT NULL,
    vol_id character(8) NOT NULL,
    subvol_id character(8) NOT NULL,
    filename_id character(8) NOT NULL,
    entry_dt_tm timestamp(6) without time zone,
    inserts_am numeric(12,0),
    updates_am numeric(12,0),
    deletes_am numeric(12,0),
    discards_am numeric(12,0),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.ggs_stat OWNER TO creator_role;

--
-- Name: howmal_cd; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.howmal_cd (
    how_mal_cd integer NOT NULL,
    start_dt_tm timestamp(6) without time zone NOT NULL,
    how_mal_class_in character(1),
    nomenclature_tx character(60),
    stop_dt_tm timestamp(6) without time zone,
    tcto_stat_cd integer,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.howmal_cd OWNER TO creator_role;

--
-- Name: interim_cage_cd; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.interim_cage_cd (
    part_nbr_id character(15) NOT NULL,
    sn_id character(15) NOT NULL,
    lot_nbr_id character(15) NOT NULL,
    data_proc_ctr_nbr_id integer NOT NULL,
    prog_line_nbr_id character(2) NOT NULL,
    gang_nbr_id numeric(1,0) NOT NULL,
    unit_id character(1) NOT NULL,
    as_of_dt_tm timestamp(6) without time zone NOT NULL,
    cage_cd character(5) NOT NULL,
    work_ctr_mnemonic character(5) NOT NULL,
    spm_nm character(16),
    spm_phone_nbr character(20),
    disappvd_dt_tm timestamp(6) without time zone NOT NULL,
    prev_cage_cd character(5) NOT NULL,
    egress_in character(1) NOT NULL,
    appvd_cage_cd character(5) NOT NULL,
    end_itm_equip_desig_id character(15) NOT NULL,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer,
    appvd_part_nbr_id character(15),
    itm_mgr_actn_cd character(1) NOT NULL,
    srd_id character(3) NOT NULL
);


ALTER TABLE remis.interim_cage_cd OWNER TO creator_role;

--
-- Name: interim_part_nbr; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.interim_part_nbr (
    alc_cd character(2) NOT NULL,
    equip_desig_id character(15) NOT NULL,
    data_proc_ctr_nbr_id integer NOT NULL,
    gang_nbr_id numeric(1,0) NOT NULL,
    as_of_dt_tm timestamp(6) without time zone NOT NULL,
    cage_cd character(5),
    srd_id character(3),
    type_equip_id character(1),
    wuc_cd character(15),
    natl_itm_id_nbr_id character(9),
    nomenclature_tx character(35),
    fsc_id character(2),
    fsg_id character(2),
    work_ctr_mnemonic character(5),
    cams_nm character(16),
    cams_phone_nbr character(20),
    spm_nm character(16),
    spm_phone_nbr character(20),
    valid_srd_in character(1),
    valid_wuc_in character(1),
    valid_fsc_in character(1),
    msg_sent_dt timestamp(6) without time zone,
    cams_comments_tx character(180),
    itm_mgr_comments_tx character(60),
    proc_id character(8),
    orig_cage_cd character(5),
    appvd_part_nbr_in character(1),
    appvd_cage_cd_in character(1),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer,
    egress_in character(1)
);


ALTER TABLE remis.interim_part_nbr OWNER TO creator_role;

--
-- Name: inv; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.inv (
    alc_cd character(2) NOT NULL,
    equip_desig_id character(15) NOT NULL,
    cage_cd character(5) NOT NULL,
    start_dt_tm timestamp(6) without time zone,
    sn_id character(15) NOT NULL,
    lot_nbr_id character(15),
    station_in character(1),
    lead_the_force_in character(1),
    related_weapons_sys_id character(7),
    manufacture_dt timestamp(6) without time zone,
    stop_dt_tm timestamp(6) without time zone,
    warranty_exp_dt timestamp(6) without time zone,
    actn_limit_am integer,
    new_or_overhauled_tx character(10),
    repaired_overhauled_dt timestamp(6) without time zone,
    inv_in character(1),
    type_op_tm character(1),
    curr_op_tm numeric(7,1),
    curr_config_cd character(3),
    curr_config_dt_tm timestamp(6) without time zone,
    freeze_in character(1),
    freeze_dt_tm timestamp(6) without time zone,
    config_id character(2) NOT NULL,
    block_nbr_id character(3) NOT NULL,
    acq_dt_tm timestamp(6) without time zone,
    src_doc character(50),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer,
    nato_in character(1)
);


ALTER TABLE remis.inv OWNER TO creator_role;

--
-- Name: inv_assig; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.inv_assig (
    alc_cd character(2) NOT NULL,
    equip_desig_id character(15) NOT NULL,
    sn_id character(15) NOT NULL,
    start_dt_tm timestamp(6) without time zone NOT NULL,
    cmd_cd character(3) NOT NULL,
    purp_cd character(2) NOT NULL,
    geo_loc_id character(4),
    stop_dt_tm timestamp(6) without time zone,
    org_nbr_id integer,
    org_kind_tx character(3),
    assig_proj_tx character(8),
    org_type_tx character(2),
    prog_element_cd character(10),
    assig_directive_tx character(6),
    assig_dt timestamp(6) without time zone,
    start_user_name_tx character(96),
    stop_user_name_tx character(96),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer,
    fund_cd character(2),
    appropriation_cd character(14),
    budget_cd character(1),
    sales_cd character(3),
    type_of_acquisition character(30),
    doc_id_cd character(3),
    remarks character(80),
    contract_nbr_po_other_id character(50),
    inv_recv_rpt_nbr character(50),
    acq_frm_cmd_cd character(3),
    accumulated_depreciation numeric(12,2),
    fnl_termn_typ_actn_cd character(1),
    termn_dt_tm timestamp(6) without time zone,
    last_post_dt_tm timestamp(6) without time zone,
    acq_dt_recv_dt_tm timestamp(6) without time zone,
    insert_dt_tm timestamp(6) without time zone
);


ALTER TABLE remis.inv_assig OWNER TO creator_role;

--
-- Name: inv_possess; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.inv_possess (
    start_dt_tm timestamp(6) without time zone NOT NULL,
    arbitrary_id numeric(10,0) NOT NULL,
    equip_desig_id character(15) NOT NULL,
    cmd_cd character(3) NOT NULL,
    sn_id character(15) NOT NULL,
    geo_loc_id character(4) NOT NULL,
    stop_dt_tm timestamp(6) without time zone,
    org_nbr_id integer NOT NULL,
    org_kind_tx character(3) NOT NULL,
    unit_id character(9),
    org_type_tx character(2) NOT NULL,
    purp_cd character(2) NOT NULL,
    loan_cd character(1),
    gain_type_actn_cd character(1),
    loss_type_actn_cd character(1),
    termination_type_actn_cd character(1),
    type_op_tm character(1),
    curr_op_tm numeric(7,1),
    srd_id character(3),
    gain_proc_dt_tm timestamp(6) without time zone,
    loss_proc_dt_tm timestamp(6) without time zone,
    data_proc_ctr_nbr_id integer,
    temp_transfer_in character(1),
    equip_id character(5),
    history_in character(1),
    orig_work_ctr_cd character(5),
    work_ctr_cd character(5),
    gang_nbr_id numeric(1,0),
    gain_user_name_tx character(96),
    loss_user_name_tx character(96),
    termination_user_name_tx character(96),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer,
    start_dt date,
    stop_dt date
);


ALTER TABLE remis.inv_possess OWNER TO creator_role;

--
-- Name: inv_possess_hold_file; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.inv_possess_hold_file (
    data_processing_ctr_nbr_id character(4) NOT NULL,
    gang_nbr_id numeric(1,0) NOT NULL,
    unit_1_id character(1) NOT NULL,
    equip_desig_id character(15) NOT NULL,
    sn_id character(15) NOT NULL,
    cams_error_correct_seq_nbr_id character(11) NOT NULL,
    type_equip_id character(1),
    as_of_dt_tm timestamp(6) without time zone,
    processed_dt_tm timestamp(6) without time zone,
    trx_dt_tm character(9),
    srd_id character(3) NOT NULL,
    config_id character(2) NOT NULL,
    block_nbr_id character(3) NOT NULL,
    org_nbr_id integer,
    org_kind_tx character(3) NOT NULL,
    org_type_tx character(2) NOT NULL,
    unit_2_id character(9) NOT NULL,
    geo_loc_id character(4) NOT NULL,
    purp_cd character(2) NOT NULL,
    inv_chng_cd character(1) NOT NULL,
    type_actn_cd character(1) NOT NULL,
    cmd_cd character(3) NOT NULL,
    curr_op_tm numeric(7,1) NOT NULL,
    inv_in character(1) NOT NULL,
    related_weapons_sys_id character(7) NOT NULL,
    station_in character(1) NOT NULL,
    prev_equipment_designator character(15) NOT NULL,
    prev_config_id character(2) NOT NULL,
    g_or_l_cmd_cd character(3) NOT NULL,
    g_or_l_geo_loc_id character(4) NOT NULL,
    prev_related_weapon_sys_id character(7) NOT NULL,
    prev_purp_cd character(2) NOT NULL,
    prev_org_nbr_id integer,
    prev_org_kind_tx character(3),
    prev_org_type_tx character(2),
    message_cd character(5) NOT NULL,
    temp_transfer_in character(1) NOT NULL,
    equip_id character(5) NOT NULL,
    user_name_tx character(96),
    cams_error_correct_data_tx character(39) NOT NULL,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.inv_possess_hold_file OWNER TO creator_role;

--
-- Name: inv_srd_link; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.inv_srd_link (
    equip_desig_id character(15) NOT NULL,
    sn_id character(15) NOT NULL,
    start_dt_tm timestamp(6) without time zone NOT NULL,
    stop_dt_tm timestamp(6) without time zone,
    srd_id character(3),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.inv_srd_link OWNER TO creator_role;

--
-- Name: inv_unit_cost; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.inv_unit_cost (
    equip_desig_id character(15) NOT NULL,
    sn_id character(15) NOT NULL,
    start_dt_tm timestamp(6) without time zone NOT NULL,
    stop_dt_tm timestamp(6) without time zone,
    type_equip_id character(1),
    unit_cost_am integer,
    start_user_name_tx character(96),
    stop_user_name_tx character(96),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.inv_unit_cost OWNER TO creator_role;

--
-- Name: job_std; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.job_std (
    arbitrary_id numeric(10,0) NOT NULL,
    start_dt_tm timestamp(6) without time zone,
    job_std_nbr_id character(6) NOT NULL,
    equip_desig_id character(15),
    type_equip_id character(1),
    freq_am integer,
    wuc_cd character(15),
    type_interval_id character(1),
    type_insp_cd character(1),
    time_chng_insp_frmt_in character(1),
    narrative_tx character(60),
    dom_doi_in character(1),
    stop_dt_tm timestamp(6) without time zone,
    catalog_nbr integer,
    tech_ordr_ref_tx character(60),
    multi_equip_desig_in character(1),
    multi_block_nmbr_in character(1),
    due_tm_calc_in character(1),
    user_name_tx character(16),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.job_std OWNER TO creator_role;

--
-- Name: k002rb_dtl; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.k002rb_dtl (
    proc_dt_tm timestamp(0) without time zone NOT NULL,
    file_nm character(34) NOT NULL,
    rpt_yr_id integer NOT NULL,
    rpt_mo_id integer NOT NULL,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.k002rb_dtl OWNER TO creator_role;

--
-- Name: late_util; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.late_util (
    arbitrary_id numeric(10,0) NOT NULL,
    rpt_mo_ind_yr_tm integer NOT NULL,
    rpt_mo_ind_mo_tm integer NOT NULL,
    yr_id integer NOT NULL,
    mo_id integer NOT NULL,
    util_purp_cd character(2) NOT NULL,
    prog_element_cd character(10) NOT NULL,
    type_util_cd character(4) NOT NULL,
    hrs_am numeric(6,1) NOT NULL,
    sorties_am integer NOT NULL,
    landings_am integer NOT NULL,
    full_stop_landings_am integer NOT NULL,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.late_util OWNER TO creator_role;

--
-- Name: lru_ate_cross_ref; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.lru_ate_cross_ref (
    test_station_equip_desig_id character(15) NOT NULL,
    test_station_sn_id character(15) NOT NULL,
    wuc_cd character(15) NOT NULL,
    lru_wuc_cd character(15) NOT NULL,
    end_itm_equip_desig_id character(15) NOT NULL,
    loc_id character(15),
    start_dt_tm timestamp(6) without time zone NOT NULL,
    stop_dt_tm timestamp(6) without time zone NOT NULL,
    type_wuc_in character(1) NOT NULL,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.lru_ate_cross_ref OWNER TO creator_role;

--
-- Name: lru_backlog; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.lru_backlog (
    perf_geo_loc_id character(4) NOT NULL,
    perf_work_ctr_cd character(5) NOT NULL,
    part_nbr_id character(15) NOT NULL,
    sn_id character(15) NOT NULL,
    orig_cmd_cd character(3),
    orig_geo_loc_id character(4) NOT NULL,
    orig_unit_id character(1) NOT NULL,
    job_ctrl_nbr_id character(9) NOT NULL,
    orig_org_nbr_id integer,
    orig_org_kind_tx character(3),
    orig_org_type_tx character(2),
    end_itm_equip_desig_id character(15) NOT NULL,
    wuc_cd character(15) NOT NULL,
    received_dt_tm timestamp(6) without time zone,
    lru_stat_cd character(4) NOT NULL,
    priority_cd character(1),
    orig_work_ctr_cd character(5),
    as_of_dt_tm timestamp(6) without time zone,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.lru_backlog OWNER TO creator_role;

--
-- Name: lru_backlog_detail; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.lru_backlog_detail (
    perf_geo_loc_id character(4) NOT NULL,
    perf_work_ctr_cd character(5) NOT NULL,
    part_nbr_id character(15) NOT NULL,
    sn_id character(15) NOT NULL,
    orig_cmd_cd character(3),
    orig_geo_loc_id character(4) NOT NULL,
    orig_unit_id character(1) NOT NULL,
    job_ctrl_nbr_id character(9) NOT NULL,
    maint_actn_nbr_id numeric(10,0) NOT NULL,
    as_of_dt_tm timestamp(6) without time zone,
    orig_org_nbr_id integer,
    orig_org_kind_tx character(3),
    orig_org_type_tx character(2),
    end_itm_equip_desig_id character(15) NOT NULL,
    wuc_cd character(15) NOT NULL,
    received_dt_tm timestamp(6) without time zone,
    lru_stat_cd character(4) NOT NULL,
    priority_cd character(1),
    orig_work_ctr_cd character(5),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.lru_backlog_detail OWNER TO creator_role;

--
-- Name: lru_capabilities; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.lru_capabilities (
    lru_wuc_cd character(15) NOT NULL,
    end_itm_equip_desig_id character(15) NOT NULL,
    lru_capability_nbr_cd integer NOT NULL,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.lru_capabilities OWNER TO creator_role;

--
-- Name: maint_data_sum_queue; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.maint_data_sum_queue (
    alc_cd character(2) NOT NULL,
    queue_typ_cd character(1) NOT NULL,
    maint_actn_nbr_id numeric(10,0) NOT NULL,
    queue_ins_dt_tm timestamp(6) without time zone NOT NULL,
    unit_of_wrk_revcr_tx character varying(200) NOT NULL,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.maint_data_sum_queue OWNER TO creator_role;

--
-- Name: master_parts_remis_inv; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.master_parts_remis_inv (
    part_nbr_id character(15) NOT NULL,
    cage_cd character(5) NOT NULL,
    start_dt_tm timestamp(6) without time zone NOT NULL,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.master_parts_remis_inv OWNER TO creator_role;

--
-- Name: matched_component_set; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.matched_component_set (
    matched_set_nbr_id numeric(10,0) NOT NULL,
    matched_set_stat_in character(1),
    start_dt_tm timestamp(6) without time zone,
    stop_dt_tm timestamp(6) without time zone,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.matched_component_set OWNER TO creator_role;

--
-- Name: mds_util_pec; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.mds_util_pec (
    equip_desig_id character(15) NOT NULL,
    util_purp_cd character(2) NOT NULL,
    prog_element_cd character(10),
    start_dt_tm timestamp(6) without time zone NOT NULL,
    stop_dt_tm timestamp(6) without time zone,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.mds_util_pec OWNER TO creator_role;

--
-- Name: nbrd_af; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.nbrd_af (
    start_dt_tm timestamp(6) without time zone NOT NULL,
    nbred_af_tx character(4) NOT NULL,
    cmd_cd character(3),
    loc_nm character(20),
    stop_dt_tm timestamp(6) without time zone,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.nbrd_af OWNER TO creator_role;

--
-- Name: off_equip_discrep; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.off_equip_discrep (
    work_ordr_nbr_id numeric(11,0) NOT NULL,
    discrep_narrative_tx character(180),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.off_equip_discrep OWNER TO creator_role;

--
-- Name: off_equip_maint_actn; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.off_equip_maint_actn (
    failure_count_in character(1),
    actn_taken_cd character(1),
    maint_type character(1),
    maint_actn_nbr_id numeric(10,0) NOT NULL,
    labor_manhrs_am numeric(6,1),
    inpected_by_nm integer,
    how_mal_cd integer,
    orig_work_ctr_cd character(5),
    emp_nbr_id integer,
    crew_size_am integer,
    component_pos_nbr_id character(4),
    chng_seq_nbr_id character(11),
    category_of_labor_id integer,
    afto_form_350_tag_nbr_id character(6),
    af_speciality_cd character(5),
    work_ordr_nbr_id numeric(11,0),
    work_ctr_event_id integer,
    work_ctr_cd character(5),
    when_dscvrd_cd character(1),
    units_am integer,
    type_maint_cd character(1),
    supervisory_review_by_nm integer,
    seq_nbr_id integer,
    start_dt_tm timestamp(6) without time zone,
    wuc_cd character(15),
    pmr_nbr_id integer,
    pmr_category character(3),
    perf_geo_loc_id character(4),
    stop_dt_tm timestamp(6) without time zone,
    probable_cause_of_failure_tx character(10),
    on_equip_work_ctr_event_id integer,
    on_equip_seq_nbr_id integer,
    on_base_turn_in_doc_nbr_id character(14),
    stop_yr_mo integer,
    start_yr_mo integer,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.off_equip_maint_actn OWNER TO creator_role;

--
-- Name: off_equip_work_ordr; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.off_equip_work_ordr (
    work_ordr_nbr_id numeric(11,0) NOT NULL,
    job_ctrl_nbr_id character(9) NOT NULL,
    cmd_cd character(3) NOT NULL,
    geo_loc_id character(4) NOT NULL,
    srd_id character(3) NOT NULL,
    fsc_id character(2),
    fsg_id character(2),
    equip_desig_id character(15) NOT NULL,
    sn_id character(15) NOT NULL,
    curr_op_tm numeric(7,1),
    tcto_data_cd character(7),
    on_equip_work_ordr_nbr_id numeric(11,0),
    higher_assy_alc_cd character(2),
    higher_assy_equip_desig_id character(15),
    unit_id character(1) NOT NULL,
    aisg_dt_tm timestamp(6) without time zone NOT NULL,
    org_nbr_id integer,
    org_kind_tx character(3),
    org_type_tx character(2),
    orig_cmd_cd character(3),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer,
    cage_cd character(5) NOT NULL,
    lot_nbr_id character(15) NOT NULL,
    min_start_dt_tm timestamp(6) without time zone,
    max_stop_dt_tm timestamp(6) without time zone
);


ALTER TABLE remis.off_equip_work_ordr OWNER TO creator_role;

--
-- Name: old_asset_type; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.old_asset_type (
    alc_cd character(2) NOT NULL,
    equip_desig_id character(15) NOT NULL,
    cage_cd character(5) NOT NULL,
    mission_tx character(1),
    design_tx character(3),
    config_itm_id character(7),
    type_equip_id character(1),
    nomenclature_tx character(35),
    natl_itm_id_nbr_id character(9),
    commodity_cd character(1),
    mgmt_div_tx character(3),
    sys_manager_cd character(3),
    unit_cost_am integer,
    start_dt_tm timestamp(6) without time zone,
    managing_alc_cd character(2),
    stop_dt_tm timestamp(6) without time zone,
    appvd_block_nbr_in character(1),
    appvd_config_in character(1),
    appvd_loc_id_in character(1),
    appvd_cpin_block_nbr_in character(1),
    appvd_cpin_config_in character(1),
    appvd_cpin_loc_id_in character(1),
    fsc_id character(2),
    fsg_id character(2),
    material_mgmt_cd character(2),
    errc_cd character(3),
    technician_desig_id character(2),
    block_managed_in character(1),
    prev_niin_id character(9),
    egress_in character(1),
    egress_confirm_dt_tm timestamp(6) without time zone NOT NULL,
    assig_mission_in character(1) NOT NULL,
    sys_level_rpting_req_in character(1),
    permitted_as_lower_end_itm_in character(1),
    util_rpt_in character(1),
    lcn_in character(1),
    cage_assig_in character(1),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer,
    icbm_in character(1),
    wuc_assig_in character(1) NOT NULL,
    auto_remove_in character(1),
    inst_spin_to_end_itm_only_in character(1)
);


ALTER TABLE remis.old_asset_type OWNER TO creator_role;

--
-- Name: old_inv; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.old_inv (
    alc_cd character(2) NOT NULL,
    equip_desig_id character(15) NOT NULL,
    cage_cd character(5) NOT NULL,
    start_dt_tm timestamp(6) without time zone,
    sn_id character(15) NOT NULL,
    lot_nbr_id character(15),
    station_in character(1),
    lead_the_force_in character(1),
    related_weapons_sys_id character(7),
    manufacture_dt timestamp(6) without time zone,
    stop_dt_tm timestamp(6) without time zone,
    warranty_exp_dt timestamp(6) without time zone,
    actn_limit_am integer,
    new_or_overhauled_tx character(10),
    repaired_overhauled_dt timestamp(6) without time zone,
    inv_in character(1),
    type_op_tm character(1),
    curr_op_tm numeric(7,1),
    curr_config_cd character(3),
    curr_config_dt_tm timestamp(6) without time zone,
    freeze_in character(1),
    freeze_dt_tm timestamp(6) without time zone,
    config_id character(2) NOT NULL,
    block_nbr_id character(3) NOT NULL,
    acq_dt_tm timestamp(6) without time zone,
    src_doc character(50),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer,
    nato_in character(1)
);


ALTER TABLE remis.old_inv OWNER TO creator_role;

--
-- Name: old_inv_assig; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.old_inv_assig (
    alc_cd character(2) NOT NULL,
    equip_desig_id character(15) NOT NULL,
    sn_id character(15) NOT NULL,
    start_dt_tm timestamp(6) without time zone NOT NULL,
    cmd_cd character(3) NOT NULL,
    purp_cd character(2) NOT NULL,
    geo_loc_id character(4),
    stop_dt_tm timestamp(6) without time zone,
    org_nbr_id integer,
    org_kind_tx character(3),
    assig_proj_tx character(8),
    org_type_tx character(2),
    prog_element_cd character(10),
    assig_directive_tx character(6),
    assig_dt timestamp(6) without time zone,
    start_user_name_tx character(96),
    stop_user_name_tx character(96),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer,
    fund_cd character(2),
    appropriation_cd character(14),
    budget_cd character(1),
    sales_cd character(3),
    type_of_acquisition character(30),
    doc_id_cd character(3),
    remarks character(80),
    contract_nbr_po_other_id character(50),
    inv_recv_rpt_nbr character(50),
    acq_frm_cmd_cd character(3),
    accumulated_depreciation numeric(12,2),
    fnl_termn_typ_actn_cd character(1),
    termn_dt_tm timestamp(6) without time zone,
    last_post_dt_tm timestamp(6) without time zone,
    acq_dt_recv_dt_tm timestamp(6) without time zone,
    insert_dt_tm timestamp(6) without time zone
);


ALTER TABLE remis.old_inv_assig OWNER TO creator_role;

--
-- Name: old_inv_possess; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.old_inv_possess (
    start_dt_tm timestamp(6) without time zone NOT NULL,
    arbitrary_id numeric(10,0) NOT NULL,
    equip_desig_id character(15) NOT NULL,
    cmd_cd character(3) NOT NULL,
    sn_id character(15) NOT NULL,
    geo_loc_id character(4) NOT NULL,
    stop_dt_tm timestamp(6) without time zone,
    org_nbr_id integer NOT NULL,
    org_kind_tx character(3) NOT NULL,
    unit_id character(9),
    org_type_tx character(2) NOT NULL,
    purp_cd character(2) NOT NULL,
    loan_cd character(1),
    gain_type_actn_cd character(1),
    loss_type_actn_cd character(1),
    termination_type_actn_cd character(1),
    type_op_tm character(1),
    curr_op_tm numeric(7,1),
    srd_id character(3),
    gain_proc_dt_tm timestamp(6) without time zone,
    loss_proc_dt_tm timestamp(6) without time zone,
    data_proc_ctr_nbr_id integer,
    temp_transfer_in character(1),
    equip_id character(5),
    history_in character(1),
    orig_work_ctr_cd character(5),
    work_ctr_cd character(5),
    gang_nbr_id numeric(1,0),
    gain_user_name_tx character(96),
    loss_user_name_tx character(96),
    termination_user_name_tx character(96),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer,
    start_dt date,
    stop_dt date
);


ALTER TABLE remis.old_inv_possess OWNER TO creator_role;

--
-- Name: old_on_equip_maint_actn; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.old_on_equip_maint_actn (
    actn_taken_cd character(1),
    maint_type character(1),
    maint_actn_nbr_id numeric(10,0) NOT NULL,
    labor_manhrs_am numeric(6,1),
    inpected_by_nm integer,
    how_mal_cd integer,
    orig_work_ctr_cd character(5),
    emp_nbr_id integer,
    crew_size_am integer,
    component_pos_nbr_id character(4),
    category_of_labor_id integer,
    afto_form_350_tag_nbr_id character(6),
    af_speciality_cd character(5),
    work_ordr_nbr_id numeric(11,0),
    work_ctr_event_id integer,
    work_ctr_cd character(5),
    when_dscvrd_cd character(1),
    units_am integer,
    type_maint_cd character(1),
    supervisory_review_by_nm integer,
    seq_nbr_id integer,
    start_dt_tm timestamp(6) without time zone,
    wuc_cd character(15),
    pmr_nbr_id integer,
    pmr_category character(3),
    perf_geo_loc_id character(4),
    stop_dt_tm timestamp(6) without time zone,
    failure_count_in character(1),
    chng_seq_nbr_id character(11),
    maint_priority_in character(2),
    maintainer_nm character(96),
    documenter_nm character(96),
    comp_maint_actn_nbr_id numeric(10,0),
    stop_yr_mo integer,
    start_yr_mo integer,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.old_on_equip_maint_actn OWNER TO creator_role;

--
-- Name: old_on_equip_work_ordr; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.old_on_equip_work_ordr (
    work_ordr_nbr_id numeric(11,0) NOT NULL,
    job_ctrl_nbr_id character(9) NOT NULL,
    cmd_cd character(3) NOT NULL,
    geo_loc_id character(4) NOT NULL,
    sn_id character varying(15) NOT NULL,
    srd_id character(3) NOT NULL,
    equip_desig_id character varying(15) NOT NULL,
    tcto_data_cd character(7),
    org_nbr_id integer,
    org_kind_tx character(3),
    org_type_tx character(2),
    data_proc_ctr_nbr_id integer,
    curr_op_tm numeric(7,1),
    unit_id character(1) NOT NULL,
    aisg_dt_tm timestamp(6) without time zone NOT NULL,
    input_equip_desig_id character(15),
    type_equip_id character(1),
    orig_cmd_cd character(3),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer,
    detachment_nbr_id character(2),
    min_start_dt_tm timestamp(6) without time zone,
    max_stop_dt_tm timestamp(6) without time zone
);


ALTER TABLE remis.old_on_equip_work_ordr OWNER TO creator_role;

--
-- Name: old_stat; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.old_stat (
    start_dt_tm timestamp(6) without time zone NOT NULL,
    arbitrary_id numeric(10,0) NOT NULL,
    stat_cd character(1) NOT NULL,
    loc_id character(15) NOT NULL,
    stat_type character(1) NOT NULL,
    yr_id integer NOT NULL,
    mo_id integer NOT NULL,
    wuc_cd character(15) NOT NULL,
    as_of_dt_tm timestamp(6) without time zone NOT NULL,
    stop_dt_tm timestamp(6) without time zone,
    hrs_am numeric(6,1),
    job_ctrl_nbr_id character(9),
    work_ctr_event_id integer,
    orig_cmd_cd character(3),
    orig_geo_loc_id character(4),
    unit_id character(1),
    lru_capability_nbr_in integer,
    stop_yr_mo integer,
    start_yr_mo integer,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer,
    end_itm_capability_nbr_id integer,
    override_stat_in character(1),
    start_dt date,
    stop_dt date,
    source_srd_id character(3),
    documenter_nm character(96),
    ins_rpt_ind_yr_mo_id integer,
    ins_proc_dt_tm timestamp(6) without time zone,
    upd_rpt_ind_yr_mo_id integer,
    upd_proc_dt_tm timestamp(6) without time zone,
    last_post_dt_tm timestamp(6) without time zone
);


ALTER TABLE remis.old_stat OWNER TO creator_role;

--
-- Name: old_type_util; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.old_type_util (
    type_util_cd character(4) NOT NULL,
    start_dt_tm timestamp(6) without time zone NOT NULL,
    stop_dt_tm timestamp(6) without time zone,
    type_equip_id character(1),
    comments_tx character(54),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.old_type_util OWNER TO creator_role;

--
-- Name: old_util; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.old_util (
    start_dt_tm timestamp(6) without time zone NOT NULL,
    rpt_mo_ind_yr_tm integer NOT NULL,
    rpt_mo_ind_mo_tm integer NOT NULL,
    mod_rmi_yr_tm integer NOT NULL,
    mod_rmi_mo_tm integer NOT NULL,
    prog_element_cd character(10) NOT NULL,
    util_purp_cd character(2) NOT NULL,
    type_util_cd character(4) NOT NULL,
    due_in_dt timestamp(6) without time zone NOT NULL,
    yr_id integer NOT NULL,
    initial_start_dt_tm timestamp(6) without time zone NOT NULL,
    mo_id integer NOT NULL,
    initial_stop_dt_tm timestamp(6) without time zone NOT NULL,
    initial_due_in_dt timestamp(6) without time zone NOT NULL,
    stop_dt_tm timestamp(6) without time zone,
    hrs_am numeric(6,1),
    sorties_am integer,
    landings_am integer,
    arbitrary_id numeric(10,0) NOT NULL,
    full_stop_landings_am integer,
    stress_factor_cd character(1),
    base_trx_dt timestamp(6) without time zone,
    sortie_dt integer,
    sortie_nbr_id integer,
    sortie_mod integer,
    mission_nmbr_cd character(12),
    takeoff_icao_loc_id character(4),
    landing_icao_loc_id character(4),
    stop_yr_mo integer,
    start_yr_mo integer,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer,
    proc_dt_tm timestamp(6) without time zone,
    del_proc_dt_tm timestamp(6) without time zone,
    ins_rpt_ind_yr_mo_id integer,
    del_rpt_ind_yr_mo_id integer,
    initial_takeoff_dt_tm timestamp(6) without time zone,
    final_takeoff_dt_tm timestamp(6) without time zone,
    final_landing_dt_tm timestamp(6) without time zone
);


ALTER TABLE remis.old_util OWNER TO creator_role;

--
-- Name: old_wuc; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.old_wuc (
    alc_cd character(2) NOT NULL,
    equip_desig_id character(15) NOT NULL,
    wuc_cd character(15) NOT NULL,
    start_dt_tm timestamp(6) without time zone NOT NULL,
    stop_dt_tm timestamp(6) without time zone,
    serially_tracked_in character(1),
    failure_limit_am integer,
    pub_dt timestamp(6) without time zone,
    replacement_in character(1),
    nrts_in character(1),
    usage_factor numeric(4,2),
    actn_limit_am integer,
    qty_per_app_qy integer,
    special_or_end_piece_inv_in integer,
    category_of_failure_in character(1),
    inspection_req_tx character(7),
    orig_wuc_cd character(15),
    block_nbr_in character(1),
    type_equip_id character(1),
    desc_tx character(150),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.old_wuc OWNER TO creator_role;

--
-- Name: on_equip_corrective_actn; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.on_equip_corrective_actn (
    maint_actn_nbr numeric(10,0),
    corrective_actn_narrative character varying(540),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.on_equip_corrective_actn OWNER TO creator_role;

--
-- Name: on_equip_discrep; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.on_equip_discrep (
    work_ordr_nbr_id numeric(11,0) NOT NULL,
    discrep_narrative_tx character varying(180),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.on_equip_discrep OWNER TO creator_role;

--
-- Name: on_equip_maint_actn; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.on_equip_maint_actn (
    actn_taken_cd character(1),
    maint_type character(1),
    maint_actn_nbr_id numeric(10,0) NOT NULL,
    labor_manhrs_am numeric(6,1),
    inpected_by_nm integer,
    how_mal_cd integer,
    orig_work_ctr_cd character(5),
    emp_nbr_id integer,
    crew_size_am integer,
    component_pos_nbr_id character(4),
    category_of_labor_id integer,
    afto_form_350_tag_nbr_id character(6),
    af_speciality_cd character(5),
    work_ordr_nbr_id numeric(11,0),
    work_ctr_event_id integer,
    work_ctr_cd character(5),
    when_dscvrd_cd character(1),
    units_am integer,
    type_maint_cd character(1),
    supervisory_review_by_nm integer,
    seq_nbr_id integer,
    start_dt_tm timestamp(6) without time zone,
    wuc_cd character(15),
    pmr_nbr_id integer,
    pmr_category character(3),
    perf_geo_loc_id character(4),
    stop_dt_tm timestamp(6) without time zone,
    failure_count_in character(1),
    chng_seq_nbr_id character(11),
    maint_priority_in character(2),
    maintainer_nm character(96),
    documenter_nm character(96),
    comp_maint_actn_nbr_id numeric(10,0),
    stop_yr_mo integer,
    start_yr_mo integer,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.on_equip_maint_actn OWNER TO creator_role;

--
-- Name: on_equip_work_ordr; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.on_equip_work_ordr (
    work_ordr_nbr_id numeric(11,0) NOT NULL,
    job_ctrl_nbr_id character(9) NOT NULL,
    cmd_cd character(3) NOT NULL,
    geo_loc_id character(4) NOT NULL,
    sn_id character(15) NOT NULL,
    srd_id character(3) NOT NULL,
    equip_desig_id character(15) NOT NULL,
    tcto_data_cd character(7),
    org_nbr_id integer,
    org_kind_tx character(3),
    org_type_tx character(2),
    data_proc_ctr_nbr_id integer,
    curr_op_tm numeric(7,1),
    unit_id character(1) NOT NULL,
    aisg_dt_tm timestamp(6) without time zone NOT NULL,
    input_equip_desig_id character(15),
    type_equip_id character(1),
    orig_cmd_cd character(3),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer,
    detachment_nbr_id character(2),
    min_start_dt_tm timestamp(6) without time zone,
    max_stop_dt_tm timestamp(6) without time zone
);


ALTER TABLE remis.on_equip_work_ordr OWNER TO creator_role;

--
-- Name: parts_ordred; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.parts_ordred (
    wuc_cd character(15) NOT NULL,
    cmd_cd character(3) NOT NULL,
    geo_loc_id character(4) NOT NULL,
    unit_id character(9) NOT NULL,
    job_ctrl_nbr_id character(9) NOT NULL,
    part_ordred_nm character(15) NOT NULL,
    supply_doc_nbr_id character(15) NOT NULL,
    destination_cd character(3),
    emp_nbr_id integer,
    stock_nbr_id character(15),
    qty_qy integer,
    units_of_issue_am character(2),
    noun character(15),
    priority_cd character(1),
    sn_id character(15) NOT NULL,
    part_nbr_id character(15),
    loc_id character(15),
    ordred_dt_tm timestamp(6) without time zone,
    received_dt_tm timestamp(6) without time zone,
    end_itm_equip_desig_id character(15),
    end_itm_sn_id character(15),
    ordr_geo_loc_id character(4),
    ordr_work_ctr_cd character(5),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.parts_ordred OWNER TO creator_role;

--
-- Name: parts_replacement; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.parts_replacement (
    qty_qy integer,
    bit_and_piece_seq_nbr_id integer,
    chng_seq_nbr_id character(11) NOT NULL,
    fsc_id character(2) NOT NULL,
    fsg_id character(2) NOT NULL,
    how_mal_cd integer,
    maint_actn_nbr_id numeric(10,0),
    part_nbr_id character(15) NOT NULL,
    wuc_cd character(15) NOT NULL,
    ref_or_noun_symbol character(9) NOT NULL,
    supervisory_review_by_nm integer,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.parts_replacement OWNER TO creator_role;

--
-- Name: phys_geo_loc_ref; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.phys_geo_loc_ref (
    equip_desig_id character(15) NOT NULL,
    sn_id character(15) NOT NULL,
    as_of_dt_tm character(26) NOT NULL,
    processed_dt_tm character(26) NOT NULL,
    type_equip_id character(1),
    geo_loc_id character(4),
    org_nbr_id integer,
    org_kind_tx character(3),
    org_type_tx character(2),
    origntg_emp_nm character varying(96) NOT NULL,
    data_proc_ctr_nbr_id integer,
    seq_nbr_id numeric(12,0),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.phys_geo_loc_ref OWNER TO creator_role;

--
-- Name: possess_purp_cd; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.possess_purp_cd (
    purp_cd character(2) NOT NULL,
    cond_cd character(1) NOT NULL,
    start_dt_tm timestamp(6) without time zone NOT NULL,
    stop_dt_tm timestamp(6) without time zone,
    last_post_dt_tm timestamp(6) without time zone,
    start_user_name_tx character(96),
    stop_user_name_tx character(96),
    remarks_tx character(80),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.possess_purp_cd OWNER TO creator_role;

--
-- Name: purp_cd; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.purp_cd (
    purp_cd character(2) NOT NULL,
    start_dt_tm timestamp(6) without time zone NOT NULL,
    stop_dt_tm timestamp(6) without time zone,
    wuc_req_in character(1),
    missile_only_in character(1),
    noncomputational_in character(1),
    active_inactive_purp_cd character(1),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer,
    aur_in character(1)
);


ALTER TABLE remis.purp_cd OWNER TO creator_role;

--
-- Name: rcd; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.rcd (
    rcd_mnmnc_id character(16) NOT NULL,
    nm_tx character(80) NOT NULL,
    procs_id character(8) NOT NULL,
    tot_len_nr integer NOT NULL,
    min_len_nr integer NOT NULL,
    distinctive_pattern_tx character(80) NOT NULL,
    ofc_rtg_in character(3) NOT NULL,
    pathway_srvr_clas_nm character(15) NOT NULL,
    bgn_trans_in character(1) NOT NULL,
    dsgn_for_src_corr_in character(1) NOT NULL,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.rcd OWNER TO creator_role;

--
-- Name: rcd_elem; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.rcd_elem (
    rcd_mnmnc_id character(16) NOT NULL,
    seq_nr integer NOT NULL,
    elem_mnmnc_id character(16) NOT NULL,
    bfr_fill_nr integer NOT NULL,
    aftr_fill_nr integer NOT NULL,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.rcd_elem OWNER TO creator_role;

--
-- Name: remis_afds_cnt_hist; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.remis_afds_cnt_hist (
    cnt_runtime timestamp(6) without time zone,
    remis_tbl character(6),
    edw_prod_tbl character varying(35),
    afds_cnt integer,
    remis_cnt integer,
    max_remis_dt_tm timestamp(6) without time zone
);


ALTER TABLE remis.remis_afds_cnt_hist OWNER TO creator_role;

--
-- Name: remis_to_edw; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.remis_to_edw (
    remis_tbl character(6) NOT NULL,
    edw_prod_tbl character varying(35) NOT NULL
);


ALTER TABLE remis.remis_to_edw OWNER TO creator_role;

--
-- Name: repair_facility_assig; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.repair_facility_assig (
    part_nbr_id character(15) NOT NULL,
    srd_id character(3) NOT NULL,
    ntrs_geo_loc_id character(4) NOT NULL,
    wuc_cd character(15) NOT NULL,
    orig_work_ctr_cd character(5),
    repair_geo_loc_id character(4),
    repair_work_ctr_cd character(5),
    end_itm_equip_desig_id character(15),
    stop_dt_tm timestamp(6) without time zone,
    block_nbr_id character(3),
    start_dt_tm timestamp(6) without time zone NOT NULL,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.repair_facility_assig OWNER TO creator_role;

--
-- Name: rpting_org; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.rpting_org (
    start_dt_tm timestamp(6) without time zone NOT NULL,
    org_nbr_id integer NOT NULL,
    org_kind_tx character(3) NOT NULL,
    org_type_tx character(2) NOT NULL,
    stop_dt_tm timestamp(6) without time zone,
    org_level character(1),
    cmd_cd character(3) NOT NULL,
    subcmd_cd character(3) NOT NULL,
    geo_loc_id character(4) NOT NULL,
    nmbrd_af_id character(4) NOT NULL,
    stock_rec_acct_nbr_id character(6),
    inst_cmd_cd character(3),
    state_or_ctry_cd character(2),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer,
    last_post_dt_tm timestamp(6) without time zone NOT NULL
);


ALTER TABLE remis.rpting_org OWNER TO creator_role;

--
-- Name: serial_nbr_cross_ref; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.serial_nbr_cross_ref (
    part_nbr_id character(15) NOT NULL,
    cage_cd character(5) NOT NULL,
    pic_serial_nbr_id character(30) NOT NULL,
    lot_nbr_id character(15) NOT NULL,
    legacy_serial_nbr_id character(15) NOT NULL,
    as_of_dt_tm timestamp(6) without time zone NOT NULL,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.serial_nbr_cross_ref OWNER TO creator_role;

--
-- Name: serialized_part_inv; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.serialized_part_inv (
    alc_cd character(2) NOT NULL,
    cage_cd character(5) NOT NULL,
    lot_nbr_id character(15) NOT NULL,
    equip_desig_id character(15) NOT NULL,
    sn_id character(15) NOT NULL,
    type_equip_id character(1),
    matched_set_nbr_id numeric(10,0),
    orig_equip_desig_id character(15),
    orig_cage_cd character(5),
    orig_sn_id character(15),
    egress_in character(1),
    lru_in character(1),
    manufacture_dt timestamp(6) without time zone,
    warranty_exp_dt timestamp(6) without time zone,
    start_dt_tm timestamp(6) without time zone,
    stop_dt_tm timestamp(6) without time zone,
    latest_chng_in character(1),
    psn_chng_dt_tm timestamp(6) without time zone,
    nrts_in character(1),
    org_nbr_id integer,
    org_kind_tx character(3),
    org_type_tx character(2),
    geo_loc_id character(4),
    roll_source_in character(1),
    data_proc_ctr_nbr_id integer,
    stop_yr_mo integer,
    start_yr_mo integer,
    end_itm_equip_desig_id character(15),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer,
    info_cage_cd character(5) NOT NULL,
    schema_in character(3) NOT NULL,
    input_in character(1),
    last_post_dt_tm timestamp(6) without time zone,
    program_line_nbr_id integer,
    gang_nbr_id integer,
    detachment_nbr_id character(2),
    user_name_tx character(96),
    orig_install_dt_tm timestamp(6) without time zone,
    on_base_turn_in_doc_nbr_id character(14),
    resource_ctrl_ctr_id character(5),
    cond_cd character(1),
    unique_item_id timestamp(6) without time zone
);


ALTER TABLE remis.serialized_part_inv OWNER TO creator_role;

--
-- Name: srd; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.srd (
    start_dt_tm timestamp(6) without time zone NOT NULL,
    srd_id character(3) NOT NULL,
    equip_desig_id character(15),
    stop_dt_tm timestamp(6) without time zone,
    inst_with_equip character(15),
    joint_electronic_test_desig_id character(20),
    block_nbr_in character(1),
    micap_rptable_itm_in character(1),
    mdc_rptable_itm_in character(1),
    tcto_rptable_itm_in character(1),
    comments_tx character(150),
    type_maint_cd_group_id integer,
    when_dscvrd_cd_group_id integer,
    wuc_in character(1),
    weapon_sys_desig_id character(3),
    alc_cd character(2),
    cross_ref_exempt_id character(1),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.srd OWNER TO creator_role;

--
-- Name: srd_block; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.srd_block (
    alc_cd character(2) NOT NULL,
    start_dt_tm timestamp(6) without time zone NOT NULL,
    equip_desig_id character(15) NOT NULL,
    srd_id character(3) NOT NULL,
    block_nbr_id character(3) NOT NULL,
    stop_dt_tm timestamp(6) without time zone,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.srd_block OWNER TO creator_role;

--
-- Name: srd_cross_ref; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.srd_cross_ref (
    start_dt_tm timestamp(6) without time zone NOT NULL,
    aircraft_equip_desig_id character(15) NOT NULL,
    aircraft_srd_id character(3) NOT NULL,
    engine_equip_desig_id character(15) NOT NULL,
    engine_srd_id character(3) NOT NULL,
    stop_dt_tm timestamp(6) without time zone,
    sys_level_in character(1),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.srd_cross_ref OWNER TO creator_role;

--
-- Name: srd_family; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.srd_family (
    srd_first_char_id character(1) NOT NULL,
    family_tx character varying(250)
);


ALTER TABLE remis.srd_family OWNER TO creator_role;

--
-- Name: srd_nsn_ref; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.srd_nsn_ref (
    srd_id character(3) NOT NULL,
    nsn_id character(15) NOT NULL,
    fsc_id numeric(4,0),
    natl_itm_id_nbr_id character(9),
    material_mgmt_cd character(2),
    start_dt_tm timestamp(6) without time zone NOT NULL,
    stop_dt_tm timestamp(6) without time zone,
    last_posting_dt_tm timestamp(6) without time zone,
    start_dt_tm_tx character(19),
    stop_dt_tm_tx character(19),
    last_posting_dt_tm_tx character(19),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.srd_nsn_ref OWNER TO creator_role;

--
-- Name: stat; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.stat (
    start_dt_tm timestamp(6) without time zone NOT NULL,
    arbitrary_id numeric(10,0) NOT NULL,
    stat_cd character(1) NOT NULL,
    loc_id character(15) NOT NULL,
    stat_type character(1) NOT NULL,
    yr_id integer NOT NULL,
    mo_id integer NOT NULL,
    wuc_cd character(15) NOT NULL,
    as_of_dt_tm timestamp(6) without time zone NOT NULL,
    stop_dt_tm timestamp(6) without time zone,
    hrs_am numeric(6,1),
    job_ctrl_nbr_id character(9),
    work_ctr_event_id integer,
    orig_cmd_cd character(3),
    orig_geo_loc_id character(4),
    unit_id character(1),
    lru_capability_nbr_in integer,
    stop_yr_mo integer,
    start_yr_mo integer,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer,
    end_itm_capability_nbr_id integer,
    override_stat_in character(1),
    start_dt date,
    stop_dt date,
    source_srd_id character(3),
    documenter_nm character(96),
    ins_rpt_ind_yr_mo_id integer,
    ins_proc_dt_tm timestamp(6) without time zone,
    upd_rpt_ind_yr_mo_id integer,
    upd_proc_dt_tm timestamp(6) without time zone,
    last_post_dt_tm timestamp(6) without time zone
);


ALTER TABLE remis.stat OWNER TO creator_role;

--
-- Name: stat_cd; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.stat_cd (
    stat_cd character(1) NOT NULL,
    stat_acronym_cd character(6),
    comments_tx character(54),
    start_dt_tm timestamp(6) without time zone NOT NULL,
    stop_dt_tm timestamp(6) without time zone,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer,
    severity_id integer
);


ALTER TABLE remis.stat_cd OWNER TO creator_role;

--
-- Name: support_general; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.support_general (
    support_general_nbr_id numeric(10,0) NOT NULL,
    equip_desig_id character(15) NOT NULL,
    cmd_cd character(3) NOT NULL,
    yr_id integer NOT NULL,
    as_of_dt_tm timestamp(6) without time zone NOT NULL,
    geo_loc_id character(4) NOT NULL,
    mo_id integer NOT NULL,
    srd_id character(3) NOT NULL,
    org_nbr_id integer,
    org_kind_tx character(3),
    org_type_tx character(2),
    orig_cmd_cd character(3),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.support_general OWNER TO creator_role;

--
-- Name: support_general_detail; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.support_general_detail (
    type_maint_cd character(1) NOT NULL,
    units_am integer,
    support_general_nbr_id numeric(10,0) NOT NULL,
    labor_manhrs_am numeric(6,1),
    work_ctr_cd character(5) NOT NULL,
    wuc_cd character(15) NOT NULL,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.support_general_detail OWNER TO creator_role;

--
-- Name: sys_capability; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.sys_capability (
    sys_level_equip_desig_id character(15) NOT NULL,
    sys_level_sn_id character(15) NOT NULL,
    lower_assy_equip_desig_id character(15) NOT NULL,
    lower_assy_sn_id character(15) NOT NULL,
    as_of_dt_tm timestamp(6) without time zone NOT NULL,
    fmc_cnt_in integer,
    pmc_cnt_in integer,
    nmc_cnt_in integer,
    stat_reason_cd character(1) NOT NULL,
    end_itm_capability_nbr_id integer NOT NULL,
    insert_dt_tm timestamp(6) without time zone NOT NULL,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer,
    remis_op_cd character(1)
);


ALTER TABLE remis.sys_capability OWNER TO creator_role;

--
-- Name: tcto_applicability; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.tcto_applicability (
    alc_cd character(2) NOT NULL,
    equip_desig_id character(15) NOT NULL,
    tcto_data_cd character(7) NOT NULL,
    cage_cd character(5) NOT NULL,
    type_equip_id character(1),
    units_am integer,
    units_accomplished_am integer,
    serially_tracked_in character(1),
    equip_desig_app_in character(1),
    sn_app_in character(1),
    tcto_nbr_id character(25),
    config_itm_id character(7),
    part_roll_in character(1),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.tcto_applicability OWNER TO creator_role;

--
-- Name: tcto_appvd_config_roll; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.tcto_appvd_config_roll (
    higher_assy_wuc_cd character(15) NOT NULL,
    higher_assy_loc_id character(15) NOT NULL,
    lower_assy_equip_desig_id character(15) NOT NULL,
    lower_assy_cage_cd character(5) NOT NULL,
    wuc_cd character(15) NOT NULL,
    higher_assy_equip_desig_id character(15) NOT NULL,
    tcto_data_cd character(7) NOT NULL,
    higher_assy_cage_cd character(5) NOT NULL,
    multi_config_cd character(3) NOT NULL,
    equip_desig_id character(15) NOT NULL,
    block_nbr_id character(3) NOT NULL,
    loc_id character(15) NOT NULL,
    criticality_in character(1) NOT NULL,
    actn_in character(1),
    del_flag_in character(1),
    alc_cd character(2),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.tcto_appvd_config_roll OWNER TO creator_role;

--
-- Name: tcto_cpin_relationship; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.tcto_cpin_relationship (
    alc_cd character(2) NOT NULL,
    cptr_prog_id_nbr_prefix_tx character(2) NOT NULL,
    equip_desig_id character(15) NOT NULL,
    cptr_prog_id_nbr_id character(40) NOT NULL,
    cptr_prog_id_nbr_suffix_tx character(6) NOT NULL,
    tcto_data_cd character(7) NOT NULL,
    cage_cd character(5) NOT NULL,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.tcto_cpin_relationship OWNER TO creator_role;

--
-- Name: tcto_deviation_waiver; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.tcto_deviation_waiver (
    alc_cd character(2) NOT NULL,
    equip_desig_id character(15),
    cage_cd character(5) NOT NULL,
    deviation_nbr_id character(5) NOT NULL,
    del_flag_id character(1),
    tcto_data_cd character(7) NOT NULL,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.tcto_deviation_waiver OWNER TO creator_role;

--
-- Name: tcto_kit; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.tcto_kit (
    tcto_data_cd character(7) NOT NULL,
    material_mgmt_cd character(2) NOT NULL,
    kit_ltr_desig_id character(1) NOT NULL,
    kit_data_cd_nbr_cd character(7) NOT NULL,
    fsg_id character(2) NOT NULL,
    fsc_id character(2) NOT NULL,
    equip_desig_id character(15) NOT NULL,
    cage_cd character(5) NOT NULL,
    alc_cd character(2) NOT NULL,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.tcto_kit OWNER TO creator_role;

--
-- Name: tcto_part_nbr_roll; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.tcto_part_nbr_roll (
    alc_cd character(2) NOT NULL,
    equip_desig_id character(15) NOT NULL,
    cage_cd character(5) NOT NULL,
    tcto_data_cd character(7) NOT NULL,
    new_equip_desig_id character(15) NOT NULL,
    new_cage_cd character(5) NOT NULL,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.tcto_part_nbr_roll OWNER TO creator_role;

--
-- Name: tcto_relationship; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.tcto_relationship (
    tcto_data_cd character(7) NOT NULL,
    related_tcto_data_cd character(7) NOT NULL,
    relationship_cd character(1) NOT NULL,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.tcto_relationship OWNER TO creator_role;

--
-- Name: tcto_stat; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.tcto_stat (
    alc_cd character(2) NOT NULL,
    equip_desig_id character(15),
    sn_id character(15) NOT NULL,
    lot_nbr_id character(15) NOT NULL,
    cage_cd character(5) NOT NULL,
    tcto_data_cd character(7) NOT NULL,
    stat_dt_tm timestamp(6) without time zone,
    geo_loc_id character(4),
    tcto_stat_cd integer,
    cmd_cd character(3),
    org_type_tx character(2),
    org_kind_tx character(3),
    actual_hrs_am numeric(8,1),
    org_nbr_id integer,
    kit_proof_in character(1),
    block_nbr_id character(3),
    work_ctr_cd character(5),
    sn_eff_in character(1),
    end_itm_equip_desig_id character(15),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer,
    pass_or_fail_in character(1) NOT NULL,
    insert_dt_tm timestamp(6) without time zone,
    documenter_nm character(96),
    documenter_nm_upd character(96),
    insert_mgr_nm character(96),
    update_mgr_nm character(96),
    serialized_part_cage_cd character(5),
    detachment_id character(2),
    job_cntrl_id character(9),
    wrk_ctr_evnt_id integer,
    ddr_seq_id integer
);


ALTER TABLE remis.tcto_stat OWNER TO creator_role;

--
-- Name: tcto_stat_cd; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.tcto_stat_cd (
    tcto_stat_cd integer NOT NULL,
    start_dt_tm timestamp(6) without time zone NOT NULL,
    stop_dt_tm timestamp(6) without time zone,
    nomenclature_tx character(35),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.tcto_stat_cd OWNER TO creator_role;

--
-- Name: tcto_units_by_base; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.tcto_units_by_base (
    alc_cd character(2) NOT NULL,
    tcto_data_cd character(7) NOT NULL,
    equip_desig_id character(15) NOT NULL,
    geo_loc_id character(4) NOT NULL,
    cage_cd character(5) NOT NULL,
    cmd_cd character(3) NOT NULL,
    total_units_am integer,
    units_accomplished_am integer,
    actual_hrs_am numeric(8,1),
    org_nbr_id integer,
    org_type_tx character(2),
    org_kind_tx character(3),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer,
    tot_units_fail_am integer NOT NULL,
    tot_units_pass_am integer NOT NULL
);


ALTER TABLE remis.tcto_units_by_base OWNER TO creator_role;

--
-- Name: test_station_lru_capabilities; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.test_station_lru_capabilities (
    test_station_equip_desig_id character(15) NOT NULL,
    test_station_sn_id character(15) NOT NULL,
    lru_wuc_cd character(15),
    end_itm_equip_desig_id character(15) NOT NULL,
    start_dt_tm timestamp(6) without time zone NOT NULL,
    stop_dt_tm timestamp(6) without time zone,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.test_station_lru_capabilities OWNER TO creator_role;

--
-- Name: time_chng_inspection_inv; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.time_chng_inspection_inv (
    end_itm_equip_desig_id character(15) NOT NULL,
    block_nbr_id character(3) NOT NULL,
    equip_desig_id character(15) NOT NULL,
    sn_id character(15) NOT NULL,
    cage_cd character(5) NOT NULL,
    lot_nbr_id character(15) NOT NULL,
    job_std_nbr_id character(6) NOT NULL,
    arbitrary_id numeric(10,0) NOT NULL,
    as_of_dt_tm timestamp(6) without time zone NOT NULL,
    type_equip_id character(1),
    due_tm numeric(10,1),
    cmd_cd character(3),
    org_nbr_id integer,
    org_kind_tx character(3),
    org_type_tx character(2),
    geo_loc_id character(4),
    freq_am integer NOT NULL,
    type_interval_id character(1),
    maint_actn_nbr_id numeric(10,0),
    wuc_cd character(15),
    time_chng_insp_frmt_in character(1),
    type_insp_cd character(1) NOT NULL,
    on_off_in character(1) NOT NULL,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.time_chng_inspection_inv OWNER TO creator_role;

--
-- Name: time_compliance_tech_ordr; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.time_compliance_tech_ordr (
    tcto_data_cd character(7) NOT NULL,
    tcto_nbr_id character(25),
    tcto_type character(1),
    tcto_units_am integer,
    units_accomplished_am integer,
    tcto_nomentclature_tx character(40),
    mod_class character(2),
    pub_dt timestamp(6) without time zone,
    recission_dt timestamp(6) without time zone,
    ecp_nbr_id character(12),
    level_of_maint character(1),
    safety_id character(1),
    estimated_manhrs_am integer,
    issue_activity character(6),
    compliance_period_tm integer,
    special_tools_requ_in character(1),
    special_parts_req_in character(1),
    kits_req_in character(1),
    mod_mgr_id character(5),
    mod_nbr_id character(6),
    del_flag_in character(1),
    weight_balance_in character(1),
    time_chng_itm_in character(1),
    ground_removal_dt timestamp(6) without time zone,
    push_dt timestamp(6) without time zone,
    applicability_cd character(1),
    deviation_nbr_in character(1),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer,
    tech_dir_cd character(2),
    td_basic_nbr character(4),
    td_interim_cd character(1),
    td_revision_letter character(1),
    td_admendment character(1),
    td_part character(2)
);


ALTER TABLE remis.time_compliance_tech_ordr OWNER TO creator_role;

--
-- Name: trainer_nomenclature; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.trainer_nomenclature (
    alc_cd character(2),
    equip_desig_id character(15),
    sn_id character(15) NOT NULL,
    nomenclature_tx character(35),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.trainer_nomenclature OWNER TO creator_role;

--
-- Name: type_maint_cd; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.type_maint_cd (
    type_maint_cd character(1) NOT NULL,
    start_dt_tm timestamp(6) without time zone NOT NULL,
    type_maint_class_in integer,
    nomenclature_tx character(35),
    stop_dt_tm timestamp(6) without time zone,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.type_maint_cd OWNER TO creator_role;

--
-- Name: type_maint_cd_group; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.type_maint_cd_group (
    type_maint_cd_group_id integer NOT NULL,
    type_maint_list_cd character(26),
    start_dt_tm timestamp(6) without time zone NOT NULL,
    stop_dt_tm timestamp(6) without time zone,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.type_maint_cd_group OWNER TO creator_role;

--
-- Name: type_util; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.type_util (
    type_util_cd character(4) NOT NULL,
    start_dt_tm timestamp(6) without time zone NOT NULL,
    stop_dt_tm timestamp(6) without time zone,
    type_equip_id character(1),
    comments_tx character(54),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.type_util OWNER TO creator_role;

--
-- Name: util; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.util (
    start_dt_tm timestamp(6) without time zone NOT NULL,
    rpt_mo_ind_yr_tm integer NOT NULL,
    rpt_mo_ind_mo_tm integer NOT NULL,
    mod_rmi_yr_tm integer NOT NULL,
    mod_rmi_mo_tm integer NOT NULL,
    prog_element_cd character(10) NOT NULL,
    util_purp_cd character(2) NOT NULL,
    type_util_cd character(4) NOT NULL,
    due_in_dt timestamp(6) without time zone NOT NULL,
    yr_id integer NOT NULL,
    initial_start_dt_tm timestamp(6) without time zone NOT NULL,
    mo_id integer NOT NULL,
    initial_stop_dt_tm timestamp(6) without time zone NOT NULL,
    initial_due_in_dt timestamp(6) without time zone NOT NULL,
    stop_dt_tm timestamp(6) without time zone,
    hrs_am numeric(6,1),
    sorties_am integer,
    landings_am integer,
    arbitrary_id numeric(10,0) NOT NULL,
    full_stop_landings_am integer,
    stress_factor_cd character(1),
    base_trx_dt timestamp(6) without time zone,
    sortie_dt integer,
    sortie_nbr_id integer,
    sortie_mod integer,
    mission_nmbr_cd character(12),
    takeoff_icao_loc_id character(4),
    landing_icao_loc_id character(4),
    stop_yr_mo integer,
    start_yr_mo integer,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer,
    proc_dt_tm timestamp(6) without time zone,
    del_proc_dt_tm timestamp(6) without time zone,
    ins_rpt_ind_yr_mo_id integer,
    del_rpt_ind_yr_mo_id integer,
    initial_takeoff_dt_tm timestamp(6) without time zone,
    final_takeoff_dt_tm timestamp(6) without time zone,
    final_landing_dt_tm timestamp(6) without time zone
);


ALTER TABLE remis.util OWNER TO creator_role;

--
-- Name: when_dscvrd_cd; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.when_dscvrd_cd (
    when_dscvrd_class_in integer,
    when_dscvrd_cd character(1) NOT NULL,
    stop_dt_tm timestamp(6) without time zone,
    start_dt_tm timestamp(6) without time zone NOT NULL,
    nomenclature_tx character(40),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.when_dscvrd_cd OWNER TO creator_role;

--
-- Name: when_dscvrd_cd_group; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.when_dscvrd_cd_group (
    when_dscvrd_cd_list_tx character(36),
    when_dscvrd_cd_group_id integer NOT NULL,
    stop_dt_tm timestamp(6) without time zone,
    start_dt_tm timestamp(6) without time zone NOT NULL,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.when_dscvrd_cd_group OWNER TO creator_role;

--
-- Name: wire_integrity_pgm_dtl; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.wire_integrity_pgm_dtl (
    maint_actn_nbr_id integer NOT NULL,
    cndctv_pth_failed_elem_typ_cd character(10),
    cndctv_pth_failed_elem_tx character varying(45),
    cndctv_pth_fslg_stn_loc_cd character(10),
    cndctv_pth_wtr_lin_loc_cd character(10),
    cndctv_pth_panel_loc_cd character(10),
    cndctv_pth_optnl_loc_cd character(10),
    cndctv_pth_fail_md_cd character(15),
    cndctv_pth_fail_caus_tx character varying(50),
    cndctv_pth_soln_tx character varying(20),
    rmk_tx character varying(150),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.wire_integrity_pgm_dtl OWNER TO creator_role;

--
-- Name: work_ctr; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.work_ctr (
    work_ctr_cd character(5) NOT NULL,
    stop_dt_tm timestamp(6) without time zone,
    start_dt_tm timestamp(6) without time zone NOT NULL,
    org_type_tx character(2) NOT NULL,
    org_nbr_id integer,
    org_kind_tx character(3) NOT NULL,
    geo_loc_id character(4) NOT NULL,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.work_ctr OWNER TO creator_role;

--
-- Name: wuc; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.wuc (
    alc_cd character(2) NOT NULL,
    equip_desig_id character(15) NOT NULL,
    wuc_cd character(15) NOT NULL,
    start_dt_tm timestamp(6) without time zone NOT NULL,
    stop_dt_tm timestamp(6) without time zone,
    serially_tracked_in character(1),
    failure_limit_am integer,
    pub_dt timestamp(6) without time zone,
    replacement_in character(1),
    nrts_in character(1),
    usage_factor numeric(4,2),
    actn_limit_am integer,
    qty_per_app_qy integer,
    special_or_end_piece_inv_in integer,
    category_of_failure_in character(1),
    inspection_req_tx character(7),
    orig_wuc_cd character(15),
    block_nbr_in character(1),
    type_equip_id character(1),
    desc_tx character(150),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.wuc OWNER TO creator_role;

--
-- Name: wuc_block; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.wuc_block (
    alc_cd character(2) NOT NULL,
    wuc_cd character(15) NOT NULL,
    equip_desig_id character(15) NOT NULL,
    block_nbr_id character(3) NOT NULL,
    start_dt_tm timestamp(6) without time zone NOT NULL,
    stop_dt_tm timestamp(6) without time zone,
    serially_tracked_in character(1),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.wuc_block OWNER TO creator_role;

--
-- Name: wuc_loc; Type: TABLE; Schema: remis; Owner: creator_role
--

CREATE TABLE remis.wuc_loc (
    equip_desig_id character(15),
    wuc_cd character(15) NOT NULL,
    loc_id character(15),
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE remis.wuc_loc OWNER TO creator_role;

--
-- Name: HEATMAP; Type: TABLE; Schema: sandbox; Owner: postgres
--

CREATE TABLE sandbox."HEATMAP" (
    index bigint,
    sn_id text,
    mds text,
    mds_flg text,
    start_tm text,
    stop_tm text,
    delta_t double precision,
    cat_ppc text,
    status text,
    tai text,
    possessed text,
    apc text,
    alc_cd text,
    poss_cmdcd text,
    assig_cmdcd text,
    poss_orgnum double precision,
    poss_orgkind text,
    poss_orgtype text,
    assig_orgnum double precision,
    assig_orgkind text,
    assig_orgtype text,
    arbitrary_id text,
    assig_geoloc text,
    poss_geoloc text,
    stat_wuc text
);


ALTER TABLE sandbox."HEATMAP" OWNER TO postgres;

--
-- Name: asgn_timeline_stat; Type: TABLE; Schema: sandbox; Owner: postgres
--

CREATE TABLE sandbox.asgn_timeline_stat (
    event_equip_desig_id character(15),
    event_sn_id character(15),
    event_start_dt_tm timestamp without time zone,
    event_stop_dt_tm timestamp without time zone,
    event_delta_seconds double precision,
    asgn_start_dt_tm timestamp(6) without time zone,
    asgn_stop_dt_tm timestamp(6) without time zone,
    asgn_adj_stop_dt_tm timestamp without time zone,
    asgn_equip_desig_id character(15),
    asgn_sn_id character(15),
    asgn_alc_cd character(2),
    asgn_cmd_cd character(3),
    asgn_purp_cd character(2),
    asgn_geo_loc_id character(4),
    asgn_org_nbr_id integer,
    asgn_org_kind_tx character(3),
    asgn_assig_proj_tx character(8),
    asgn_org_type_tx character(2),
    asgn_prog_element_cd character(10),
    asgn_assig_directive_tx character(6),
    asgn_assig_dt timestamp(6) without time zone,
    asgn_start_user_name_tx character(96),
    asgn_stop_user_name_tx character(96),
    asgn_lm_dt_tm timestamp(6) without time zone,
    asgn_remis_dt_tm timestamp(6) without time zone,
    asgn_remis_rba integer,
    asgn_fund_cd character(2),
    asgn_appropriation_cd character(14),
    asgn_budget_cd character(1),
    asgn_sales_cd character(3),
    asgn_type_of_acquisition character(30),
    asgn_doc_id_cd character(3),
    asgn_remarks character(80),
    asgn_contract_nbr_po_other_id character(50),
    asgn_inv_recv_rpt_nbr character(50),
    asgn_acq_frm_cmd_cd character(3),
    asgn_accumulated_depreciation numeric(12,2),
    asgn_fnl_termn_typ_actn_cd character(1),
    asgn_termn_dt_tm timestamp(6) without time zone
);


ALTER TABLE sandbox.asgn_timeline_stat OWNER TO postgres;

--
-- Name: asgn_timeline_util; Type: TABLE; Schema: sandbox; Owner: postgres
--

CREATE TABLE sandbox.asgn_timeline_util (
    event_equip_desig_id character(15),
    event_sn_id character(15),
    event_start_dt_tm timestamp without time zone,
    event_stop_dt_tm timestamp without time zone,
    event_delta_seconds double precision,
    asgn_start_dt_tm timestamp(6) without time zone,
    asgn_stop_dt_tm timestamp(6) without time zone,
    asgn_adj_stop_dt_tm timestamp without time zone,
    asgn_equip_desig_id character(15),
    asgn_sn_id character(15),
    asgn_alc_cd character(2),
    asgn_cmd_cd character(3),
    asgn_purp_cd character(2),
    asgn_geo_loc_id character(4),
    asgn_org_nbr_id integer,
    asgn_org_kind_tx character(3),
    asgn_assig_proj_tx character(8),
    asgn_org_type_tx character(2),
    asgn_prog_element_cd character(10),
    asgn_assig_directive_tx character(6),
    asgn_assig_dt timestamp(6) without time zone,
    asgn_start_user_name_tx character(96),
    asgn_stop_user_name_tx character(96),
    asgn_lm_dt_tm timestamp(6) without time zone,
    asgn_remis_dt_tm timestamp(6) without time zone,
    asgn_remis_rba integer,
    asgn_fund_cd character(2),
    asgn_appropriation_cd character(14),
    asgn_budget_cd character(1),
    asgn_sales_cd character(3),
    asgn_type_of_acquisition character(30),
    asgn_doc_id_cd character(3),
    asgn_remarks character(80),
    asgn_contract_nbr_po_other_id character(50),
    asgn_inv_recv_rpt_nbr character(50),
    asgn_acq_frm_cmd_cd character(3),
    asgn_accumulated_depreciation numeric(12,2),
    asgn_fnl_termn_typ_actn_cd character(1),
    asgn_termn_dt_tm timestamp(6) without time zone
);


ALTER TABLE sandbox.asgn_timeline_util OWNER TO postgres;

--
-- Name: initial_timeline_stat; Type: TABLE; Schema: sandbox; Owner: postgres
--

CREATE TABLE sandbox.initial_timeline_stat (
    event_equip_desig_id character(15),
    event_sn_id character(15),
    event_start_dt_tm timestamp without time zone,
    event_stop_dt_tm timestamp without time zone,
    event_delta_seconds double precision
);


ALTER TABLE sandbox.initial_timeline_stat OWNER TO postgres;

--
-- Name: initial_timeline_util; Type: TABLE; Schema: sandbox; Owner: postgres
--

CREATE TABLE sandbox.initial_timeline_util (
    event_equip_desig_id character(15),
    event_sn_id character(15),
    event_start_dt_tm timestamp without time zone,
    event_stop_dt_tm timestamp without time zone,
    event_delta_seconds double precision
);


ALTER TABLE sandbox.initial_timeline_util OWNER TO postgres;

--
-- Name: manpower_civ; Type: TABLE; Schema: sandbox; Owner: creator_role
--

CREATE TABLE sandbox.manpower_civ (
    index bigint,
    month_id timestamp without time zone,
    component text,
    afs text,
    afs_desc text,
    afsc_deskill text,
    afsc text,
    pec text,
    pec_desc text,
    osc text,
    pas text,
    majcom text,
    pas_nr text,
    uic text,
    unit_desc text,
    installation_loc_name text,
    eofy_auth bigint,
    asgd bigint,
    req_auth bigint
);


ALTER TABLE sandbox.manpower_civ OWNER TO creator_role;

--
-- Name: manpower_mil; Type: TABLE; Schema: sandbox; Owner: creator_role
--

CREATE TABLE sandbox.manpower_mil (
    index bigint,
    month_id timestamp without time zone,
    component text,
    cat_employment text,
    afs text,
    afs_desc text,
    afsc_deskill text,
    afsc_desc text,
    afsc text,
    pec text,
    pec_desc text,
    skl_lvl text,
    osc text,
    pas text,
    majcom text,
    pas_nr text,
    uic text,
    unit_desc text,
    installation_loc_name text,
    eofy_auth bigint,
    asgd bigint,
    req_auth bigint
);


ALTER TABLE sandbox.manpower_mil OWNER TO creator_role;

--
-- Name: mx_actn_heatmap; Type: TABLE; Schema: sandbox; Owner: postgres
--

CREATE TABLE sandbox.mx_actn_heatmap (
    actn_taken_cd character(1),
    maint_actn_nbr_id numeric(10,0),
    labor_manhrs_am numeric(6,1),
    how_mal_cd integer,
    crew_size_am integer,
    category_of_labor_id integer,
    work_ctr_cd character(5),
    when_dscvrd_cd character(1),
    type_maint_cd character(1),
    mx_start_dt_tm timestamp(6) without time zone,
    mx_wuc_cd character(15),
    perf_geo_loc_id character(4),
    mx_stop_dt_tm timestamp(6) without time zone,
    mx_cmd_cd bpchar,
    mx_mds text,
    mx_geo_loc_id bpchar,
    job_ctrl_nbr_id bpchar,
    mx_sn_id text,
    tcto_data_cd bpchar,
    htmp_sn_id text,
    htmp_start_tm timestamp(6) without time zone,
    htmp_stop_tm timestamp(6) without time zone,
    delta_t double precision,
    cat_ppc text,
    status text,
    tai text,
    possessed text,
    apc text,
    poss_cmdcd text,
    assig_cmdcd text,
    assig_geoloc text,
    poss_geoloc text,
    stat_wuc text,
    af_speciality_cd character(5)
);


ALTER TABLE sandbox.mx_actn_heatmap OWNER TO postgres;

--
-- Name: mx_actn_heatmap_failures; Type: TABLE; Schema: sandbox; Owner: creator_role
--

CREATE TABLE sandbox.mx_actn_heatmap_failures (
    actn_taken_cd character(1),
    labor_manhrs_am numeric(6,1),
    how_mal_cd integer,
    crew_size_am integer,
    category_of_labor_id integer,
    work_ctr_cd character(5),
    when_dscvrd_cd character(1),
    type_maint_cd character(1),
    mx_start_dt_tm timestamp(6) without time zone,
    mx_wuc_cd character(15),
    perf_geo_loc_id character(4),
    mx_stop_dt_tm timestamp(6) without time zone,
    mx_cmd_cd character varying(3),
    mx_mds character varying(15),
    mx_geo_loc_id character varying(4),
    job_ctrl_nbr_id character varying(9),
    mx_sn_id character varying(15),
    tcto_data_cd character varying(7),
    htmp_sn_id text,
    htmp_start_tm timestamp(6) without time zone,
    htmp_stop_tm timestamp(6) without time zone,
    delta_t double precision,
    cat_ppc text,
    status text,
    tai text,
    possessed text,
    apc text,
    poss_cmdcd text,
    assig_cmdcd text,
    assig_geoloc text,
    poss_geoloc text,
    stat_wuc text,
    type1 integer,
    type2 integer,
    type6 integer
);


ALTER TABLE sandbox.mx_actn_heatmap_failures OWNER TO creator_role;

--
-- Name: poss_timeline_stat; Type: TABLE; Schema: sandbox; Owner: postgres
--

CREATE TABLE sandbox.poss_timeline_stat (
    event_equip_desig_id character(15),
    event_sn_id character(15),
    event_start_dt_tm timestamp without time zone,
    event_stop_dt_tm timestamp without time zone,
    event_delta_seconds double precision,
    poss_start_dt_tm timestamp(6) without time zone,
    poss_stop_dt_tm timestamp(6) without time zone,
    poss_equip_desig_id character(15),
    poss_sn_id character(15),
    poss_arbitrary_id numeric(10,0),
    poss_cmd_cd character(3),
    poss_geo_loc_id character(4),
    poss_org_nbr_id integer,
    poss_org_kind_tx character(3),
    poss_unit_id character(9),
    poss_org_type_tx character(2),
    poss_purp_cd character(2),
    poss_loan_cd character(1),
    poss_gain_type_actn_cd character(1),
    poss_loss_type_actn_cd character(1),
    poss_termination_type_actn_cd character(1),
    poss_type_op_tm character(1),
    poss_curr_op_tm numeric(7,1),
    poss_srd_id character(3),
    poss_gain_proc_dt_tm timestamp(6) without time zone,
    poss_loss_proc_dt_tm timestamp(6) without time zone,
    poss_data_proc_ctr_nbr_id integer,
    poss_temp_transfer_in character(1),
    poss_equip_id character(5),
    poss_history_in character(1),
    poss_orig_work_ctr_cd character(5),
    poss_work_ctr_cd character(5),
    poss_gang_nbr_id numeric(1,0),
    poss_gain_user_name_tx character(96),
    poss_loss_user_name_tx character(96),
    poss_termination_user_name_tx character(96),
    poss_lm_dt_tm timestamp(6) without time zone,
    poss_remis_dt_tm timestamp(6) without time zone,
    poss_remis_rba integer,
    poss_start_dt date,
    poss_stop_dt date
);


ALTER TABLE sandbox.poss_timeline_stat OWNER TO postgres;

--
-- Name: poss_timeline_util; Type: TABLE; Schema: sandbox; Owner: postgres
--

CREATE TABLE sandbox.poss_timeline_util (
    event_equip_desig_id character(15),
    event_sn_id character(15),
    event_start_dt_tm timestamp without time zone,
    event_stop_dt_tm timestamp without time zone,
    event_delta_seconds double precision,
    poss_start_dt_tm timestamp(6) without time zone,
    poss_stop_dt_tm timestamp(6) without time zone,
    poss_equip_desig_id character(15),
    poss_sn_id character(15),
    poss_arbitrary_id numeric(10,0),
    poss_cmd_cd character(3),
    poss_geo_loc_id character(4),
    poss_org_nbr_id integer,
    poss_org_kind_tx character(3),
    poss_unit_id character(9),
    poss_org_type_tx character(2),
    poss_purp_cd character(2),
    poss_loan_cd character(1),
    poss_gain_type_actn_cd character(1),
    poss_loss_type_actn_cd character(1),
    poss_termination_type_actn_cd character(1),
    poss_type_op_tm character(1),
    poss_curr_op_tm numeric(7,1),
    poss_srd_id character(3),
    poss_gain_proc_dt_tm timestamp(6) without time zone,
    poss_loss_proc_dt_tm timestamp(6) without time zone,
    poss_data_proc_ctr_nbr_id integer,
    poss_temp_transfer_in character(1),
    poss_equip_id character(5),
    poss_history_in character(1),
    poss_orig_work_ctr_cd character(5),
    poss_work_ctr_cd character(5),
    poss_gang_nbr_id numeric(1,0),
    poss_gain_user_name_tx character(96),
    poss_loss_user_name_tx character(96),
    poss_termination_user_name_tx character(96),
    poss_lm_dt_tm timestamp(6) without time zone,
    poss_remis_dt_tm timestamp(6) without time zone,
    poss_remis_rba integer,
    poss_start_dt date,
    poss_stop_dt date
);


ALTER TABLE sandbox.poss_timeline_util OWNER TO postgres;

--
-- Name: remis_ev_on_equip_maint_actn_f16; Type: TABLE; Schema: sandbox; Owner: postgres
--

CREATE TABLE sandbox.remis_ev_on_equip_maint_actn_f16 (
    actn_taken_cd character(1),
    maint_type character(1),
    maint_actn_nbr_id numeric(10,0),
    labor_manhrs_am numeric(6,1),
    inpected_by_nm integer,
    how_mal_cd integer,
    orig_work_ctr_cd character(5),
    emp_nbr_id integer,
    crew_size_am integer,
    component_pos_nbr_id character(4),
    category_of_labor_id integer,
    afto_form_350_tag_nbr_id character(6),
    af_speciality_cd character(5),
    work_ordr_nbr_id numeric(11,0),
    work_ctr_event_id integer,
    work_ctr_cd character(5),
    when_dscvrd_cd character(1),
    units_am integer,
    type_maint_cd character(1),
    supervisory_review_by_nm integer,
    seq_nbr_id integer,
    start_dt_tm timestamp(6) without time zone,
    wuc_cd character(15),
    pmr_nbr_id integer,
    pmr_category character(3),
    perf_geo_loc_id character(4),
    stop_dt_tm timestamp(6) without time zone,
    failure_count_in character(1),
    chng_seq_nbr_id character(11),
    maint_priority_in character(2),
    maintainer_nm character(96),
    documenter_nm character(96),
    comp_maint_actn_nbr_id numeric(10,0),
    aisg_dt_tm timestamp(6) without time zone,
    cmd_cd bpchar,
    curr_op_tm numeric,
    equip_desig_id bpchar,
    geo_loc_id bpchar,
    input_equip_desig_id bpchar,
    job_ctrl_nbr_id bpchar,
    org_nbr_id integer,
    org_kind_tx bpchar,
    org_type_tx bpchar,
    orig_cmd_cd bpchar,
    sn_id bpchar,
    srd_id bpchar,
    tcto_data_cd bpchar,
    type_equip_id bpchar,
    unit_id bpchar,
    stop_yr_mo integer,
    start_yr_mo integer,
    lm_dt_tm timestamp(6) without time zone,
    remis_dt_tm timestamp(6) without time zone,
    remis_rba integer
);


ALTER TABLE sandbox.remis_ev_on_equip_maint_actn_f16 OWNER TO postgres;

--
-- Name: remis_ev_on_equip_maint_actn_mv; Type: MATERIALIZED VIEW; Schema: sandbox; Owner: postgres
--

CREATE MATERIALIZED VIEW sandbox.remis_ev_on_equip_maint_actn_mv AS
 SELECT ma.actn_taken_cd,
    ma.maint_type,
    ma.maint_actn_nbr_id,
    ma.labor_manhrs_am,
    ma.inpected_by_nm,
    ma.how_mal_cd,
    ma.orig_work_ctr_cd,
    ma.emp_nbr_id,
    ma.crew_size_am,
    ma.component_pos_nbr_id,
    ma.category_of_labor_id,
    ma.afto_form_350_tag_nbr_id,
    ma.af_speciality_cd,
    ma.work_ordr_nbr_id,
    ma.work_ctr_event_id,
    ma.work_ctr_cd,
    ma.when_dscvrd_cd,
    ma.units_am,
    ma.type_maint_cd,
    ma.supervisory_review_by_nm,
    ma.seq_nbr_id,
    ma.start_dt_tm,
    ma.wuc_cd,
    ma.pmr_nbr_id,
    ma.pmr_category,
    ma.perf_geo_loc_id,
    ma.stop_dt_tm,
    ma.failure_count_in,
    ma.chng_seq_nbr_id,
    ma.maint_priority_in,
    ma.maintainer_nm,
    ma.documenter_nm,
    ma.comp_maint_actn_nbr_id,
        CASE
            WHEN (wo.aisg_dt_tm IS NULL) THEN '0001-01-02 00:00:00'::timestamp(6) without time zone
            ELSE wo.aisg_dt_tm
        END AS aisg_dt_tm,
        CASE
            WHEN (wo.cmd_cd IS NULL) THEN ' '::bpchar
            ELSE wo.cmd_cd
        END AS cmd_cd,
        CASE
            WHEN (wo.curr_op_tm IS NULL) THEN (0)::numeric
            ELSE wo.curr_op_tm
        END AS curr_op_tm,
        CASE
            WHEN (wo.equip_desig_id IS NULL) THEN ' '::bpchar
            ELSE wo.equip_desig_id
        END AS equip_desig_id,
        CASE
            WHEN (wo.geo_loc_id IS NULL) THEN ' '::bpchar
            ELSE wo.geo_loc_id
        END AS geo_loc_id,
        CASE
            WHEN (wo.input_equip_desig_id IS NULL) THEN ' '::bpchar
            ELSE wo.input_equip_desig_id
        END AS input_equip_desig_id,
        CASE
            WHEN (wo.job_ctrl_nbr_id IS NULL) THEN ' '::bpchar
            ELSE wo.job_ctrl_nbr_id
        END AS job_ctrl_nbr_id,
        CASE
            WHEN (wo.org_nbr_id IS NULL) THEN 0
            ELSE wo.org_nbr_id
        END AS org_nbr_id,
        CASE
            WHEN (wo.org_kind_tx IS NULL) THEN ' '::bpchar
            ELSE wo.org_kind_tx
        END AS org_kind_tx,
        CASE
            WHEN (wo.org_type_tx IS NULL) THEN ' '::bpchar
            ELSE wo.org_type_tx
        END AS org_type_tx,
        CASE
            WHEN (wo.orig_cmd_cd IS NULL) THEN ' '::bpchar
            ELSE wo.orig_cmd_cd
        END AS orig_cmd_cd,
        CASE
            WHEN (wo.sn_id IS NULL) THEN ' '::bpchar
            ELSE wo.sn_id
        END AS sn_id,
        CASE
            WHEN (wo.srd_id IS NULL) THEN ' '::bpchar
            ELSE wo.srd_id
        END AS srd_id,
        CASE
            WHEN (wo.tcto_data_cd IS NULL) THEN ' '::bpchar
            ELSE wo.tcto_data_cd
        END AS tcto_data_cd,
        CASE
            WHEN (wo.type_equip_id IS NULL) THEN ' '::bpchar
            ELSE wo.type_equip_id
        END AS type_equip_id,
        CASE
            WHEN (wo.unit_id IS NULL) THEN ' '::bpchar
            ELSE wo.unit_id
        END AS unit_id,
    ma.stop_yr_mo,
    ma.start_yr_mo,
    ma.lm_dt_tm,
    ma.remis_dt_tm,
    ma.remis_rba
   FROM (remis.on_equip_maint_actn ma
     LEFT JOIN remis.on_equip_work_ordr wo ON ((ma.work_ordr_nbr_id = wo.work_ordr_nbr_id)))
  WITH NO DATA;


ALTER TABLE sandbox.remis_ev_on_equip_maint_actn_mv OWNER TO postgres;

--
-- Name: stat_timeline_stat; Type: TABLE; Schema: sandbox; Owner: postgres
--

CREATE TABLE sandbox.stat_timeline_stat (
    event_equip_desig_id character(15),
    event_sn_id character(15),
    event_start_dt_tm timestamp without time zone,
    event_stop_dt_tm timestamp without time zone,
    event_delta_seconds double precision,
    stat_start_dt_tm timestamp(6) without time zone,
    stat_stop_dt_tm timestamp(6) without time zone,
    stat_adj_stop_dt_tm timestamp without time zone,
    stat_sn_id character(15),
    stat_equip_desig_id character(15),
    stat_arbitrary_id numeric(10,0),
    stat_cd character(1),
    stat_loc_id character(15),
    stat_type character(1),
    stat_yr_id integer,
    stat_mo_id integer,
    stat_wuc_cd character(15),
    stat_as_of_dt_tm timestamp(6) without time zone,
    stat_hrs_am numeric(6,1),
    stat_job_ctrl_nbr_id character(9),
    stat_work_ctr_event_id integer,
    stat_orig_cmd_cd character(3),
    stat_orig_geo_loc_id character(4),
    stat_unit_id character(1),
    stat_lru_capability_nbr_in integer,
    stat_stop_yr_mo integer,
    stat_start_yr_mo integer,
    stat_lm_dt_tm timestamp(6) without time zone,
    stat_remis_dt_tm timestamp(6) without time zone,
    stat_remis_rba integer,
    stat_end_itm_capability_nbr_id integer,
    stat_override_stat_in character(1),
    stat_start_dt date,
    stat_stop_dt date,
    stat_ingest_date text
);


ALTER TABLE sandbox.stat_timeline_stat OWNER TO postgres;

--
-- Name: timeline_stat; Type: TABLE; Schema: sandbox; Owner: postgres
--

CREATE TABLE sandbox.timeline_stat (
    event_equip_desig_id character(15),
    event_sn_id character(15),
    event_start_dt_tm timestamp without time zone,
    event_stop_dt_tm timestamp without time zone,
    event_delta_seconds double precision,
    asgn_start_dt_tm timestamp(6) without time zone,
    asgn_stop_dt_tm timestamp(6) without time zone,
    asgn_adj_stop_dt_tm timestamp without time zone,
    asgn_equip_desig_id character(15),
    asgn_sn_id character(15),
    asgn_alc_cd character(2),
    asgn_cmd_cd character(3),
    asgn_purp_cd character(2),
    asgn_geo_loc_id character(4),
    asgn_org_nbr_id integer,
    asgn_org_kind_tx character(3),
    asgn_assig_proj_tx character(8),
    asgn_org_type_tx character(2),
    asgn_prog_element_cd character(10),
    asgn_assig_directive_tx character(6),
    asgn_assig_dt timestamp(6) without time zone,
    asgn_start_user_name_tx character(96),
    asgn_stop_user_name_tx character(96),
    asgn_lm_dt_tm timestamp(6) without time zone,
    asgn_remis_dt_tm timestamp(6) without time zone,
    asgn_remis_rba integer,
    asgn_fund_cd character(2),
    asgn_appropriation_cd character(14),
    asgn_budget_cd character(1),
    asgn_sales_cd character(3),
    asgn_type_of_acquisition character(30),
    asgn_doc_id_cd character(3),
    asgn_remarks character(80),
    asgn_contract_nbr_po_other_id character(50),
    asgn_inv_recv_rpt_nbr character(50),
    asgn_acq_frm_cmd_cd character(3),
    asgn_accumulated_depreciation numeric(12,2),
    asgn_fnl_termn_typ_actn_cd character(1),
    asgn_termn_dt_tm timestamp(6) without time zone,
    poss_start_dt_tm timestamp(6) without time zone,
    poss_stop_dt_tm timestamp(6) without time zone,
    poss_equip_desig_id character(15),
    poss_sn_id character(15),
    poss_arbitrary_id numeric(10,0),
    poss_cmd_cd character(3),
    poss_geo_loc_id character(4),
    poss_org_nbr_id integer,
    poss_org_kind_tx character(3),
    poss_unit_id character(9),
    poss_org_type_tx character(2),
    poss_purp_cd character(2),
    poss_loan_cd character(1),
    poss_gain_type_actn_cd character(1),
    poss_loss_type_actn_cd character(1),
    poss_termination_type_actn_cd character(1),
    poss_type_op_tm character(1),
    poss_curr_op_tm numeric(7,1),
    poss_srd_id character(3),
    poss_gain_proc_dt_tm timestamp(6) without time zone,
    poss_loss_proc_dt_tm timestamp(6) without time zone,
    poss_data_proc_ctr_nbr_id integer,
    poss_temp_transfer_in character(1),
    poss_equip_id character(5),
    poss_history_in character(1),
    poss_orig_work_ctr_cd character(5),
    poss_work_ctr_cd character(5),
    poss_gang_nbr_id numeric(1,0),
    poss_gain_user_name_tx character(96),
    poss_loss_user_name_tx character(96),
    poss_termination_user_name_tx character(96),
    poss_lm_dt_tm timestamp(6) without time zone,
    poss_remis_dt_tm timestamp(6) without time zone,
    poss_remis_rba integer,
    poss_start_dt date,
    poss_stop_dt date,
    stat_start_dt_tm timestamp(6) without time zone,
    stat_stop_dt_tm timestamp(6) without time zone,
    stat_adj_stop_dt_tm timestamp without time zone,
    stat_sn_id character(15),
    stat_equip_desig_id character(15),
    stat_arbitrary_id numeric(10,0),
    stat_cd character(1),
    stat_loc_id character(15),
    stat_type character(1),
    stat_yr_id integer,
    stat_mo_id integer,
    stat_wuc_cd character(15),
    stat_as_of_dt_tm timestamp(6) without time zone,
    stat_hrs_am numeric(6,1),
    stat_job_ctrl_nbr_id character(9),
    stat_work_ctr_event_id integer,
    stat_orig_cmd_cd character(3),
    stat_orig_geo_loc_id character(4),
    stat_unit_id character(1),
    stat_lru_capability_nbr_in integer,
    stat_stop_yr_mo integer,
    stat_start_yr_mo integer,
    stat_lm_dt_tm timestamp(6) without time zone,
    stat_remis_dt_tm timestamp(6) without time zone,
    stat_remis_rba integer,
    stat_end_itm_capability_nbr_id integer,
    stat_override_stat_in character(1),
    stat_start_dt date,
    stat_stop_dt date,
    stat_ingest_date text
);


ALTER TABLE sandbox.timeline_stat OWNER TO postgres;

--
-- Name: timeline_util; Type: TABLE; Schema: sandbox; Owner: postgres
--

CREATE TABLE sandbox.timeline_util (
    event_equip_desig_id character(15),
    event_sn_id character(15),
    event_start_dt_tm timestamp without time zone,
    event_stop_dt_tm timestamp without time zone,
    event_delta_seconds double precision,
    asgn_start_dt_tm timestamp(6) without time zone,
    asgn_stop_dt_tm timestamp(6) without time zone,
    asgn_adj_stop_dt_tm timestamp without time zone,
    asgn_equip_desig_id character(15),
    asgn_sn_id character(15),
    asgn_alc_cd character(2),
    asgn_cmd_cd character(3),
    asgn_purp_cd character(2),
    asgn_geo_loc_id character(4),
    asgn_org_nbr_id integer,
    asgn_org_kind_tx character(3),
    asgn_assig_proj_tx character(8),
    asgn_org_type_tx character(2),
    asgn_prog_element_cd character(10),
    asgn_assig_directive_tx character(6),
    asgn_assig_dt timestamp(6) without time zone,
    asgn_start_user_name_tx character(96),
    asgn_stop_user_name_tx character(96),
    asgn_lm_dt_tm timestamp(6) without time zone,
    asgn_remis_dt_tm timestamp(6) without time zone,
    asgn_remis_rba integer,
    asgn_fund_cd character(2),
    asgn_appropriation_cd character(14),
    asgn_budget_cd character(1),
    asgn_sales_cd character(3),
    asgn_type_of_acquisition character(30),
    asgn_doc_id_cd character(3),
    asgn_remarks character(80),
    asgn_contract_nbr_po_other_id character(50),
    asgn_inv_recv_rpt_nbr character(50),
    asgn_acq_frm_cmd_cd character(3),
    asgn_accumulated_depreciation numeric(12,2),
    asgn_fnl_termn_typ_actn_cd character(1),
    asgn_termn_dt_tm timestamp(6) without time zone,
    poss_start_dt_tm timestamp(6) without time zone,
    poss_stop_dt_tm timestamp(6) without time zone,
    poss_equip_desig_id character(15),
    poss_sn_id character(15),
    poss_arbitrary_id numeric(10,0),
    poss_cmd_cd character(3),
    poss_geo_loc_id character(4),
    poss_org_nbr_id integer,
    poss_org_kind_tx character(3),
    poss_unit_id character(9),
    poss_org_type_tx character(2),
    poss_purp_cd character(2),
    poss_loan_cd character(1),
    poss_gain_type_actn_cd character(1),
    poss_loss_type_actn_cd character(1),
    poss_termination_type_actn_cd character(1),
    poss_type_op_tm character(1),
    poss_curr_op_tm numeric(7,1),
    poss_srd_id character(3),
    poss_gain_proc_dt_tm timestamp(6) without time zone,
    poss_loss_proc_dt_tm timestamp(6) without time zone,
    poss_data_proc_ctr_nbr_id integer,
    poss_temp_transfer_in character(1),
    poss_equip_id character(5),
    poss_history_in character(1),
    poss_orig_work_ctr_cd character(5),
    poss_work_ctr_cd character(5),
    poss_gang_nbr_id numeric(1,0),
    poss_gain_user_name_tx character(96),
    poss_loss_user_name_tx character(96),
    poss_termination_user_name_tx character(96),
    poss_lm_dt_tm timestamp(6) without time zone,
    poss_remis_dt_tm timestamp(6) without time zone,
    poss_remis_rba integer,
    poss_start_dt date,
    poss_stop_dt date,
    util_start_dt_tm timestamp(6) without time zone,
    util_stop_dt_tm timestamp(6) without time zone,
    util_adj_stop_dt_tm timestamp without time zone,
    util_sn_id character(15),
    util_equip_desig_id character(15),
    util_rpt_mo_ind_yr_tm integer,
    util_rpt_mo_ind_mo_tm integer,
    util_mod_rmi_yr_tm integer,
    util_mod_rmi_mo_tm integer,
    util_prog_element_cd character(10),
    util_util_purp_cd character(2),
    util_type_util_cd character(4),
    util_due_in_dt timestamp(6) without time zone,
    util_yr_id integer,
    util_initial_start_dt_tm timestamp(6) without time zone,
    util_mo_id integer,
    util_initial_stop_dt_tm timestamp(6) without time zone,
    util_initial_due_in_dt timestamp(6) without time zone,
    util_hrs_am numeric(6,1),
    util_sorties_am integer,
    util_landings_am integer,
    util_arbitrary_id numeric(10,0),
    util_full_stop_landings_am integer,
    util_stress_factor_cd character(1),
    util_base_trx_dt timestamp(6) without time zone,
    util_sortie_dt integer,
    util_sortie_nbr_id integer,
    util_sortie_mod integer,
    util_mission_nmbr_cd character(12),
    util_takeoff_icao_loc_id character(4),
    util_landing_icao_loc_id character(4),
    util_stop_yr_mo integer,
    util_start_yr_mo integer,
    util_lm_dt_tm timestamp(6) without time zone,
    util_remis_dt_tm timestamp(6) without time zone,
    util_remis_rba integer,
    util_proc_dt_tm timestamp(6) without time zone,
    util_del_proc_dt_tm timestamp(6) without time zone,
    util_ins_rpt_ind_yr_mo_id integer,
    util_del_rpt_ind_yr_mo_id integer,
    util_initial_takeoff_dt_tm timestamp(6) without time zone,
    util_final_takeoff_dt_tm timestamp(6) without time zone,
    util_final_landing_dt_tm timestamp(6) without time zone,
    util_ingest_date text
);


ALTER TABLE sandbox.timeline_util OWNER TO postgres;

--
-- Name: util_timeline_util; Type: TABLE; Schema: sandbox; Owner: postgres
--

CREATE TABLE sandbox.util_timeline_util (
    event_equip_desig_id character(15),
    event_sn_id character(15),
    event_start_dt_tm timestamp without time zone,
    event_stop_dt_tm timestamp without time zone,
    event_delta_seconds double precision,
    util_start_dt_tm timestamp(6) without time zone,
    util_stop_dt_tm timestamp(6) without time zone,
    util_adj_stop_dt_tm timestamp without time zone,
    util_sn_id character(15),
    util_equip_desig_id character(15),
    util_rpt_mo_ind_yr_tm integer,
    util_rpt_mo_ind_mo_tm integer,
    util_mod_rmi_yr_tm integer,
    util_mod_rmi_mo_tm integer,
    util_prog_element_cd character(10),
    util_util_purp_cd character(2),
    util_type_util_cd character(4),
    util_due_in_dt timestamp(6) without time zone,
    util_yr_id integer,
    util_initial_start_dt_tm timestamp(6) without time zone,
    util_mo_id integer,
    util_initial_stop_dt_tm timestamp(6) without time zone,
    util_initial_due_in_dt timestamp(6) without time zone,
    util_hrs_am numeric(6,1),
    util_sorties_am integer,
    util_landings_am integer,
    util_arbitrary_id numeric(10,0),
    util_full_stop_landings_am integer,
    util_stress_factor_cd character(1),
    util_base_trx_dt timestamp(6) without time zone,
    util_sortie_dt integer,
    util_sortie_nbr_id integer,
    util_sortie_mod integer,
    util_mission_nmbr_cd character(12),
    util_takeoff_icao_loc_id character(4),
    util_landing_icao_loc_id character(4),
    util_stop_yr_mo integer,
    util_start_yr_mo integer,
    util_lm_dt_tm timestamp(6) without time zone,
    util_remis_dt_tm timestamp(6) without time zone,
    util_remis_rba integer,
    util_proc_dt_tm timestamp(6) without time zone,
    util_del_proc_dt_tm timestamp(6) without time zone,
    util_ins_rpt_ind_yr_mo_id integer,
    util_del_rpt_ind_yr_mo_id integer,
    util_initial_takeoff_dt_tm timestamp(6) without time zone,
    util_final_takeoff_dt_tm timestamp(6) without time zone,
    util_final_landing_dt_tm timestamp(6) without time zone,
    util_ingest_date text
);


ALTER TABLE sandbox.util_timeline_util OWNER TO postgres;

--
-- Name: wuci_rollup; Type: TABLE; Schema: sandbox; Owner: creator_role
--

CREATE TABLE sandbox.wuci_rollup (
    index bigint,
    mds text,
    possessed text,
    tai text,
    poss_cmdcd text,
    poss_geoloc text,
    mx_start_yr bigint,
    mx_start_qt bigint,
    status text,
    stat_wuc text,
    mx_wuc2_cd text,
    mx_wuc3_cd text,
    mx_wuc_cd text,
    cat_ppc text,
    labor_manhrs_am double precision,
    crew_size_am bigint,
    wuc_cnt bigint
);


ALTER TABLE sandbox.wuci_rollup OWNER TO creator_role;

--
-- Name: wuci_rollup_sam_test_newdata; Type: TABLE; Schema: sandbox; Owner: creator_role
--

CREATE TABLE sandbox.wuci_rollup_sam_test_newdata (
    index bigint,
    mx_sn_id text,
    mds text,
    possessed text,
    tai text,
    poss_cmdcd text,
    poss_geoloc text,
    mx_start_yr bigint,
    mx_start_mo bigint,
    status text,
    stat_wuc text,
    mx_wuc2_cd text,
    mx_wuc3_cd text,
    mx_wuc_cd text,
    cat_ppc text,
    labor_manhrs_am double precision,
    crew_size_am bigint,
    wuc_cnt bigint
);


ALTER TABLE sandbox.wuci_rollup_sam_test_newdata OWNER TO creator_role;

--
-- Name: F22_WUC; Type: TABLE; Schema: timeline; Owner: creator_role
--

CREATE TABLE timeline."F22_WUC" (
    index bigint,
    "EQUIP_DESIG_ID" text,
    "WUC" text,
    "DESC" text,
    "LinkedWUC" text,
    "COLOR" text
);


ALTER TABLE timeline."F22_WUC" OWNER TO creator_role;

--
-- Name: GEO_LOC; Type: TABLE; Schema: timeline; Owner: creator_role
--

CREATE TABLE timeline."GEO_LOC" (
    index bigint,
    "GEO_AREA_CD" text,
    "GEO_LOC_ID" text,
    "LM_DT_TM" text,
    "LOC_NM" text,
    "REMIS_DT_TM" text,
    "REMIS_RBA" text,
    "START_DT_TM" text,
    "STOP_DT_TM" text,
    "THEATER_CMD_ID" text,
    "TYPE_INST_IN" text,
    "LAST_POST_DT_TM" text
);


ALTER TABLE timeline."GEO_LOC" OWNER TO creator_role;

--
-- Name: HEATMAP; Type: TABLE; Schema: timeline; Owner: creator_role
--

CREATE TABLE timeline."HEATMAP" (
    index bigint,
    sn_id text,
    mds text,
    mds_flg text,
    start_tm text,
    stop_tm text,
    delta_t double precision,
    cat_ppc text,
    status text,
    tai text,
    possessed text,
    apc text,
    alc_cd text,
    poss_cmdcd text,
    assig_cmdcd text,
    poss_orgnum double precision,
    poss_orgkind text,
    poss_orgtype text,
    assig_orgnum double precision,
    assig_orgkind text,
    assig_orgtype text,
    arbitrary_id text,
    assig_geoloc text,
    poss_geoloc text,
    stat_wuc text
);


ALTER TABLE timeline."HEATMAP" OWNER TO creator_role;

--
-- Name: REMIS_WUC; Type: TABLE; Schema: timeline; Owner: creator_role
--

CREATE TABLE timeline."REMIS_WUC" (
    index bigint,
    "WUC" text,
    "DESC" text,
    "COLORPHIL" text,
    "COLOR" text
);


ALTER TABLE timeline."REMIS_WUC" OWNER TO creator_role;

--
-- Name: acft_inv_assig_av; Type: VIEW; Schema: timeline; Owner: creator_role
--

CREATE VIEW timeline.acft_inv_assig_av AS
 SELECT asgn.alc_cd,
    asgn.equip_desig_id,
    asgn.sn_id,
    asgn.start_dt_tm,
    asgn.cmd_cd,
    asgn.purp_cd,
    asgn.geo_loc_id,
    asgn.stop_dt_tm,
    asgn.org_nbr_id,
    asgn.org_kind_tx,
    asgn.assig_proj_tx,
    asgn.org_type_tx,
    asgn.prog_element_cd,
    asgn.assig_directive_tx,
    asgn.assig_dt,
    asgn.start_user_name_tx,
    asgn.stop_user_name_tx,
    asgn.lm_dt_tm,
    asgn.remis_dt_tm,
    asgn.remis_rba,
    asgn.fund_cd,
    asgn.appropriation_cd,
    asgn.budget_cd,
    asgn.sales_cd,
    asgn.type_of_acquisition,
    asgn.doc_id_cd,
    asgn.remarks,
    asgn.contract_nbr_po_other_id,
    asgn.inv_recv_rpt_nbr,
    asgn.acq_frm_cmd_cd,
    asgn.accumulated_depreciation,
    asgn.fnl_termn_typ_actn_cd,
    asgn.termn_dt_tm,
        CASE
            WHEN ((date_part('hour'::text, asgn.stop_dt_tm) = (23)::double precision) AND (date_part('minute'::text, asgn.stop_dt_tm) = (59)::double precision) AND (date_part('second'::text, asgn.stop_dt_tm) = (59)::double precision)) THEN ('00:00:01'::interval + asgn.stop_dt_tm)
            ELSE asgn.stop_dt_tm
        END AS adj_stop_dt_tm
   FROM (remis.inv_assig asgn
     JOIN ( SELECT DISTINCT asset_type.equip_desig_id
           FROM remis.asset_type
          WHERE ((asset_type.type_equip_id = ANY (ARRAY['A'::bpchar, 'M'::bpchar])) AND (to_char(asset_type.stop_dt_tm, 'YYYY-MM-DD'::text) = '2046-12-31'::text))) atyp ON ((asgn.equip_desig_id = atyp.equip_desig_id)));


ALTER TABLE timeline.acft_inv_assig_av OWNER TO creator_role;

--
-- Name: acft_inv_possess_av; Type: VIEW; Schema: timeline; Owner: creator_role
--

CREATE VIEW timeline.acft_inv_possess_av AS
 SELECT invp.start_dt_tm,
    invp.arbitrary_id,
    invp.equip_desig_id,
    invp.cmd_cd,
    invp.sn_id,
    invp.geo_loc_id,
    invp.stop_dt_tm,
    invp.org_nbr_id,
    invp.org_kind_tx,
    invp.unit_id,
    invp.org_type_tx,
    invp.purp_cd,
    invp.loan_cd,
    invp.gain_type_actn_cd,
    invp.loss_type_actn_cd,
    invp.termination_type_actn_cd,
    invp.type_op_tm,
    invp.curr_op_tm,
    invp.srd_id,
    invp.gain_proc_dt_tm,
    invp.loss_proc_dt_tm,
    invp.data_proc_ctr_nbr_id,
    invp.temp_transfer_in,
    invp.equip_id,
    invp.history_in,
    invp.orig_work_ctr_cd,
    invp.work_ctr_cd,
    invp.gang_nbr_id,
    invp.gain_user_name_tx,
    invp.loss_user_name_tx,
    invp.termination_user_name_tx,
    invp.lm_dt_tm,
    invp.remis_dt_tm,
    invp.remis_rba,
    invp.start_dt,
    invp.stop_dt
   FROM (remis.inv_possess invp
     JOIN ( SELECT DISTINCT asset_type.equip_desig_id
           FROM remis.asset_type
          WHERE ((asset_type.type_equip_id = ANY (ARRAY['A'::bpchar, 'M'::bpchar])) AND (to_char(asset_type.stop_dt_tm, 'YYYY-MM-DD'::text) = '2046-12-31'::text))) atyp ON ((invp.equip_desig_id = atyp.equip_desig_id)))
  WHERE ((invp.start_dt_tm IS NOT NULL) AND (invp.arbitrary_id IS NOT NULL));


ALTER TABLE timeline.acft_inv_possess_av OWNER TO creator_role;

--
-- Name: acft_possessed_stat_av; Type: VIEW; Schema: timeline; Owner: creator_role
--

CREATE VIEW timeline.acft_possessed_stat_av AS
 SELECT invp.sn_id,
    invp.equip_desig_id,
    stat.start_dt_tm,
    stat.arbitrary_id,
    stat.stat_cd,
    stat.loc_id,
    stat.stat_type,
    stat.yr_id,
    stat.mo_id,
    stat.wuc_cd,
    stat.as_of_dt_tm,
    stat.stop_dt_tm,
    stat.hrs_am,
    stat.job_ctrl_nbr_id,
    stat.work_ctr_event_id,
    stat.orig_cmd_cd,
    stat.orig_geo_loc_id,
    stat.unit_id,
    stat.lru_capability_nbr_in,
    stat.stop_yr_mo,
    stat.start_yr_mo,
    stat.lm_dt_tm,
    stat.remis_dt_tm,
    stat.remis_rba,
    stat.end_itm_capability_nbr_id,
    stat.override_stat_in,
    stat.start_dt,
    stat.stop_dt,
    NULL::text AS ingest_date,
        CASE
            WHEN ((date_part('hour'::text, stat.stop_dt_tm) = (23)::double precision) AND (date_part('minute'::text, stat.stop_dt_tm) = (59)::double precision) AND (date_part('second'::text, stat.stop_dt_tm) = (0)::double precision) AND (lead(stat.start_dt_tm) OVER (PARTITION BY invp.equip_desig_id, invp.sn_id ORDER BY stat.start_dt_tm) <> stat.stop_dt_tm)) THEN ('00:01:00'::interval + stat.stop_dt_tm)
            ELSE stat.stop_dt_tm
        END AS adj_stop_dt_tm
   FROM ((remis.stat stat
     JOIN remis.inv_possess invp ON ((stat.arbitrary_id = invp.arbitrary_id)))
     JOIN ( SELECT DISTINCT asset_type.equip_desig_id
           FROM remis.asset_type
          WHERE ((asset_type.type_equip_id = ANY (ARRAY['A'::bpchar, 'M'::bpchar])) AND (to_char(asset_type.stop_dt_tm, 'YYYY-MM-DD'::text) = '2046-12-31'::text))) atyp ON ((invp.equip_desig_id = atyp.equip_desig_id)));


ALTER TABLE timeline.acft_possessed_stat_av OWNER TO creator_role;

--
-- Name: acft_possessed_util_av; Type: VIEW; Schema: timeline; Owner: creator_role
--

CREATE VIEW timeline.acft_possessed_util_av AS
 SELECT invp.sn_id,
    invp.equip_desig_id,
    util.start_dt_tm,
    util.rpt_mo_ind_yr_tm,
    util.rpt_mo_ind_mo_tm,
    util.mod_rmi_yr_tm,
    util.mod_rmi_mo_tm,
    util.prog_element_cd,
    util.util_purp_cd,
    util.type_util_cd,
    util.due_in_dt,
    util.yr_id,
    util.initial_start_dt_tm,
    util.mo_id,
    util.initial_stop_dt_tm,
    util.initial_due_in_dt,
    util.stop_dt_tm,
    util.hrs_am,
    util.sorties_am,
    util.landings_am,
    util.arbitrary_id,
    util.full_stop_landings_am,
    util.stress_factor_cd,
    util.base_trx_dt,
    util.sortie_dt,
    util.sortie_nbr_id,
    util.sortie_mod,
    util.mission_nmbr_cd,
    util.takeoff_icao_loc_id,
    util.landing_icao_loc_id,
    util.stop_yr_mo,
    util.start_yr_mo,
    util.lm_dt_tm,
    util.remis_dt_tm,
    util.remis_rba,
    util.proc_dt_tm,
    util.del_proc_dt_tm,
    util.ins_rpt_ind_yr_mo_id,
    util.del_rpt_ind_yr_mo_id,
    util.initial_takeoff_dt_tm,
    util.final_takeoff_dt_tm,
    util.final_landing_dt_tm,
    NULL::text AS ingest_date,
        CASE
            WHEN ((date_part('hour'::text, util.stop_dt_tm) = (23)::double precision) AND (date_part('minute'::text, util.stop_dt_tm) = (59)::double precision) AND (date_part('second'::text, util.stop_dt_tm) = (0)::double precision) AND (lead(util.start_dt_tm) OVER (PARTITION BY invp.equip_desig_id, invp.sn_id ORDER BY util.start_dt_tm) <> util.stop_dt_tm)) THEN ('00:01:00'::interval + util.stop_dt_tm)
            ELSE util.stop_dt_tm
        END AS adj_stop_dt_tm
   FROM ((remis.util util
     JOIN remis.inv_possess invp ON ((util.arbitrary_id = invp.arbitrary_id)))
     JOIN ( SELECT DISTINCT asset_type.equip_desig_id
           FROM remis.asset_type
          WHERE ((asset_type.type_equip_id = ANY (ARRAY['A'::bpchar, 'M'::bpchar])) AND (to_char(asset_type.stop_dt_tm, 'YYYY-MM-DD'::text) = '2046-12-31'::text))) atyp ON ((invp.equip_desig_id = atyp.equip_desig_id)));


ALTER TABLE timeline.acft_possessed_util_av OWNER TO creator_role;

--
-- Name: adj_inv_assig_av; Type: VIEW; Schema: timeline; Owner: creator_role
--

CREATE VIEW timeline.adj_inv_assig_av AS
 SELECT inv_assig.alc_cd,
    inv_assig.equip_desig_id,
    inv_assig.sn_id,
    inv_assig.start_dt_tm,
    inv_assig.cmd_cd,
    inv_assig.purp_cd,
    inv_assig.geo_loc_id,
    inv_assig.stop_dt_tm,
    inv_assig.org_nbr_id,
    inv_assig.org_kind_tx,
    inv_assig.assig_proj_tx,
    inv_assig.org_type_tx,
    inv_assig.prog_element_cd,
    inv_assig.assig_directive_tx,
    inv_assig.assig_dt,
    inv_assig.start_user_name_tx,
    inv_assig.stop_user_name_tx,
    inv_assig.lm_dt_tm,
    inv_assig.remis_dt_tm,
    inv_assig.remis_rba,
    inv_assig.fund_cd,
    inv_assig.appropriation_cd,
    inv_assig.budget_cd,
    inv_assig.sales_cd,
    inv_assig.type_of_acquisition,
    inv_assig.doc_id_cd,
    inv_assig.remarks,
    inv_assig.contract_nbr_po_other_id,
    inv_assig.inv_recv_rpt_nbr,
    inv_assig.acq_frm_cmd_cd,
    inv_assig.accumulated_depreciation,
    inv_assig.fnl_termn_typ_actn_cd,
    inv_assig.termn_dt_tm,
        CASE
            WHEN ((date_part('hour'::text, inv_assig.stop_dt_tm) = (23)::double precision) AND (date_part('minute'::text, inv_assig.stop_dt_tm) = (59)::double precision) AND (date_part('second'::text, inv_assig.stop_dt_tm) = (59)::double precision)) THEN ('00:00:01'::interval + inv_assig.stop_dt_tm)
            ELSE inv_assig.stop_dt_tm
        END AS adj_stop_dt_tm
   FROM remis.inv_assig;


ALTER TABLE timeline.adj_inv_assig_av OWNER TO creator_role;

--
-- Name: adj_stat_av; Type: VIEW; Schema: timeline; Owner: creator_role
--

CREATE VIEW timeline.adj_stat_av AS
 SELECT acft_possessed_stat_av.sn_id,
    acft_possessed_stat_av.equip_desig_id,
    acft_possessed_stat_av.start_dt_tm,
    acft_possessed_stat_av.arbitrary_id,
    acft_possessed_stat_av.stat_cd,
    acft_possessed_stat_av.loc_id,
    acft_possessed_stat_av.stat_type,
    acft_possessed_stat_av.yr_id,
    acft_possessed_stat_av.mo_id,
    acft_possessed_stat_av.wuc_cd,
    acft_possessed_stat_av.as_of_dt_tm,
    acft_possessed_stat_av.stop_dt_tm,
    acft_possessed_stat_av.hrs_am,
    acft_possessed_stat_av.job_ctrl_nbr_id,
    acft_possessed_stat_av.work_ctr_event_id,
    acft_possessed_stat_av.orig_cmd_cd,
    acft_possessed_stat_av.orig_geo_loc_id,
    acft_possessed_stat_av.unit_id,
    acft_possessed_stat_av.lru_capability_nbr_in,
    acft_possessed_stat_av.stop_yr_mo,
    acft_possessed_stat_av.start_yr_mo,
    acft_possessed_stat_av.lm_dt_tm,
    acft_possessed_stat_av.remis_dt_tm,
    acft_possessed_stat_av.remis_rba,
    acft_possessed_stat_av.end_itm_capability_nbr_id,
    acft_possessed_stat_av.override_stat_in,
    acft_possessed_stat_av.start_dt,
    acft_possessed_stat_av.stop_dt,
    NULL::text AS ingest_date,
        CASE
            WHEN ((date_part('hour'::text, acft_possessed_stat_av.stop_dt_tm) = (23)::double precision) AND (date_part('minute'::text, acft_possessed_stat_av.stop_dt_tm) = (59)::double precision) AND (date_part('second'::text, acft_possessed_stat_av.stop_dt_tm) = (0)::double precision) AND (lead(acft_possessed_stat_av.start_dt_tm) OVER (PARTITION BY acft_possessed_stat_av.equip_desig_id, acft_possessed_stat_av.sn_id ORDER BY acft_possessed_stat_av.start_dt_tm) <> acft_possessed_stat_av.stop_dt_tm)) THEN ('00:01:00'::interval + acft_possessed_stat_av.stop_dt_tm)
            ELSE acft_possessed_stat_av.stop_dt_tm
        END AS adj_stop_dt_tm
   FROM timeline.acft_possessed_stat_av;


ALTER TABLE timeline.adj_stat_av OWNER TO creator_role;

--
-- Name: adj_util_av; Type: VIEW; Schema: timeline; Owner: creator_role
--

CREATE VIEW timeline.adj_util_av AS
 SELECT acft_possessed_util_av.sn_id,
    acft_possessed_util_av.equip_desig_id,
    acft_possessed_util_av.start_dt_tm,
    acft_possessed_util_av.rpt_mo_ind_yr_tm,
    acft_possessed_util_av.rpt_mo_ind_mo_tm,
    acft_possessed_util_av.mod_rmi_yr_tm,
    acft_possessed_util_av.mod_rmi_mo_tm,
    acft_possessed_util_av.prog_element_cd,
    acft_possessed_util_av.util_purp_cd,
    acft_possessed_util_av.type_util_cd,
    acft_possessed_util_av.due_in_dt,
    acft_possessed_util_av.yr_id,
    acft_possessed_util_av.initial_start_dt_tm,
    acft_possessed_util_av.mo_id,
    acft_possessed_util_av.initial_stop_dt_tm,
    acft_possessed_util_av.initial_due_in_dt,
    acft_possessed_util_av.stop_dt_tm,
    acft_possessed_util_av.hrs_am,
    acft_possessed_util_av.sorties_am,
    acft_possessed_util_av.landings_am,
    acft_possessed_util_av.arbitrary_id,
    acft_possessed_util_av.full_stop_landings_am,
    acft_possessed_util_av.stress_factor_cd,
    acft_possessed_util_av.base_trx_dt,
    acft_possessed_util_av.sortie_dt,
    acft_possessed_util_av.sortie_nbr_id,
    acft_possessed_util_av.sortie_mod,
    acft_possessed_util_av.mission_nmbr_cd,
    acft_possessed_util_av.takeoff_icao_loc_id,
    acft_possessed_util_av.landing_icao_loc_id,
    acft_possessed_util_av.stop_yr_mo,
    acft_possessed_util_av.start_yr_mo,
    acft_possessed_util_av.lm_dt_tm,
    acft_possessed_util_av.remis_dt_tm,
    acft_possessed_util_av.remis_rba,
    acft_possessed_util_av.proc_dt_tm,
    acft_possessed_util_av.del_proc_dt_tm,
    acft_possessed_util_av.ins_rpt_ind_yr_mo_id,
    acft_possessed_util_av.del_rpt_ind_yr_mo_id,
    acft_possessed_util_av.initial_takeoff_dt_tm,
    acft_possessed_util_av.final_takeoff_dt_tm,
    acft_possessed_util_av.final_landing_dt_tm,
    acft_possessed_util_av.ingest_date,
        CASE
            WHEN ((date_part('hour'::text, acft_possessed_util_av.stop_dt_tm) = (23)::double precision) AND (date_part('minute'::text, acft_possessed_util_av.stop_dt_tm) = (59)::double precision) AND (date_part('second'::text, acft_possessed_util_av.stop_dt_tm) = (0)::double precision) AND (lead(acft_possessed_util_av.start_dt_tm) OVER (PARTITION BY acft_possessed_util_av.equip_desig_id, acft_possessed_util_av.sn_id ORDER BY acft_possessed_util_av.start_dt_tm) <> acft_possessed_util_av.stop_dt_tm)) THEN ('00:01:00'::interval + acft_possessed_util_av.stop_dt_tm)
            ELSE acft_possessed_util_av.stop_dt_tm
        END AS adj_stop_dt_tm
   FROM timeline.acft_possessed_util_av;


ALTER TABLE timeline.adj_util_av OWNER TO creator_role;

--
-- Name: asgn_timeline_stat; Type: TABLE; Schema: timeline; Owner: creator_role
--

CREATE TABLE timeline.asgn_timeline_stat (
    event_equip_desig_id character(15),
    event_sn_id character(15),
    event_start_dt_tm timestamp without time zone,
    event_stop_dt_tm timestamp without time zone,
    event_delta_seconds double precision,
    asgn_start_dt_tm timestamp(6) without time zone,
    asgn_stop_dt_tm timestamp(6) without time zone,
    asgn_adj_stop_dt_tm timestamp without time zone,
    asgn_equip_desig_id character(15),
    asgn_sn_id character(15),
    asgn_alc_cd character(2),
    asgn_cmd_cd character(3),
    asgn_purp_cd character(2),
    asgn_geo_loc_id character(4),
    asgn_org_nbr_id integer,
    asgn_org_kind_tx character(3),
    asgn_assig_proj_tx character(8),
    asgn_org_type_tx character(2),
    asgn_prog_element_cd character(10),
    asgn_assig_directive_tx character(6),
    asgn_assig_dt timestamp(6) without time zone,
    asgn_start_user_name_tx character(96),
    asgn_stop_user_name_tx character(96),
    asgn_lm_dt_tm timestamp(6) without time zone,
    asgn_remis_dt_tm timestamp(6) without time zone,
    asgn_remis_rba integer,
    asgn_fund_cd character(2),
    asgn_appropriation_cd character(14),
    asgn_budget_cd character(1),
    asgn_sales_cd character(3),
    asgn_type_of_acquisition character(30),
    asgn_doc_id_cd character(3),
    asgn_remarks character(80),
    asgn_contract_nbr_po_other_id character(50),
    asgn_inv_recv_rpt_nbr character(50),
    asgn_acq_frm_cmd_cd character(3),
    asgn_accumulated_depreciation numeric(12,2),
    asgn_fnl_termn_typ_actn_cd character(1),
    asgn_termn_dt_tm timestamp(6) without time zone
);


ALTER TABLE timeline.asgn_timeline_stat OWNER TO creator_role;

--
-- Name: asgn_timeline_util; Type: TABLE; Schema: timeline; Owner: creator_role
--

CREATE TABLE timeline.asgn_timeline_util (
    event_equip_desig_id character(15),
    event_sn_id character(15),
    event_start_dt_tm timestamp without time zone,
    event_stop_dt_tm timestamp without time zone,
    event_delta_seconds double precision,
    asgn_start_dt_tm timestamp(6) without time zone,
    asgn_stop_dt_tm timestamp(6) without time zone,
    asgn_adj_stop_dt_tm timestamp without time zone,
    asgn_equip_desig_id character(15),
    asgn_sn_id character(15),
    asgn_alc_cd character(2),
    asgn_cmd_cd character(3),
    asgn_purp_cd character(2),
    asgn_geo_loc_id character(4),
    asgn_org_nbr_id integer,
    asgn_org_kind_tx character(3),
    asgn_assig_proj_tx character(8),
    asgn_org_type_tx character(2),
    asgn_prog_element_cd character(10),
    asgn_assig_directive_tx character(6),
    asgn_assig_dt timestamp(6) without time zone,
    asgn_start_user_name_tx character(96),
    asgn_stop_user_name_tx character(96),
    asgn_lm_dt_tm timestamp(6) without time zone,
    asgn_remis_dt_tm timestamp(6) without time zone,
    asgn_remis_rba integer,
    asgn_fund_cd character(2),
    asgn_appropriation_cd character(14),
    asgn_budget_cd character(1),
    asgn_sales_cd character(3),
    asgn_type_of_acquisition character(30),
    asgn_doc_id_cd character(3),
    asgn_remarks character(80),
    asgn_contract_nbr_po_other_id character(50),
    asgn_inv_recv_rpt_nbr character(50),
    asgn_acq_frm_cmd_cd character(3),
    asgn_accumulated_depreciation numeric(12,2),
    asgn_fnl_termn_typ_actn_cd character(1),
    asgn_termn_dt_tm timestamp(6) without time zone
);


ALTER TABLE timeline.asgn_timeline_util OWNER TO creator_role;

--
-- Name: dmv_ap_cal_ref; Type: TABLE; Schema: timeline; Owner: creator_role
--

CREATE TABLE timeline.dmv_ap_cal_ref (
    calendar_dt timestamp(6) without time zone,
    day_of_wk_nr smallint,
    day_of_mo_nr smallint,
    alpha_day_of_mo_nr character varying(50),
    day_of_yr_nr smallint,
    day_of_qtr_nr smallint,
    wkday_of_month_nr smallint,
    wkday_from_mnth_end_nr smallint,
    wk_of_mo_nr smallint,
    wk_of_yr_nr smallint,
    mo_of_qtr_nr smallint,
    mo_nr smallint,
    alpha_mo_nr character varying(50),
    qtr_nr smallint,
    yr_nr smallint,
    alpha_yr_nr character varying(50),
    qtr_nm character varying(6),
    mo_nm character varying(9),
    wkday_nm character varying(9),
    wk_of_mo_nm character varying(14),
    wk_from_mo_end_nm character varying(14),
    wk_from_mo_end_nr smallint,
    day_start_dt_tm timestamp(6) without time zone,
    day_end_dt_tm timestamp(6) without time zone,
    mo_start_dt_tm timestamp(6) without time zone,
    mo_start_dt timestamp(6) without time zone,
    mo_end_dt_tm timestamp(6) without time zone,
    mo_end_dt timestamp(6) without time zone,
    mo_end_in character varying(2),
    leap_yr_in character varying(2),
    high_remis_dt_tm timestamp(6) without time zone,
    low_remis_dt_tm timestamp(6) without time zone,
    yr_mo_nr character varying(50),
    fscl_yr_nr smallint,
    fscl_qtr_nr smallint,
    fscl_mo_nr smallint,
    fscl_yr_mo_nr character varying(50),
    fscl_day_of_yr_nr smallint,
    fscl_yr_nm character varying(12),
    fscl_qtr_nm character varying(6),
    fscl_mo_nm character varying(8),
    fscl_yr_mo_nm character varying(20),
    fscl_yr_strt_dt timestamp(6) without time zone,
    fscl_yr_end_dt timestamp(6) without time zone,
    fscl_qtr_strt_dt timestamp(6) without time zone,
    fscl_qtr_end_dt timestamp(6) without time zone,
    last_modification_time timestamp(6) without time zone,
    julian_dt character varying(50),
    alpha_day_of_yr_nr character varying(50),
    gov_hol_in character varying(2),
    prev_16_fscl_qtr_dt timestamp(6) without time zone
);


ALTER TABLE timeline.dmv_ap_cal_ref OWNER TO creator_role;

--
-- Name: f16blocks; Type: TABLE; Schema: timeline; Owner: creator_role
--

CREATE TABLE timeline.f16blocks (
    mission_design_series text,
    serial_number text,
    block_number text,
    termination_date timestamp(6) without time zone,
    current_operating_time numeric(10,0)
);


ALTER TABLE timeline.f16blocks OWNER TO creator_role;

--
-- Name: geoloc_reduced; Type: TABLE; Schema: timeline; Owner: creator_role
--

CREATE TABLE timeline.geoloc_reduced (
    index bigint,
    "geo_loc_ID" text,
    "loc_NM" text
);


ALTER TABLE timeline.geoloc_reduced OWNER TO creator_role;

--
-- Name: initial_timeline_stat; Type: TABLE; Schema: timeline; Owner: creator_role
--

CREATE TABLE timeline.initial_timeline_stat (
    event_equip_desig_id character(15),
    event_sn_id character(15),
    event_start_dt_tm timestamp without time zone,
    event_stop_dt_tm timestamp without time zone,
    event_delta_seconds double precision
);


ALTER TABLE timeline.initial_timeline_stat OWNER TO creator_role;

--
-- Name: initial_timeline_util; Type: TABLE; Schema: timeline; Owner: creator_role
--

CREATE TABLE timeline.initial_timeline_util (
    event_equip_desig_id character(15),
    event_sn_id character(15),
    event_start_dt_tm timestamp without time zone,
    event_stop_dt_tm timestamp without time zone,
    event_delta_seconds double precision
);


ALTER TABLE timeline.initial_timeline_util OWNER TO creator_role;

--
-- Name: mx_actn_heatmap; Type: TABLE; Schema: timeline; Owner: creator_role
--

CREATE TABLE timeline.mx_actn_heatmap (
    actn_taken_cd character(1),
    maint_actn_nbr_id numeric(10,0),
    labor_manhrs_am numeric(6,1),
    how_mal_cd integer,
    crew_size_am integer,
    category_of_labor_id integer,
    work_ctr_cd character(5),
    when_dscvrd_cd character(1),
    type_maint_cd character(1),
    mx_start_dt_tm timestamp(6) without time zone,
    mx_wuc_cd character(15),
    perf_geo_loc_id character(4),
    mx_stop_dt_tm timestamp(6) without time zone,
    mx_cmd_cd bpchar,
    mx_mds text,
    mx_geo_loc_id bpchar,
    job_ctrl_nbr_id bpchar,
    mx_sn_id text,
    tcto_data_cd bpchar,
    htmp_sn_id text,
    htmp_start_tm timestamp(6) without time zone,
    htmp_stop_tm timestamp(6) without time zone,
    delta_t double precision,
    cat_ppc text,
    status text,
    tai text,
    possessed text,
    apc text,
    poss_cmdcd text,
    assig_cmdcd text,
    assig_geoloc text,
    poss_geoloc text,
    stat_wuc text,
    af_speciality_cd character(5)
);


ALTER TABLE timeline.mx_actn_heatmap OWNER TO creator_role;

--
-- Name: newheatmap_test1; Type: TABLE; Schema: timeline; Owner: creator_role
--

CREATE TABLE timeline.newheatmap_test1 (
    index bigint,
    sn_id text,
    mds text,
    mds_flg text,
    start_tm text,
    stop_tm text,
    delta_t double precision,
    cat_ppc text,
    status text,
    tai text,
    possessed text,
    apc text,
    alc_cd text,
    poss_cmdcd text,
    assig_cmdcd text,
    poss_orgnum double precision,
    poss_orgkind text,
    poss_orgtype text,
    assig_orgnum double precision,
    assig_orgkind text,
    assig_orgtype text,
    arbitrary_id text,
    assig_geoloc text,
    poss_geoloc text,
    stat_wuc text
);


ALTER TABLE timeline.newheatmap_test1 OWNER TO creator_role;

--
-- Name: odbc_conn; Type: TABLE; Schema: timeline; Owner: creator_role
--

CREATE TABLE timeline.odbc_conn (
    id integer,
    odbc_column character varying(15)
);


ALTER TABLE timeline.odbc_conn OWNER TO creator_role;

--
-- Name: old_HEATMAP; Type: TABLE; Schema: timeline; Owner: creator_role
--

CREATE TABLE timeline."old_HEATMAP" (
    index bigint,
    sn_id text,
    mds text,
    mds_flg text,
    start_tm text,
    stop_tm text,
    delta_t double precision,
    cat_ppc text,
    status text,
    tai text,
    possessed text,
    apc text,
    alc_cd text,
    poss_cmdcd text,
    assig_cmdcd text,
    poss_orgnum double precision,
    poss_orgkind text,
    poss_orgtype text,
    assig_orgnum double precision,
    assig_orgkind text,
    assig_orgtype text,
    arbitrary_id text,
    assig_geoloc text,
    poss_geoloc text,
    stat_wuc text
);


ALTER TABLE timeline."old_HEATMAP" OWNER TO creator_role;

--
-- Name: old_asgn_timeline_stat; Type: TABLE; Schema: timeline; Owner: creator_role
--

CREATE TABLE timeline.old_asgn_timeline_stat (
    event_equip_desig_id character(15),
    event_sn_id character(15),
    event_start_dt_tm timestamp without time zone,
    event_stop_dt_tm timestamp without time zone,
    event_delta_seconds double precision,
    asgn_start_dt_tm timestamp(6) without time zone,
    asgn_stop_dt_tm timestamp(6) without time zone,
    asgn_adj_stop_dt_tm timestamp without time zone,
    asgn_equip_desig_id character(15),
    asgn_sn_id character(15),
    asgn_alc_cd character(2),
    asgn_cmd_cd character(3),
    asgn_purp_cd character(2),
    asgn_geo_loc_id character(4),
    asgn_org_nbr_id integer,
    asgn_org_kind_tx character(3),
    asgn_assig_proj_tx character(8),
    asgn_org_type_tx character(2),
    asgn_prog_element_cd character(10),
    asgn_assig_directive_tx character(6),
    asgn_assig_dt timestamp(6) without time zone,
    asgn_start_user_name_tx character(96),
    asgn_stop_user_name_tx character(96),
    asgn_lm_dt_tm timestamp(6) without time zone,
    asgn_remis_dt_tm timestamp(6) without time zone,
    asgn_remis_rba integer,
    asgn_fund_cd character(2),
    asgn_appropriation_cd character(14),
    asgn_budget_cd character(1),
    asgn_sales_cd character(3),
    asgn_type_of_acquisition character(30),
    asgn_doc_id_cd character(3),
    asgn_remarks character(80),
    asgn_contract_nbr_po_other_id character(50),
    asgn_inv_recv_rpt_nbr character(50),
    asgn_acq_frm_cmd_cd character(3),
    asgn_accumulated_depreciation numeric(12,2),
    asgn_fnl_termn_typ_actn_cd character(1),
    asgn_termn_dt_tm timestamp(6) without time zone
);


ALTER TABLE timeline.old_asgn_timeline_stat OWNER TO creator_role;

--
-- Name: old_asgn_timeline_util; Type: TABLE; Schema: timeline; Owner: creator_role
--

CREATE TABLE timeline.old_asgn_timeline_util (
    event_equip_desig_id character(15),
    event_sn_id character(15),
    event_start_dt_tm timestamp without time zone,
    event_stop_dt_tm timestamp without time zone,
    event_delta_seconds double precision,
    asgn_start_dt_tm timestamp(6) without time zone,
    asgn_stop_dt_tm timestamp(6) without time zone,
    asgn_adj_stop_dt_tm timestamp without time zone,
    asgn_equip_desig_id character(15),
    asgn_sn_id character(15),
    asgn_alc_cd character(2),
    asgn_cmd_cd character(3),
    asgn_purp_cd character(2),
    asgn_geo_loc_id character(4),
    asgn_org_nbr_id integer,
    asgn_org_kind_tx character(3),
    asgn_assig_proj_tx character(8),
    asgn_org_type_tx character(2),
    asgn_prog_element_cd character(10),
    asgn_assig_directive_tx character(6),
    asgn_assig_dt timestamp(6) without time zone,
    asgn_start_user_name_tx character(96),
    asgn_stop_user_name_tx character(96),
    asgn_lm_dt_tm timestamp(6) without time zone,
    asgn_remis_dt_tm timestamp(6) without time zone,
    asgn_remis_rba integer,
    asgn_fund_cd character(2),
    asgn_appropriation_cd character(14),
    asgn_budget_cd character(1),
    asgn_sales_cd character(3),
    asgn_type_of_acquisition character(30),
    asgn_doc_id_cd character(3),
    asgn_remarks character(80),
    asgn_contract_nbr_po_other_id character(50),
    asgn_inv_recv_rpt_nbr character(50),
    asgn_acq_frm_cmd_cd character(3),
    asgn_accumulated_depreciation numeric(12,2),
    asgn_fnl_termn_typ_actn_cd character(1),
    asgn_termn_dt_tm timestamp(6) without time zone
);


ALTER TABLE timeline.old_asgn_timeline_util OWNER TO creator_role;

--
-- Name: old_f16blocks; Type: TABLE; Schema: timeline; Owner: creator_role
--

CREATE TABLE timeline.old_f16blocks (
    index bigint,
    sn text,
    block text,
    model text,
    mds text
);


ALTER TABLE timeline.old_f16blocks OWNER TO creator_role;

--
-- Name: old_initial_timeline_stat; Type: TABLE; Schema: timeline; Owner: creator_role
--

CREATE TABLE timeline.old_initial_timeline_stat (
    event_equip_desig_id character(15),
    event_sn_id character(15),
    event_start_dt_tm timestamp without time zone,
    event_stop_dt_tm timestamp without time zone,
    event_delta_seconds double precision
);


ALTER TABLE timeline.old_initial_timeline_stat OWNER TO creator_role;

--
-- Name: old_initial_timeline_util; Type: TABLE; Schema: timeline; Owner: creator_role
--

CREATE TABLE timeline.old_initial_timeline_util (
    event_equip_desig_id character(15),
    event_sn_id character(15),
    event_start_dt_tm timestamp without time zone,
    event_stop_dt_tm timestamp without time zone,
    event_delta_seconds double precision
);


ALTER TABLE timeline.old_initial_timeline_util OWNER TO creator_role;

--
-- Name: old_mx_actn_heatmap; Type: TABLE; Schema: timeline; Owner: postgres
--

CREATE TABLE timeline.old_mx_actn_heatmap (
    actn_taken_cd character(1),
    maint_actn_nbr_id numeric(10,0),
    labor_manhrs_am numeric(6,1),
    how_mal_cd integer,
    crew_size_am integer,
    category_of_labor_id integer,
    work_ctr_cd character(5),
    when_dscvrd_cd character(1),
    type_maint_cd character(1),
    mx_start_dt_tm timestamp(6) without time zone,
    mx_wuc_cd character(15),
    perf_geo_loc_id character(4),
    mx_stop_dt_tm timestamp(6) without time zone,
    mx_cmd_cd bpchar,
    mx_mds text,
    mx_geo_loc_id bpchar,
    job_ctrl_nbr_id bpchar,
    mx_sn_id text,
    tcto_data_cd bpchar,
    htmp_sn_id text,
    htmp_start_tm timestamp(6) without time zone,
    htmp_stop_tm timestamp(6) without time zone,
    delta_t double precision,
    cat_ppc text,
    status text,
    tai text,
    possessed text,
    apc text,
    poss_cmdcd text,
    assig_cmdcd text,
    assig_geoloc text,
    poss_geoloc text,
    stat_wuc text
);


ALTER TABLE timeline.old_mx_actn_heatmap OWNER TO postgres;

--
-- Name: old_poss_timeline_stat; Type: TABLE; Schema: timeline; Owner: creator_role
--

CREATE TABLE timeline.old_poss_timeline_stat (
    event_equip_desig_id character(15),
    event_sn_id character(15),
    event_start_dt_tm timestamp without time zone,
    event_stop_dt_tm timestamp without time zone,
    event_delta_seconds double precision,
    poss_start_dt_tm timestamp(6) without time zone,
    poss_stop_dt_tm timestamp(6) without time zone,
    poss_equip_desig_id character(15),
    poss_sn_id character(15),
    poss_arbitrary_id numeric(10,0),
    poss_cmd_cd character(3),
    poss_geo_loc_id character(4),
    poss_org_nbr_id integer,
    poss_org_kind_tx character(3),
    poss_unit_id character(9),
    poss_org_type_tx character(2),
    poss_purp_cd character(2),
    poss_loan_cd character(1),
    poss_gain_type_actn_cd character(1),
    poss_loss_type_actn_cd character(1),
    poss_termination_type_actn_cd character(1),
    poss_type_op_tm character(1),
    poss_curr_op_tm numeric(7,1),
    poss_srd_id character(3),
    poss_gain_proc_dt_tm timestamp(6) without time zone,
    poss_loss_proc_dt_tm timestamp(6) without time zone,
    poss_data_proc_ctr_nbr_id integer,
    poss_temp_transfer_in character(1),
    poss_equip_id character(5),
    poss_history_in character(1),
    poss_orig_work_ctr_cd character(5),
    poss_work_ctr_cd character(5),
    poss_gang_nbr_id numeric(1,0),
    poss_gain_user_name_tx character(96),
    poss_loss_user_name_tx character(96),
    poss_termination_user_name_tx character(96),
    poss_lm_dt_tm timestamp(6) without time zone,
    poss_remis_dt_tm timestamp(6) without time zone,
    poss_remis_rba integer,
    poss_start_dt date,
    poss_stop_dt date
);


ALTER TABLE timeline.old_poss_timeline_stat OWNER TO creator_role;

--
-- Name: old_poss_timeline_util; Type: TABLE; Schema: timeline; Owner: creator_role
--

CREATE TABLE timeline.old_poss_timeline_util (
    event_equip_desig_id character(15),
    event_sn_id character(15),
    event_start_dt_tm timestamp without time zone,
    event_stop_dt_tm timestamp without time zone,
    event_delta_seconds double precision,
    poss_start_dt_tm timestamp(6) without time zone,
    poss_stop_dt_tm timestamp(6) without time zone,
    poss_equip_desig_id character(15),
    poss_sn_id character(15),
    poss_arbitrary_id numeric(10,0),
    poss_cmd_cd character(3),
    poss_geo_loc_id character(4),
    poss_org_nbr_id integer,
    poss_org_kind_tx character(3),
    poss_unit_id character(9),
    poss_org_type_tx character(2),
    poss_purp_cd character(2),
    poss_loan_cd character(1),
    poss_gain_type_actn_cd character(1),
    poss_loss_type_actn_cd character(1),
    poss_termination_type_actn_cd character(1),
    poss_type_op_tm character(1),
    poss_curr_op_tm numeric(7,1),
    poss_srd_id character(3),
    poss_gain_proc_dt_tm timestamp(6) without time zone,
    poss_loss_proc_dt_tm timestamp(6) without time zone,
    poss_data_proc_ctr_nbr_id integer,
    poss_temp_transfer_in character(1),
    poss_equip_id character(5),
    poss_history_in character(1),
    poss_orig_work_ctr_cd character(5),
    poss_work_ctr_cd character(5),
    poss_gang_nbr_id numeric(1,0),
    poss_gain_user_name_tx character(96),
    poss_loss_user_name_tx character(96),
    poss_termination_user_name_tx character(96),
    poss_lm_dt_tm timestamp(6) without time zone,
    poss_remis_dt_tm timestamp(6) without time zone,
    poss_remis_rba integer,
    poss_start_dt date,
    poss_stop_dt date
);


ALTER TABLE timeline.old_poss_timeline_util OWNER TO creator_role;

--
-- Name: old_stat_timeline_stat; Type: TABLE; Schema: timeline; Owner: creator_role
--

CREATE TABLE timeline.old_stat_timeline_stat (
    event_equip_desig_id character(15),
    event_sn_id character(15),
    event_start_dt_tm timestamp without time zone,
    event_stop_dt_tm timestamp without time zone,
    event_delta_seconds double precision,
    stat_start_dt_tm timestamp(6) without time zone,
    stat_stop_dt_tm timestamp(6) without time zone,
    stat_adj_stop_dt_tm timestamp without time zone,
    stat_sn_id character(15),
    stat_equip_desig_id character(15),
    stat_arbitrary_id numeric(10,0),
    stat_cd character(1),
    stat_loc_id character(15),
    stat_type character(1),
    stat_yr_id integer,
    stat_mo_id integer,
    stat_wuc_cd character(15),
    stat_as_of_dt_tm timestamp(6) without time zone,
    stat_hrs_am numeric(6,1),
    stat_job_ctrl_nbr_id character(9),
    stat_work_ctr_event_id integer,
    stat_orig_cmd_cd character(3),
    stat_orig_geo_loc_id character(4),
    stat_unit_id character(1),
    stat_lru_capability_nbr_in integer,
    stat_stop_yr_mo integer,
    stat_start_yr_mo integer,
    stat_lm_dt_tm timestamp(6) without time zone,
    stat_remis_dt_tm timestamp(6) without time zone,
    stat_remis_rba integer,
    stat_end_itm_capability_nbr_id integer,
    stat_override_stat_in character(1),
    stat_start_dt date,
    stat_stop_dt date,
    stat_ingest_date text
);


ALTER TABLE timeline.old_stat_timeline_stat OWNER TO creator_role;

--
-- Name: old_timeline_stat; Type: TABLE; Schema: timeline; Owner: creator_role
--

CREATE TABLE timeline.old_timeline_stat (
    event_equip_desig_id character(15),
    event_sn_id character(15),
    event_start_dt_tm timestamp without time zone,
    event_stop_dt_tm timestamp without time zone,
    event_delta_seconds double precision,
    asgn_start_dt_tm timestamp(6) without time zone,
    asgn_stop_dt_tm timestamp(6) without time zone,
    asgn_adj_stop_dt_tm timestamp without time zone,
    asgn_equip_desig_id character(15),
    asgn_sn_id character(15),
    asgn_alc_cd character(2),
    asgn_cmd_cd character(3),
    asgn_purp_cd character(2),
    asgn_geo_loc_id character(4),
    asgn_org_nbr_id integer,
    asgn_org_kind_tx character(3),
    asgn_assig_proj_tx character(8),
    asgn_org_type_tx character(2),
    asgn_prog_element_cd character(10),
    asgn_assig_directive_tx character(6),
    asgn_assig_dt timestamp(6) without time zone,
    asgn_start_user_name_tx character(96),
    asgn_stop_user_name_tx character(96),
    asgn_lm_dt_tm timestamp(6) without time zone,
    asgn_remis_dt_tm timestamp(6) without time zone,
    asgn_remis_rba integer,
    asgn_fund_cd character(2),
    asgn_appropriation_cd character(14),
    asgn_budget_cd character(1),
    asgn_sales_cd character(3),
    asgn_type_of_acquisition character(30),
    asgn_doc_id_cd character(3),
    asgn_remarks character(80),
    asgn_contract_nbr_po_other_id character(50),
    asgn_inv_recv_rpt_nbr character(50),
    asgn_acq_frm_cmd_cd character(3),
    asgn_accumulated_depreciation numeric(12,2),
    asgn_fnl_termn_typ_actn_cd character(1),
    asgn_termn_dt_tm timestamp(6) without time zone,
    poss_start_dt_tm timestamp(6) without time zone,
    poss_stop_dt_tm timestamp(6) without time zone,
    poss_equip_desig_id character(15),
    poss_sn_id character(15),
    poss_arbitrary_id numeric(10,0),
    poss_cmd_cd character(3),
    poss_geo_loc_id character(4),
    poss_org_nbr_id integer,
    poss_org_kind_tx character(3),
    poss_unit_id character(9),
    poss_org_type_tx character(2),
    poss_purp_cd character(2),
    poss_loan_cd character(1),
    poss_gain_type_actn_cd character(1),
    poss_loss_type_actn_cd character(1),
    poss_termination_type_actn_cd character(1),
    poss_type_op_tm character(1),
    poss_curr_op_tm numeric(7,1),
    poss_srd_id character(3),
    poss_gain_proc_dt_tm timestamp(6) without time zone,
    poss_loss_proc_dt_tm timestamp(6) without time zone,
    poss_data_proc_ctr_nbr_id integer,
    poss_temp_transfer_in character(1),
    poss_equip_id character(5),
    poss_history_in character(1),
    poss_orig_work_ctr_cd character(5),
    poss_work_ctr_cd character(5),
    poss_gang_nbr_id numeric(1,0),
    poss_gain_user_name_tx character(96),
    poss_loss_user_name_tx character(96),
    poss_termination_user_name_tx character(96),
    poss_lm_dt_tm timestamp(6) without time zone,
    poss_remis_dt_tm timestamp(6) without time zone,
    poss_remis_rba integer,
    poss_start_dt date,
    poss_stop_dt date,
    stat_start_dt_tm timestamp(6) without time zone,
    stat_stop_dt_tm timestamp(6) without time zone,
    stat_adj_stop_dt_tm timestamp without time zone,
    stat_sn_id character(15),
    stat_equip_desig_id character(15),
    stat_arbitrary_id numeric(10,0),
    stat_cd character(1),
    stat_loc_id character(15),
    stat_type character(1),
    stat_yr_id integer,
    stat_mo_id integer,
    stat_wuc_cd character(15),
    stat_as_of_dt_tm timestamp(6) without time zone,
    stat_hrs_am numeric(6,1),
    stat_job_ctrl_nbr_id character(9),
    stat_work_ctr_event_id integer,
    stat_orig_cmd_cd character(3),
    stat_orig_geo_loc_id character(4),
    stat_unit_id character(1),
    stat_lru_capability_nbr_in integer,
    stat_stop_yr_mo integer,
    stat_start_yr_mo integer,
    stat_lm_dt_tm timestamp(6) without time zone,
    stat_remis_dt_tm timestamp(6) without time zone,
    stat_remis_rba integer,
    stat_end_itm_capability_nbr_id integer,
    stat_override_stat_in character(1),
    stat_start_dt date,
    stat_stop_dt date,
    stat_ingest_date text
);


ALTER TABLE timeline.old_timeline_stat OWNER TO creator_role;

--
-- Name: old_timeline_util; Type: TABLE; Schema: timeline; Owner: creator_role
--

CREATE TABLE timeline.old_timeline_util (
    event_equip_desig_id character(15),
    event_sn_id character(15),
    event_start_dt_tm timestamp without time zone,
    event_stop_dt_tm timestamp without time zone,
    event_delta_seconds double precision,
    asgn_start_dt_tm timestamp(6) without time zone,
    asgn_stop_dt_tm timestamp(6) without time zone,
    asgn_adj_stop_dt_tm timestamp without time zone,
    asgn_equip_desig_id character(15),
    asgn_sn_id character(15),
    asgn_alc_cd character(2),
    asgn_cmd_cd character(3),
    asgn_purp_cd character(2),
    asgn_geo_loc_id character(4),
    asgn_org_nbr_id integer,
    asgn_org_kind_tx character(3),
    asgn_assig_proj_tx character(8),
    asgn_org_type_tx character(2),
    asgn_prog_element_cd character(10),
    asgn_assig_directive_tx character(6),
    asgn_assig_dt timestamp(6) without time zone,
    asgn_start_user_name_tx character(96),
    asgn_stop_user_name_tx character(96),
    asgn_lm_dt_tm timestamp(6) without time zone,
    asgn_remis_dt_tm timestamp(6) without time zone,
    asgn_remis_rba integer,
    asgn_fund_cd character(2),
    asgn_appropriation_cd character(14),
    asgn_budget_cd character(1),
    asgn_sales_cd character(3),
    asgn_type_of_acquisition character(30),
    asgn_doc_id_cd character(3),
    asgn_remarks character(80),
    asgn_contract_nbr_po_other_id character(50),
    asgn_inv_recv_rpt_nbr character(50),
    asgn_acq_frm_cmd_cd character(3),
    asgn_accumulated_depreciation numeric(12,2),
    asgn_fnl_termn_typ_actn_cd character(1),
    asgn_termn_dt_tm timestamp(6) without time zone,
    poss_start_dt_tm timestamp(6) without time zone,
    poss_stop_dt_tm timestamp(6) without time zone,
    poss_equip_desig_id character(15),
    poss_sn_id character(15),
    poss_arbitrary_id numeric(10,0),
    poss_cmd_cd character(3),
    poss_geo_loc_id character(4),
    poss_org_nbr_id integer,
    poss_org_kind_tx character(3),
    poss_unit_id character(9),
    poss_org_type_tx character(2),
    poss_purp_cd character(2),
    poss_loan_cd character(1),
    poss_gain_type_actn_cd character(1),
    poss_loss_type_actn_cd character(1),
    poss_termination_type_actn_cd character(1),
    poss_type_op_tm character(1),
    poss_curr_op_tm numeric(7,1),
    poss_srd_id character(3),
    poss_gain_proc_dt_tm timestamp(6) without time zone,
    poss_loss_proc_dt_tm timestamp(6) without time zone,
    poss_data_proc_ctr_nbr_id integer,
    poss_temp_transfer_in character(1),
    poss_equip_id character(5),
    poss_history_in character(1),
    poss_orig_work_ctr_cd character(5),
    poss_work_ctr_cd character(5),
    poss_gang_nbr_id numeric(1,0),
    poss_gain_user_name_tx character(96),
    poss_loss_user_name_tx character(96),
    poss_termination_user_name_tx character(96),
    poss_lm_dt_tm timestamp(6) without time zone,
    poss_remis_dt_tm timestamp(6) without time zone,
    poss_remis_rba integer,
    poss_start_dt date,
    poss_stop_dt date,
    util_start_dt_tm timestamp(6) without time zone,
    util_stop_dt_tm timestamp(6) without time zone,
    util_adj_stop_dt_tm timestamp without time zone,
    util_sn_id character(15),
    util_equip_desig_id character(15),
    util_rpt_mo_ind_yr_tm integer,
    util_rpt_mo_ind_mo_tm integer,
    util_mod_rmi_yr_tm integer,
    util_mod_rmi_mo_tm integer,
    util_prog_element_cd character(10),
    util_util_purp_cd character(2),
    util_type_util_cd character(4),
    util_due_in_dt timestamp(6) without time zone,
    util_yr_id integer,
    util_initial_start_dt_tm timestamp(6) without time zone,
    util_mo_id integer,
    util_initial_stop_dt_tm timestamp(6) without time zone,
    util_initial_due_in_dt timestamp(6) without time zone,
    util_hrs_am numeric(6,1),
    util_sorties_am integer,
    util_landings_am integer,
    util_arbitrary_id numeric(10,0),
    util_full_stop_landings_am integer,
    util_stress_factor_cd character(1),
    util_base_trx_dt timestamp(6) without time zone,
    util_sortie_dt integer,
    util_sortie_nbr_id integer,
    util_sortie_mod integer,
    util_mission_nmbr_cd character(12),
    util_takeoff_icao_loc_id character(4),
    util_landing_icao_loc_id character(4),
    util_stop_yr_mo integer,
    util_start_yr_mo integer,
    util_lm_dt_tm timestamp(6) without time zone,
    util_remis_dt_tm timestamp(6) without time zone,
    util_remis_rba integer,
    util_proc_dt_tm timestamp(6) without time zone,
    util_del_proc_dt_tm timestamp(6) without time zone,
    util_ins_rpt_ind_yr_mo_id integer,
    util_del_rpt_ind_yr_mo_id integer,
    util_initial_takeoff_dt_tm timestamp(6) without time zone,
    util_final_takeoff_dt_tm timestamp(6) without time zone,
    util_final_landing_dt_tm timestamp(6) without time zone,
    util_ingest_date text
);


ALTER TABLE timeline.old_timeline_util OWNER TO creator_role;

--
-- Name: old_util_timeline_util; Type: TABLE; Schema: timeline; Owner: creator_role
--

CREATE TABLE timeline.old_util_timeline_util (
    event_equip_desig_id character(15),
    event_sn_id character(15),
    event_start_dt_tm timestamp without time zone,
    event_stop_dt_tm timestamp without time zone,
    event_delta_seconds double precision,
    util_start_dt_tm timestamp(6) without time zone,
    util_stop_dt_tm timestamp(6) without time zone,
    util_adj_stop_dt_tm timestamp without time zone,
    util_sn_id character(15),
    util_equip_desig_id character(15),
    util_rpt_mo_ind_yr_tm integer,
    util_rpt_mo_ind_mo_tm integer,
    util_mod_rmi_yr_tm integer,
    util_mod_rmi_mo_tm integer,
    util_prog_element_cd character(10),
    util_util_purp_cd character(2),
    util_type_util_cd character(4),
    util_due_in_dt timestamp(6) without time zone,
    util_yr_id integer,
    util_initial_start_dt_tm timestamp(6) without time zone,
    util_mo_id integer,
    util_initial_stop_dt_tm timestamp(6) without time zone,
    util_initial_due_in_dt timestamp(6) without time zone,
    util_hrs_am numeric(6,1),
    util_sorties_am integer,
    util_landings_am integer,
    util_arbitrary_id numeric(10,0),
    util_full_stop_landings_am integer,
    util_stress_factor_cd character(1),
    util_base_trx_dt timestamp(6) without time zone,
    util_sortie_dt integer,
    util_sortie_nbr_id integer,
    util_sortie_mod integer,
    util_mission_nmbr_cd character(12),
    util_takeoff_icao_loc_id character(4),
    util_landing_icao_loc_id character(4),
    util_stop_yr_mo integer,
    util_start_yr_mo integer,
    util_lm_dt_tm timestamp(6) without time zone,
    util_remis_dt_tm timestamp(6) without time zone,
    util_remis_rba integer,
    util_proc_dt_tm timestamp(6) without time zone,
    util_del_proc_dt_tm timestamp(6) without time zone,
    util_ins_rpt_ind_yr_mo_id integer,
    util_del_rpt_ind_yr_mo_id integer,
    util_initial_takeoff_dt_tm timestamp(6) without time zone,
    util_final_takeoff_dt_tm timestamp(6) without time zone,
    util_final_landing_dt_tm timestamp(6) without time zone,
    util_ingest_date text
);


ALTER TABLE timeline.old_util_timeline_util OWNER TO creator_role;

--
-- Name: poss_timeline_stat; Type: TABLE; Schema: timeline; Owner: creator_role
--

CREATE TABLE timeline.poss_timeline_stat (
    event_equip_desig_id character(15),
    event_sn_id character(15),
    event_start_dt_tm timestamp without time zone,
    event_stop_dt_tm timestamp without time zone,
    event_delta_seconds double precision,
    poss_start_dt_tm timestamp(6) without time zone,
    poss_stop_dt_tm timestamp(6) without time zone,
    poss_equip_desig_id character(15),
    poss_sn_id character(15),
    poss_arbitrary_id numeric(10,0),
    poss_cmd_cd character(3),
    poss_geo_loc_id character(4),
    poss_org_nbr_id integer,
    poss_org_kind_tx character(3),
    poss_unit_id character(9),
    poss_org_type_tx character(2),
    poss_purp_cd character(2),
    poss_loan_cd character(1),
    poss_gain_type_actn_cd character(1),
    poss_loss_type_actn_cd character(1),
    poss_termination_type_actn_cd character(1),
    poss_type_op_tm character(1),
    poss_curr_op_tm numeric(7,1),
    poss_srd_id character(3),
    poss_gain_proc_dt_tm timestamp(6) without time zone,
    poss_loss_proc_dt_tm timestamp(6) without time zone,
    poss_data_proc_ctr_nbr_id integer,
    poss_temp_transfer_in character(1),
    poss_equip_id character(5),
    poss_history_in character(1),
    poss_orig_work_ctr_cd character(5),
    poss_work_ctr_cd character(5),
    poss_gang_nbr_id numeric(1,0),
    poss_gain_user_name_tx character(96),
    poss_loss_user_name_tx character(96),
    poss_termination_user_name_tx character(96),
    poss_lm_dt_tm timestamp(6) without time zone,
    poss_remis_dt_tm timestamp(6) without time zone,
    poss_remis_rba integer,
    poss_start_dt date,
    poss_stop_dt date
);


ALTER TABLE timeline.poss_timeline_stat OWNER TO creator_role;

--
-- Name: poss_timeline_util; Type: TABLE; Schema: timeline; Owner: creator_role
--

CREATE TABLE timeline.poss_timeline_util (
    event_equip_desig_id character(15),
    event_sn_id character(15),
    event_start_dt_tm timestamp without time zone,
    event_stop_dt_tm timestamp without time zone,
    event_delta_seconds double precision,
    poss_start_dt_tm timestamp(6) without time zone,
    poss_stop_dt_tm timestamp(6) without time zone,
    poss_equip_desig_id character(15),
    poss_sn_id character(15),
    poss_arbitrary_id numeric(10,0),
    poss_cmd_cd character(3),
    poss_geo_loc_id character(4),
    poss_org_nbr_id integer,
    poss_org_kind_tx character(3),
    poss_unit_id character(9),
    poss_org_type_tx character(2),
    poss_purp_cd character(2),
    poss_loan_cd character(1),
    poss_gain_type_actn_cd character(1),
    poss_loss_type_actn_cd character(1),
    poss_termination_type_actn_cd character(1),
    poss_type_op_tm character(1),
    poss_curr_op_tm numeric(7,1),
    poss_srd_id character(3),
    poss_gain_proc_dt_tm timestamp(6) without time zone,
    poss_loss_proc_dt_tm timestamp(6) without time zone,
    poss_data_proc_ctr_nbr_id integer,
    poss_temp_transfer_in character(1),
    poss_equip_id character(5),
    poss_history_in character(1),
    poss_orig_work_ctr_cd character(5),
    poss_work_ctr_cd character(5),
    poss_gang_nbr_id numeric(1,0),
    poss_gain_user_name_tx character(96),
    poss_loss_user_name_tx character(96),
    poss_termination_user_name_tx character(96),
    poss_lm_dt_tm timestamp(6) without time zone,
    poss_remis_dt_tm timestamp(6) without time zone,
    poss_remis_rba integer,
    poss_start_dt date,
    poss_stop_dt date
);


ALTER TABLE timeline.poss_timeline_util OWNER TO creator_role;

--
-- Name: ref_calendar; Type: TABLE; Schema: timeline; Owner: creator_role
--

CREATE TABLE timeline.ref_calendar (
    calendar_dt date,
    leap_yr_in character varying(2),
    gov_hol_in character varying(2),
    julian_dt integer,
    day_start_dt_tm timestamp(6) without time zone,
    day_end_dt_tm timestamp(6) without time zone,
    mo_start_dt_tm timestamp(6) without time zone,
    mo_end_dt_tm timestamp(6) without time zone,
    mo_start_dt date,
    mo_end_dt date,
    fscl_qtr_start_dt date,
    fscl_qtr_end_dt date,
    fscl_yr_start_dt date,
    fscl_yr_end_dt date,
    fscl_qtr_start_dt_tm timestamp(6) without time zone,
    fscl_qtr_end_dt_tm text,
    fscl_yr_start_dt_tm timestamp(6) without time zone,
    fscl_yr_end_dt_tm text,
    day_of_wk_nr smallint,
    day_of_mo_nr smallint,
    day_of_yr_nr smallint,
    day_of_qtr_nr smallint,
    wk_of_mo_nr smallint,
    wk_of_yr_nr smallint,
    mo_of_qtr_nr smallint,
    mo_nr smallint,
    qtr_nr smallint,
    yr_nr smallint,
    fscl_mo_nr smallint,
    fscl_qtr_nr smallint,
    fscl_yr_nr smallint,
    fscl_day_of_yr_nr smallint
);


ALTER TABLE timeline.ref_calendar OWNER TO creator_role;

--
-- Name: ref_msn_dsgn_av; Type: VIEW; Schema: timeline; Owner: creator_role
--

CREATE VIEW timeline.ref_msn_dsgn_av AS
 SELECT concat("substring"(mytable.md_interim_name, 1, 2), regexp_replace(substr(mytable.md_interim_name, 3, 1), '0'::text, ''::text), "substring"(mytable.md_interim_name, 4, 2)) AS md_friendly_name,
    mytable.md AS msn_dsgn,
    mytable.equip_desig_id
   FROM ( SELECT concat("substring"(mysubtable.md, 1, 1), '-', regexp_replace(substr(mysubtable.md, 2, 1), '0'::text, ''::text), "substring"(mysubtable.md, 3, 2)) AS md_interim_name,
            mysubtable.md,
            mysubtable.equip_desig_id
           FROM ( SELECT DISTINCT
                        CASE
                            WHEN (char_length(inv.equip_desig_id) = 7) THEN substr((inv.equip_desig_id)::text, 3, 4)
                            WHEN (char_length(inv.equip_desig_id) = 6) THEN substr((inv.equip_desig_id)::text, 2, 4)
                            WHEN (char_length(inv.equip_desig_id) = 5) THEN substr((inv.equip_desig_id)::text, 1, 4)
                            ELSE 'OTHER'::text
                        END AS md,
                    inv.equip_desig_id
                   FROM (remis.inv inv
                     JOIN ( SELECT DISTINCT asset_type.equip_desig_id
                           FROM remis.asset_type
                          WHERE ((asset_type.type_equip_id = ANY (ARRAY['A'::bpchar, 'M'::bpchar])) AND ((asset_type.stop_dt_tm)::date = '2046-12-31'::date))) atyp ON ((inv.equip_desig_id = atyp.equip_desig_id)))) mysubtable) mytable;


ALTER TABLE timeline.ref_msn_dsgn_av OWNER TO creator_role;

--
-- Name: remis_ev_on_equip_maint_actn; Type: VIEW; Schema: timeline; Owner: creator_role
--

CREATE VIEW timeline.remis_ev_on_equip_maint_actn AS
 SELECT ma.actn_taken_cd,
    ma.maint_type,
    ma.maint_actn_nbr_id,
    ma.labor_manhrs_am,
    ma.inpected_by_nm,
    ma.how_mal_cd,
    ma.orig_work_ctr_cd,
    ma.emp_nbr_id,
    ma.crew_size_am,
    ma.component_pos_nbr_id,
    ma.category_of_labor_id,
    ma.afto_form_350_tag_nbr_id,
    ma.af_speciality_cd,
    ma.work_ordr_nbr_id,
    ma.work_ctr_event_id,
    ma.work_ctr_cd,
    ma.when_dscvrd_cd,
    ma.units_am,
    ma.type_maint_cd,
    ma.supervisory_review_by_nm,
    ma.seq_nbr_id,
    ma.start_dt_tm,
    ma.wuc_cd,
    ma.pmr_nbr_id,
    ma.pmr_category,
    ma.perf_geo_loc_id,
    ma.stop_dt_tm,
    ma.failure_count_in,
    ma.chng_seq_nbr_id,
    ma.maint_priority_in,
    ma.maintainer_nm,
    ma.documenter_nm,
    ma.comp_maint_actn_nbr_id,
        CASE
            WHEN (wo.aisg_dt_tm IS NULL) THEN '0001-01-02 00:00:00'::timestamp(6) without time zone
            ELSE wo.aisg_dt_tm
        END AS aisg_dt_tm,
        CASE
            WHEN (wo.cmd_cd IS NULL) THEN ' '::bpchar
            ELSE wo.cmd_cd
        END AS cmd_cd,
        CASE
            WHEN (wo.curr_op_tm IS NULL) THEN (0)::numeric
            ELSE wo.curr_op_tm
        END AS curr_op_tm,
        CASE
            WHEN (wo.equip_desig_id IS NULL) THEN ' '::bpchar
            ELSE wo.equip_desig_id
        END AS equip_desig_id,
        CASE
            WHEN (wo.geo_loc_id IS NULL) THEN ' '::bpchar
            ELSE wo.geo_loc_id
        END AS geo_loc_id,
        CASE
            WHEN (wo.input_equip_desig_id IS NULL) THEN ' '::bpchar
            ELSE wo.input_equip_desig_id
        END AS input_equip_desig_id,
        CASE
            WHEN (wo.job_ctrl_nbr_id IS NULL) THEN ' '::bpchar
            ELSE wo.job_ctrl_nbr_id
        END AS job_ctrl_nbr_id,
        CASE
            WHEN (wo.org_nbr_id IS NULL) THEN 0
            ELSE wo.org_nbr_id
        END AS org_nbr_id,
        CASE
            WHEN (wo.org_kind_tx IS NULL) THEN ' '::bpchar
            ELSE wo.org_kind_tx
        END AS org_kind_tx,
        CASE
            WHEN (wo.org_type_tx IS NULL) THEN ' '::bpchar
            ELSE wo.org_type_tx
        END AS org_type_tx,
        CASE
            WHEN (wo.orig_cmd_cd IS NULL) THEN ' '::bpchar
            ELSE wo.orig_cmd_cd
        END AS orig_cmd_cd,
        CASE
            WHEN (wo.sn_id IS NULL) THEN ' '::bpchar
            ELSE wo.sn_id
        END AS sn_id,
        CASE
            WHEN (wo.srd_id IS NULL) THEN ' '::bpchar
            ELSE wo.srd_id
        END AS srd_id,
        CASE
            WHEN (wo.tcto_data_cd IS NULL) THEN ' '::bpchar
            ELSE wo.tcto_data_cd
        END AS tcto_data_cd,
        CASE
            WHEN (wo.type_equip_id IS NULL) THEN ' '::bpchar
            ELSE wo.type_equip_id
        END AS type_equip_id,
        CASE
            WHEN (wo.unit_id IS NULL) THEN ' '::bpchar
            ELSE wo.unit_id
        END AS unit_id,
    ma.stop_yr_mo,
    ma.start_yr_mo,
    ma.lm_dt_tm,
    ma.remis_dt_tm,
    ma.remis_rba
   FROM (remis.on_equip_maint_actn ma
     LEFT JOIN remis.on_equip_work_ordr wo ON ((ma.work_ordr_nbr_id = wo.work_ordr_nbr_id)));


ALTER TABLE timeline.remis_ev_on_equip_maint_actn OWNER TO creator_role;

--
-- Name: remis_ev_on_equip_maint_actn_mv; Type: MATERIALIZED VIEW; Schema: timeline; Owner: postgres
--

CREATE MATERIALIZED VIEW timeline.remis_ev_on_equip_maint_actn_mv AS
 SELECT ma.actn_taken_cd,
    ma.maint_type,
    ma.maint_actn_nbr_id,
    ma.labor_manhrs_am,
    ma.inpected_by_nm,
    ma.how_mal_cd,
    ma.orig_work_ctr_cd,
    ma.emp_nbr_id,
    ma.crew_size_am,
    ma.component_pos_nbr_id,
    ma.category_of_labor_id,
    ma.afto_form_350_tag_nbr_id,
    ma.af_speciality_cd,
    ma.work_ordr_nbr_id,
    ma.work_ctr_event_id,
    ma.work_ctr_cd,
    ma.when_dscvrd_cd,
    ma.units_am,
    ma.type_maint_cd,
    ma.supervisory_review_by_nm,
    ma.seq_nbr_id,
    ma.start_dt_tm,
    ma.wuc_cd,
    ma.pmr_nbr_id,
    ma.pmr_category,
    ma.perf_geo_loc_id,
    ma.stop_dt_tm,
    ma.failure_count_in,
    ma.chng_seq_nbr_id,
    ma.maint_priority_in,
    ma.maintainer_nm,
    ma.documenter_nm,
    ma.comp_maint_actn_nbr_id,
        CASE
            WHEN (wo.aisg_dt_tm IS NULL) THEN '0001-01-02 00:00:00'::timestamp(6) without time zone
            ELSE wo.aisg_dt_tm
        END AS aisg_dt_tm,
        CASE
            WHEN (wo.cmd_cd IS NULL) THEN ' '::bpchar
            ELSE wo.cmd_cd
        END AS cmd_cd,
        CASE
            WHEN (wo.curr_op_tm IS NULL) THEN (0)::numeric
            ELSE wo.curr_op_tm
        END AS curr_op_tm,
        CASE
            WHEN (wo.equip_desig_id IS NULL) THEN ' '::bpchar
            ELSE wo.equip_desig_id
        END AS equip_desig_id,
        CASE
            WHEN (wo.geo_loc_id IS NULL) THEN ' '::bpchar
            ELSE wo.geo_loc_id
        END AS geo_loc_id,
        CASE
            WHEN (wo.input_equip_desig_id IS NULL) THEN ' '::bpchar
            ELSE wo.input_equip_desig_id
        END AS input_equip_desig_id,
        CASE
            WHEN (wo.job_ctrl_nbr_id IS NULL) THEN ' '::bpchar
            ELSE wo.job_ctrl_nbr_id
        END AS job_ctrl_nbr_id,
        CASE
            WHEN (wo.org_nbr_id IS NULL) THEN 0
            ELSE wo.org_nbr_id
        END AS org_nbr_id,
        CASE
            WHEN (wo.org_kind_tx IS NULL) THEN ' '::bpchar
            ELSE wo.org_kind_tx
        END AS org_kind_tx,
        CASE
            WHEN (wo.org_type_tx IS NULL) THEN ' '::bpchar
            ELSE wo.org_type_tx
        END AS org_type_tx,
        CASE
            WHEN (wo.orig_cmd_cd IS NULL) THEN ' '::bpchar
            ELSE wo.orig_cmd_cd
        END AS orig_cmd_cd,
        CASE
            WHEN (wo.sn_id IS NULL) THEN ' '::bpchar
            ELSE wo.sn_id
        END AS sn_id,
        CASE
            WHEN (wo.srd_id IS NULL) THEN ' '::bpchar
            ELSE wo.srd_id
        END AS srd_id,
        CASE
            WHEN (wo.tcto_data_cd IS NULL) THEN ' '::bpchar
            ELSE wo.tcto_data_cd
        END AS tcto_data_cd,
        CASE
            WHEN (wo.type_equip_id IS NULL) THEN ' '::bpchar
            ELSE wo.type_equip_id
        END AS type_equip_id,
        CASE
            WHEN (wo.unit_id IS NULL) THEN ' '::bpchar
            ELSE wo.unit_id
        END AS unit_id,
    ma.stop_yr_mo,
    ma.start_yr_mo,
    ma.lm_dt_tm,
    ma.remis_dt_tm,
    ma.remis_rba
   FROM (remis.on_equip_maint_actn ma
     LEFT JOIN remis.on_equip_work_ordr wo ON ((ma.work_ordr_nbr_id = wo.work_ordr_nbr_id)))
  WITH NO DATA;


ALTER TABLE timeline.remis_ev_on_equip_maint_actn_mv OWNER TO postgres;

--
-- Name: stat_timeline_stat; Type: TABLE; Schema: timeline; Owner: creator_role
--

CREATE TABLE timeline.stat_timeline_stat (
    event_equip_desig_id character(15),
    event_sn_id character(15),
    event_start_dt_tm timestamp without time zone,
    event_stop_dt_tm timestamp without time zone,
    event_delta_seconds double precision,
    stat_start_dt_tm timestamp(6) without time zone,
    stat_stop_dt_tm timestamp(6) without time zone,
    stat_adj_stop_dt_tm timestamp without time zone,
    stat_sn_id character(15),
    stat_equip_desig_id character(15),
    stat_arbitrary_id numeric(10,0),
    stat_cd character(1),
    stat_loc_id character(15),
    stat_type character(1),
    stat_yr_id integer,
    stat_mo_id integer,
    stat_wuc_cd character(15),
    stat_as_of_dt_tm timestamp(6) without time zone,
    stat_hrs_am numeric(6,1),
    stat_job_ctrl_nbr_id character(9),
    stat_work_ctr_event_id integer,
    stat_orig_cmd_cd character(3),
    stat_orig_geo_loc_id character(4),
    stat_unit_id character(1),
    stat_lru_capability_nbr_in integer,
    stat_stop_yr_mo integer,
    stat_start_yr_mo integer,
    stat_lm_dt_tm timestamp(6) without time zone,
    stat_remis_dt_tm timestamp(6) without time zone,
    stat_remis_rba integer,
    stat_end_itm_capability_nbr_id integer,
    stat_override_stat_in character(1),
    stat_start_dt date,
    stat_stop_dt date,
    stat_ingest_date text
);


ALTER TABLE timeline.stat_timeline_stat OWNER TO creator_role;

--
-- Name: timeline_as_of_dt_tm; Type: TABLE; Schema: timeline; Owner: creator_role
--

CREATE TABLE timeline.timeline_as_of_dt_tm (
    max_event_dt_tm timestamp without time zone,
    julian_dt integer,
    mo_start_dt_tm timestamp(6) without time zone,
    mo_end_dt_tm timestamp(6) without time zone,
    fscl_qtr_start_dt_tm timestamp(6) without time zone,
    fscl_qtr_end_dt_tm text,
    fscl_yr_start_dt_tm timestamp(6) without time zone,
    fscl_yr_end_dt_tm text
);


ALTER TABLE timeline.timeline_as_of_dt_tm OWNER TO creator_role;

--
-- Name: timeline_stat; Type: TABLE; Schema: timeline; Owner: creator_role
--

CREATE TABLE timeline.timeline_stat (
    event_equip_desig_id character(15),
    event_sn_id character(15),
    event_start_dt_tm timestamp without time zone,
    event_stop_dt_tm timestamp without time zone,
    event_delta_seconds double precision,
    asgn_start_dt_tm timestamp(6) without time zone,
    asgn_stop_dt_tm timestamp(6) without time zone,
    asgn_adj_stop_dt_tm timestamp without time zone,
    asgn_equip_desig_id character(15),
    asgn_sn_id character(15),
    asgn_alc_cd character(2),
    asgn_cmd_cd character(3),
    asgn_purp_cd character(2),
    asgn_geo_loc_id character(4),
    asgn_org_nbr_id integer,
    asgn_org_kind_tx character(3),
    asgn_assig_proj_tx character(8),
    asgn_org_type_tx character(2),
    asgn_prog_element_cd character(10),
    asgn_assig_directive_tx character(6),
    asgn_assig_dt timestamp(6) without time zone,
    asgn_start_user_name_tx character(96),
    asgn_stop_user_name_tx character(96),
    asgn_lm_dt_tm timestamp(6) without time zone,
    asgn_remis_dt_tm timestamp(6) without time zone,
    asgn_remis_rba integer,
    asgn_fund_cd character(2),
    asgn_appropriation_cd character(14),
    asgn_budget_cd character(1),
    asgn_sales_cd character(3),
    asgn_type_of_acquisition character(30),
    asgn_doc_id_cd character(3),
    asgn_remarks character(80),
    asgn_contract_nbr_po_other_id character(50),
    asgn_inv_recv_rpt_nbr character(50),
    asgn_acq_frm_cmd_cd character(3),
    asgn_accumulated_depreciation numeric(12,2),
    asgn_fnl_termn_typ_actn_cd character(1),
    asgn_termn_dt_tm timestamp(6) without time zone,
    poss_start_dt_tm timestamp(6) without time zone,
    poss_stop_dt_tm timestamp(6) without time zone,
    poss_equip_desig_id character(15),
    poss_sn_id character(15),
    poss_arbitrary_id numeric(10,0),
    poss_cmd_cd character(3),
    poss_geo_loc_id character(4),
    poss_org_nbr_id integer,
    poss_org_kind_tx character(3),
    poss_unit_id character(9),
    poss_org_type_tx character(2),
    poss_purp_cd character(2),
    poss_loan_cd character(1),
    poss_gain_type_actn_cd character(1),
    poss_loss_type_actn_cd character(1),
    poss_termination_type_actn_cd character(1),
    poss_type_op_tm character(1),
    poss_curr_op_tm numeric(7,1),
    poss_srd_id character(3),
    poss_gain_proc_dt_tm timestamp(6) without time zone,
    poss_loss_proc_dt_tm timestamp(6) without time zone,
    poss_data_proc_ctr_nbr_id integer,
    poss_temp_transfer_in character(1),
    poss_equip_id character(5),
    poss_history_in character(1),
    poss_orig_work_ctr_cd character(5),
    poss_work_ctr_cd character(5),
    poss_gang_nbr_id numeric(1,0),
    poss_gain_user_name_tx character(96),
    poss_loss_user_name_tx character(96),
    poss_termination_user_name_tx character(96),
    poss_lm_dt_tm timestamp(6) without time zone,
    poss_remis_dt_tm timestamp(6) without time zone,
    poss_remis_rba integer,
    poss_start_dt date,
    poss_stop_dt date,
    stat_start_dt_tm timestamp(6) without time zone,
    stat_stop_dt_tm timestamp(6) without time zone,
    stat_adj_stop_dt_tm timestamp without time zone,
    stat_sn_id character(15),
    stat_equip_desig_id character(15),
    stat_arbitrary_id numeric(10,0),
    stat_cd character(1),
    stat_loc_id character(15),
    stat_type character(1),
    stat_yr_id integer,
    stat_mo_id integer,
    stat_wuc_cd character(15),
    stat_as_of_dt_tm timestamp(6) without time zone,
    stat_hrs_am numeric(6,1),
    stat_job_ctrl_nbr_id character(9),
    stat_work_ctr_event_id integer,
    stat_orig_cmd_cd character(3),
    stat_orig_geo_loc_id character(4),
    stat_unit_id character(1),
    stat_lru_capability_nbr_in integer,
    stat_stop_yr_mo integer,
    stat_start_yr_mo integer,
    stat_lm_dt_tm timestamp(6) without time zone,
    stat_remis_dt_tm timestamp(6) without time zone,
    stat_remis_rba integer,
    stat_end_itm_capability_nbr_id integer,
    stat_override_stat_in character(1),
    stat_start_dt date,
    stat_stop_dt date,
    stat_ingest_date text
);


ALTER TABLE timeline.timeline_stat OWNER TO creator_role;

--
-- Name: timeline_util; Type: TABLE; Schema: timeline; Owner: creator_role
--

CREATE TABLE timeline.timeline_util (
    event_equip_desig_id character(15),
    event_sn_id character(15),
    event_start_dt_tm timestamp without time zone,
    event_stop_dt_tm timestamp without time zone,
    event_delta_seconds double precision,
    asgn_start_dt_tm timestamp(6) without time zone,
    asgn_stop_dt_tm timestamp(6) without time zone,
    asgn_adj_stop_dt_tm timestamp without time zone,
    asgn_equip_desig_id character(15),
    asgn_sn_id character(15),
    asgn_alc_cd character(2),
    asgn_cmd_cd character(3),
    asgn_purp_cd character(2),
    asgn_geo_loc_id character(4),
    asgn_org_nbr_id integer,
    asgn_org_kind_tx character(3),
    asgn_assig_proj_tx character(8),
    asgn_org_type_tx character(2),
    asgn_prog_element_cd character(10),
    asgn_assig_directive_tx character(6),
    asgn_assig_dt timestamp(6) without time zone,
    asgn_start_user_name_tx character(96),
    asgn_stop_user_name_tx character(96),
    asgn_lm_dt_tm timestamp(6) without time zone,
    asgn_remis_dt_tm timestamp(6) without time zone,
    asgn_remis_rba integer,
    asgn_fund_cd character(2),
    asgn_appropriation_cd character(14),
    asgn_budget_cd character(1),
    asgn_sales_cd character(3),
    asgn_type_of_acquisition character(30),
    asgn_doc_id_cd character(3),
    asgn_remarks character(80),
    asgn_contract_nbr_po_other_id character(50),
    asgn_inv_recv_rpt_nbr character(50),
    asgn_acq_frm_cmd_cd character(3),
    asgn_accumulated_depreciation numeric(12,2),
    asgn_fnl_termn_typ_actn_cd character(1),
    asgn_termn_dt_tm timestamp(6) without time zone,
    poss_start_dt_tm timestamp(6) without time zone,
    poss_stop_dt_tm timestamp(6) without time zone,
    poss_equip_desig_id character(15),
    poss_sn_id character(15),
    poss_arbitrary_id numeric(10,0),
    poss_cmd_cd character(3),
    poss_geo_loc_id character(4),
    poss_org_nbr_id integer,
    poss_org_kind_tx character(3),
    poss_unit_id character(9),
    poss_org_type_tx character(2),
    poss_purp_cd character(2),
    poss_loan_cd character(1),
    poss_gain_type_actn_cd character(1),
    poss_loss_type_actn_cd character(1),
    poss_termination_type_actn_cd character(1),
    poss_type_op_tm character(1),
    poss_curr_op_tm numeric(7,1),
    poss_srd_id character(3),
    poss_gain_proc_dt_tm timestamp(6) without time zone,
    poss_loss_proc_dt_tm timestamp(6) without time zone,
    poss_data_proc_ctr_nbr_id integer,
    poss_temp_transfer_in character(1),
    poss_equip_id character(5),
    poss_history_in character(1),
    poss_orig_work_ctr_cd character(5),
    poss_work_ctr_cd character(5),
    poss_gang_nbr_id numeric(1,0),
    poss_gain_user_name_tx character(96),
    poss_loss_user_name_tx character(96),
    poss_termination_user_name_tx character(96),
    poss_lm_dt_tm timestamp(6) without time zone,
    poss_remis_dt_tm timestamp(6) without time zone,
    poss_remis_rba integer,
    poss_start_dt date,
    poss_stop_dt date,
    util_start_dt_tm timestamp(6) without time zone,
    util_stop_dt_tm timestamp(6) without time zone,
    util_adj_stop_dt_tm timestamp without time zone,
    util_sn_id character(15),
    util_equip_desig_id character(15),
    util_rpt_mo_ind_yr_tm integer,
    util_rpt_mo_ind_mo_tm integer,
    util_mod_rmi_yr_tm integer,
    util_mod_rmi_mo_tm integer,
    util_prog_element_cd character(10),
    util_util_purp_cd character(2),
    util_type_util_cd character(4),
    util_due_in_dt timestamp(6) without time zone,
    util_yr_id integer,
    util_initial_start_dt_tm timestamp(6) without time zone,
    util_mo_id integer,
    util_initial_stop_dt_tm timestamp(6) without time zone,
    util_initial_due_in_dt timestamp(6) without time zone,
    util_hrs_am numeric(6,1),
    util_sorties_am integer,
    util_landings_am integer,
    util_arbitrary_id numeric(10,0),
    util_full_stop_landings_am integer,
    util_stress_factor_cd character(1),
    util_base_trx_dt timestamp(6) without time zone,
    util_sortie_dt integer,
    util_sortie_nbr_id integer,
    util_sortie_mod integer,
    util_mission_nmbr_cd character(12),
    util_takeoff_icao_loc_id character(4),
    util_landing_icao_loc_id character(4),
    util_stop_yr_mo integer,
    util_start_yr_mo integer,
    util_lm_dt_tm timestamp(6) without time zone,
    util_remis_dt_tm timestamp(6) without time zone,
    util_remis_rba integer,
    util_proc_dt_tm timestamp(6) without time zone,
    util_del_proc_dt_tm timestamp(6) without time zone,
    util_ins_rpt_ind_yr_mo_id integer,
    util_del_rpt_ind_yr_mo_id integer,
    util_initial_takeoff_dt_tm timestamp(6) without time zone,
    util_final_takeoff_dt_tm timestamp(6) without time zone,
    util_final_landing_dt_tm timestamp(6) without time zone,
    util_ingest_date text
);


ALTER TABLE timeline.timeline_util OWNER TO creator_role;

--
-- Name: util_timeline_util; Type: TABLE; Schema: timeline; Owner: creator_role
--

CREATE TABLE timeline.util_timeline_util (
    event_equip_desig_id character(15),
    event_sn_id character(15),
    event_start_dt_tm timestamp without time zone,
    event_stop_dt_tm timestamp without time zone,
    event_delta_seconds double precision,
    util_start_dt_tm timestamp(6) without time zone,
    util_stop_dt_tm timestamp(6) without time zone,
    util_adj_stop_dt_tm timestamp without time zone,
    util_sn_id character(15),
    util_equip_desig_id character(15),
    util_rpt_mo_ind_yr_tm integer,
    util_rpt_mo_ind_mo_tm integer,
    util_mod_rmi_yr_tm integer,
    util_mod_rmi_mo_tm integer,
    util_prog_element_cd character(10),
    util_util_purp_cd character(2),
    util_type_util_cd character(4),
    util_due_in_dt timestamp(6) without time zone,
    util_yr_id integer,
    util_initial_start_dt_tm timestamp(6) without time zone,
    util_mo_id integer,
    util_initial_stop_dt_tm timestamp(6) without time zone,
    util_initial_due_in_dt timestamp(6) without time zone,
    util_hrs_am numeric(6,1),
    util_sorties_am integer,
    util_landings_am integer,
    util_arbitrary_id numeric(10,0),
    util_full_stop_landings_am integer,
    util_stress_factor_cd character(1),
    util_base_trx_dt timestamp(6) without time zone,
    util_sortie_dt integer,
    util_sortie_nbr_id integer,
    util_sortie_mod integer,
    util_mission_nmbr_cd character(12),
    util_takeoff_icao_loc_id character(4),
    util_landing_icao_loc_id character(4),
    util_stop_yr_mo integer,
    util_start_yr_mo integer,
    util_lm_dt_tm timestamp(6) without time zone,
    util_remis_dt_tm timestamp(6) without time zone,
    util_remis_rba integer,
    util_proc_dt_tm timestamp(6) without time zone,
    util_del_proc_dt_tm timestamp(6) without time zone,
    util_ins_rpt_ind_yr_mo_id integer,
    util_del_rpt_ind_yr_mo_id integer,
    util_initial_takeoff_dt_tm timestamp(6) without time zone,
    util_final_takeoff_dt_tm timestamp(6) without time zone,
    util_final_landing_dt_tm timestamp(6) without time zone,
    util_ingest_date text
);


ALTER TABLE timeline.util_timeline_util OWNER TO creator_role;

--
-- Name: wuci_rollup; Type: TABLE; Schema: timeline; Owner: creator_role
--

CREATE TABLE timeline.wuci_rollup (
    index bigint,
    mds text,
    block text,
    possessed text,
    tai text,
    poss_cmdcd text,
    poss_geoloc text,
    mx_start_yr bigint,
    mx_start_qt bigint,
    status text,
    stat_wuc text,
    mx_wuc2_cd text,
    mx_wuc3_cd text,
    mx_wuc_cd text,
    cat_ppc text,
    labor_manhrs_am double precision,
    crew_size_am bigint,
    wuc_cnt bigint
);


ALTER TABLE timeline.wuci_rollup OWNER TO creator_role;

--
-- Name: awardcontractid awardcontractid_pkey; Type: CONSTRAINT; Schema: aficc; Owner: aficc_creator
--

ALTER TABLE ONLY aficc.awardcontractid
    ADD CONSTRAINT awardcontractid_pkey PRIMARY KEY (id);


--
-- Name: competitioninformation competitioninformation_pkey; Type: CONSTRAINT; Schema: aficc; Owner: aficc_creator
--

ALTER TABLE ONLY aficc.competitioninformation
    ADD CONSTRAINT competitioninformation_pkey PRIMARY KEY (id);


--
-- Name: contractinformation contractinformation_pkey; Type: CONSTRAINT; Schema: aficc; Owner: aficc_creator
--

ALTER TABLE ONLY aficc.contractinformation
    ADD CONSTRAINT contractinformation_pkey PRIMARY KEY (id);


--
-- Name: contractmarketingdata contractmarketingdata_pkey; Type: CONSTRAINT; Schema: aficc; Owner: aficc_creator
--

ALTER TABLE ONLY aficc.contractmarketingdata
    ADD CONSTRAINT contractmarketingdata_pkey PRIMARY KEY (id);


--
-- Name: contractordataa contractordataa_pkey; Type: CONSTRAINT; Schema: aficc; Owner: aficc_creator
--

ALTER TABLE ONLY aficc.contractordataa
    ADD CONSTRAINT contractordataa_pkey PRIMARY KEY (id);


--
-- Name: contractordatab contractordatab_pkey; Type: CONSTRAINT; Schema: aficc; Owner: aficc_creator
--

ALTER TABLE ONLY aficc.contractordatab
    ADD CONSTRAINT contractordatab_pkey PRIMARY KEY (id);


--
-- Name: dates dates_pkey; Type: CONSTRAINT; Schema: aficc; Owner: aficc_creator
--

ALTER TABLE ONLY aficc.dates
    ADD CONSTRAINT dates_pkey PRIMARY KEY (id);


--
-- Name: documents documents_pkey; Type: CONSTRAINT; Schema: aficc; Owner: aficc_creator
--

ALTER TABLE ONLY aficc.documents
    ADD CONSTRAINT documents_pkey PRIMARY KEY (id);


--
-- Name: dollarvalues dollarvalues_pkey; Type: CONSTRAINT; Schema: aficc; Owner: aficc_creator
--

ALTER TABLE ONLY aficc.dollarvalues
    ADD CONSTRAINT dollarvalues_pkey PRIMARY KEY (id);


--
-- Name: idvid idvid_pkey; Type: CONSTRAINT; Schema: aficc; Owner: aficc_creator
--

ALTER TABLE ONLY aficc.idvid
    ADD CONSTRAINT idvid_pkey PRIMARY KEY (id);


--
-- Name: legislativemandates legislativemandates_pkey; Type: CONSTRAINT; Schema: aficc; Owner: aficc_creator
--

ALTER TABLE ONLY aficc.legislativemandates
    ADD CONSTRAINT legislativemandates_pkey PRIMARY KEY (id);


--
-- Name: meta meta_pkey; Type: CONSTRAINT; Schema: aficc; Owner: aficc_creator
--

ALTER TABLE ONLY aficc.meta
    ADD CONSTRAINT meta_pkey PRIMARY KEY (id);


--
-- Name: othertransactionawardcontractid othertransactionawardcontractid_pkey; Type: CONSTRAINT; Schema: aficc; Owner: aficc_creator
--

ALTER TABLE ONLY aficc.othertransactionawardcontractid
    ADD CONSTRAINT othertransactionawardcontractid_pkey PRIMARY KEY (id);


--
-- Name: othertransactionidvid othertransactionidvid_pkey; Type: CONSTRAINT; Schema: aficc; Owner: aficc_creator
--

ALTER TABLE ONLY aficc.othertransactionidvid
    ADD CONSTRAINT othertransactionidvid_pkey PRIMARY KEY (id);


--
-- Name: preferenceprograms preferenceprograms_pkey; Type: CONSTRAINT; Schema: aficc; Owner: aficc_creator
--

ALTER TABLE ONLY aficc.preferenceprograms
    ADD CONSTRAINT preferenceprograms_pkey PRIMARY KEY (id);


--
-- Name: productorserviceinformation productorserviceinformation_pkey; Type: CONSTRAINT; Schema: aficc; Owner: aficc_creator
--

ALTER TABLE ONLY aficc.productorserviceinformation
    ADD CONSTRAINT productorserviceinformation_pkey PRIMARY KEY (id);


--
-- Name: purchaserinformation purchaserinformation_pkey; Type: CONSTRAINT; Schema: aficc; Owner: aficc_creator
--

ALTER TABLE ONLY aficc.purchaserinformation
    ADD CONSTRAINT purchaserinformation_pkey PRIMARY KEY (id);


--
-- Name: referencedidvid referencedidvid_pkey; Type: CONSTRAINT; Schema: aficc; Owner: aficc_creator
--

ALTER TABLE ONLY aficc.referencedidvid
    ADD CONSTRAINT referencedidvid_pkey PRIMARY KEY (id);


--
-- Name: solicitationid solicitationid_pkey; Type: CONSTRAINT; Schema: aficc; Owner: aficc_creator
--

ALTER TABLE ONLY aficc.solicitationid
    ADD CONSTRAINT solicitationid_pkey PRIMARY KEY (id);


--
-- Name: transactioninformation transactioninformation_pkey; Type: CONSTRAINT; Schema: aficc; Owner: aficc_creator
--

ALTER TABLE ONLY aficc.transactioninformation
    ADD CONSTRAINT transactioninformation_pkey PRIMARY KEY (id);


--
-- Name: translog translog_pkey; Type: CONSTRAINT; Schema: aficc; Owner: aficc_creator
--

ALTER TABLE ONLY aficc.translog
    ADD CONSTRAINT translog_pkey PRIMARY KEY (record_id);


--
-- Name: atom_id_idx; Type: INDEX; Schema: aficc; Owner: aficc_creator
--

CREATE INDEX atom_id_idx ON aficc.translog USING btree (atom_id);


--
-- Name: id_fingerprint; Type: INDEX; Schema: aficc; Owner: aficc_creator
--

CREATE INDEX id_fingerprint ON aficc.meta USING hash (fingerprint);


--
-- Name: lastmoddate_idx; Type: INDEX; Schema: aficc; Owner: aficc_creator
--

CREATE INDEX lastmoddate_idx ON aficc.documents USING brin (lastmoddate);


--
-- Name: heatmap_idx_id_mds_tm; Type: INDEX; Schema: sandbox; Owner: postgres
--

CREATE INDEX heatmap_idx_id_mds_tm ON sandbox."HEATMAP" USING btree (sn_id, mds, start_tm);


--
-- Name: ix_sandbox_manpower_civ_index; Type: INDEX; Schema: sandbox; Owner: creator_role
--

CREATE INDEX ix_sandbox_manpower_civ_index ON sandbox.manpower_civ USING btree (index);


--
-- Name: ix_sandbox_manpower_mil_index; Type: INDEX; Schema: sandbox; Owner: creator_role
--

CREATE INDEX ix_sandbox_manpower_mil_index ON sandbox.manpower_mil USING btree (index);


--
-- Name: ix_sandbox_wuci_rollup_index; Type: INDEX; Schema: sandbox; Owner: creator_role
--

CREATE INDEX ix_sandbox_wuci_rollup_index ON sandbox.wuci_rollup USING btree (index);


--
-- Name: ix_sandbox_wuci_rollup_sam_test_newdata_index; Type: INDEX; Schema: sandbox; Owner: creator_role
--

CREATE INDEX ix_sandbox_wuci_rollup_sam_test_newdata_index ON sandbox.wuci_rollup_sam_test_newdata USING btree (index);


--
-- Name: remis_ev_on_equip_ma_idx_tm; Type: INDEX; Schema: sandbox; Owner: postgres
--

CREATE INDEX remis_ev_on_equip_ma_idx_tm ON sandbox.remis_ev_on_equip_maint_actn_mv USING btree (start_dt_tm);


--
-- Name: heatmap_mds_idx; Type: INDEX; Schema: timeline; Owner: creator_role
--

CREATE INDEX heatmap_mds_idx ON timeline."old_HEATMAP" USING btree (mds);


--
-- Name: ix_timeline_F22_WUC_index; Type: INDEX; Schema: timeline; Owner: creator_role
--

CREATE INDEX "ix_timeline_F22_WUC_index" ON timeline."F22_WUC" USING btree (index);


--
-- Name: ix_timeline_GEO_LOC_index; Type: INDEX; Schema: timeline; Owner: creator_role
--

CREATE INDEX "ix_timeline_GEO_LOC_index" ON timeline."GEO_LOC" USING btree (index);


--
-- Name: ix_timeline_HEATMAP_index; Type: INDEX; Schema: timeline; Owner: creator_role
--

CREATE INDEX "ix_timeline_HEATMAP_index" ON timeline."old_HEATMAP" USING btree (index);


--
-- Name: ix_timeline_REMIS_WUC_index; Type: INDEX; Schema: timeline; Owner: creator_role
--

CREATE INDEX "ix_timeline_REMIS_WUC_index" ON timeline."REMIS_WUC" USING btree (index);


--
-- Name: ix_timeline_f16blocks_index; Type: INDEX; Schema: timeline; Owner: creator_role
--

CREATE INDEX ix_timeline_f16blocks_index ON timeline.old_f16blocks USING btree (index);


--
-- Name: ix_timeline_geoloc_reduced_index; Type: INDEX; Schema: timeline; Owner: creator_role
--

CREATE INDEX ix_timeline_geoloc_reduced_index ON timeline.geoloc_reduced USING btree (index);


--
-- Name: ix_timeline_newheatmap_test1_index; Type: INDEX; Schema: timeline; Owner: creator_role
--

CREATE INDEX ix_timeline_newheatmap_test1_index ON timeline.newheatmap_test1 USING btree (index);


--
-- Name: ix_timeline_wuci_rollup_index; Type: INDEX; Schema: timeline; Owner: creator_role
--

CREATE INDEX ix_timeline_wuci_rollup_index ON timeline.wuci_rollup USING btree (index);


--
-- Name: mxactnheatmap_mxmds_idx; Type: INDEX; Schema: timeline; Owner: postgres
--

CREATE INDEX mxactnheatmap_mxmds_idx ON timeline.old_mx_actn_heatmap USING btree (mx_mds);


--
-- Name: trg_create_tbl; Type: EVENT TRIGGER; Schema: -; Owner: postgres
--

CREATE EVENT TRIGGER trg_create_tbl ON ddl_command_start
         WHEN TAG IN ('CREATE TABLE', 'CREATE VIEW')
   EXECUTE PROCEDURE timeline.trg_create_tbl();


ALTER EVENT TRIGGER trg_create_tbl OWNER TO postgres;

--
-- Name: trg_drop_tbl; Type: EVENT TRIGGER; Schema: -; Owner: postgres
--

CREATE EVENT TRIGGER trg_drop_tbl ON ddl_command_start
         WHEN TAG IN ('DROP TABLE', 'DROP VIEW')
   EXECUTE PROCEDURE timeline.trg_drop_tbl();


ALTER EVENT TRIGGER trg_drop_tbl OWNER TO postgres;

--
-- Name: trg_reset_usr; Type: EVENT TRIGGER; Schema: -; Owner: postgres
--

CREATE EVENT TRIGGER trg_reset_usr ON ddl_command_end
         WHEN TAG IN ('CREATE TABLE', 'CREATE VIEW', 'DROP TABLE', 'DROP VIEW')
   EXECUTE PROCEDURE timeline.trg_reset_usr();


ALTER EVENT TRIGGER trg_reset_usr OWNER TO postgres;

--
-- PostgreSQL database dump complete
--

\connect afscbkp

SET default_transaction_read_only = off;

--
-- PostgreSQL database dump
--

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

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;

--
-- Name: afsc448_onesnapshot; Type: SCHEMA; Schema: -; Owner: postgres
--

CREATE SCHEMA afsc448_onesnapshot;


ALTER SCHEMA afsc448_onesnapshot OWNER TO postgres;

--
-- Name: afsc448_public; Type: SCHEMA; Schema: -; Owner: postgres
--

CREATE SCHEMA afsc448_public;


ALTER SCHEMA afsc448_public OWNER TO postgres;

--
-- Name: SCHEMA afsc448_public; Type: COMMENT; Schema: -; Owner: postgres
--

COMMENT ON SCHEMA afsc448_public IS 'standard public schema';


--
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: 
--

CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;


--
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: 
--

COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';


--
-- Name: pg_schema_size(text); Type: FUNCTION; Schema: afsc448_public; Owner: postgres
--

CREATE FUNCTION afsc448_public.pg_schema_size(text) RETURNS bigint
    LANGUAGE sql
    AS $_$
SELECT SUM(pg_total_relation_size(quote_ident(schemaname) || '.' || quote_ident(tablename)))::BIGINT FROM pg_tables WHERE schemaname = $1
$_$;


ALTER FUNCTION afsc448_public.pg_schema_size(text) OWNER TO postgres;

--
-- Name: to_timestamp_from_excel(integer); Type: FUNCTION; Schema: afsc448_public; Owner: postgres
--

CREATE FUNCTION afsc448_public.to_timestamp_from_excel(exceldate integer) RETURNS timestamp without time zone
    LANGUAGE plpgsql
    AS $$
BEGIN
   IF ExcelDate > 59 THEN
    ExcelDate = ExcelDate - 1;
   END IF;
   RETURN date '1899-12-31' + ExcelDate;
END;
$$;


ALTER FUNCTION afsc448_public.to_timestamp_from_excel(exceldate integer) OWNER TO postgres;

SET default_tablespace = '';

SET default_with_oids = false;

--
-- Name: actual_nsn_data; Type: TABLE; Schema: afsc448_onesnapshot; Owner: postgres
--

CREATE TABLE afsc448_onesnapshot.actual_nsn_data (
    sgm_niin_id bigint NOT NULL,
    actual_niin character varying(9) NOT NULL,
    carc_on_hand bigint,
    control_num character varying(5),
    job_designator character varying(1),
    repair_res_code character varying(8),
    reason character varying(87),
    bypass_ind bigint,
    whse_location character varying(14),
    time_stamp character varying(28)
);


ALTER TABLE afsc448_onesnapshot.actual_nsn_data OWNER TO postgres;

--
-- Name: carcass_contstraint; Type: TABLE; Schema: afsc448_onesnapshot; Owner: postgres
--

CREATE TABLE afsc448_onesnapshot.carcass_contstraint (
    niin_id bigint,
    nsn character varying(15),
    mds_list character varying(64),
    high_priority_flag boolean,
    carcass_failures bigint,
    maldistribution bigint,
    bypass_count bigint,
    other_alc_rep_count bigint,
    off_base_rep_count bigint,
    other_cond_rep_count bigint,
    cn_rep_count bigint,
    ybq_backorder_count bigint,
    awp_g_count bigint,
    on_contr_pr_count bigint,
    base_difm bigint,
    backorder_qty bigint,
    working_level bigint,
    carcass_shortage bigint,
    depot_difm bigint,
    time_stamp character varying(28),
    date timestamp without time zone,
    lru_sru_ind character varying(10),
    pdn character varying(10),
    sor_alc character varying(10),
    sos_alc character varying(10),
    pssd character varying(10),
    item_manager_code character varying(10)
);


ALTER TABLE afsc448_onesnapshot.carcass_contstraint OWNER TO postgres;

--
-- Name: component_data; Type: TABLE; Schema: afsc448_onesnapshot; Owner: postgres
--

CREATE TABLE afsc448_onesnapshot.component_data (
    comp_niin bigint,
    available_assets_oc bigint,
    available_assets_oo bigint,
    available_assets_wr bigint,
    available_assets_common bigint,
    awp_qty_avail bigint,
    req_aa bigint,
    slimm_prob numeric(4,1),
    total_qpa_oc bigint,
    total_qpa_oo bigint,
    total_qpa_wr bigint,
    total_qpa_common bigint,
    total_requirement numeric(9,2),
    world_wide_replacement_percent numeric(7,2),
    process_switch bigint,
    time_stamp character varying(28),
    date timestamp without time zone
);


ALTER TABLE afsc448_onesnapshot.component_data OWNER TO postgres;

--
-- Name: compout_type_3; Type: TABLE; Schema: afsc448_onesnapshot; Owner: postgres
--

CREATE TABLE afsc448_onesnapshot.compout_type_3 (
    niin_id bigint,
    sran character varying(6),
    trans_num bigint,
    tran_index bigint,
    spaws_rank bigint,
    original_spaws_rank bigint,
    sort_value character varying(21),
    sprt_ind numeric(4,1),
    sprs_seq bigint,
    ws_index bigint,
    kind_code bigint,
    base_prob character varying(12),
    ww_prob numeric(4,1),
    ship_ind bigint,
    doable boolean,
    document_num character varying(15),
    priority_code character varying(3),
    nha_niin_id bigint,
    nsn_count bigint,
    epp_kind_code character varying(1),
    comp_source character varying(1),
    cirf_sran character varying(6),
    time_stamp character varying(28),
    date timestamp without time zone
);


ALTER TABLE afsc448_onesnapshot.compout_type_3 OWNER TO postgres;

--
-- Name: daily_demand_excp; Type: TABLE; Schema: afsc448_onesnapshot; Owner: postgres
--

CREATE TABLE afsc448_onesnapshot.daily_demand_excp (
    niin_id bigint,
    daily_demand_rate numeric(10,4),
    time_stamp character varying(28),
    date timestamp without time zone,
    sran character varying(10),
    d035k_daily_demand_rate character varying(150),
    d035k_daily_demand_rate_njr character varying(150)
);


ALTER TABLE afsc448_onesnapshot.daily_demand_excp OWNER TO postgres;

--
-- Name: depot_awp; Type: TABLE; Schema: afsc448_onesnapshot; Owner: postgres
--

CREATE TABLE afsc448_onesnapshot.depot_awp (
    niin_id bigint,
    niin_id_sru bigint,
    quantity bigint,
    end_item_nsn character varying(15),
    end_item_doc_num character varying(14),
    comp_due_out_nsn character varying(15),
    comp_due_out_doc_num character varying(14),
    comp_due_out_sos character varying(30),
    comp_due_out_errc character varying(10),
    bo_release_qty bigint,
    time_stamp character varying(28),
    date timestamp without time zone
);


ALTER TABLE afsc448_onesnapshot.depot_awp OWNER TO postgres;

--
-- Name: depot_bo; Type: TABLE; Schema: afsc448_onesnapshot; Owner: postgres
--

CREATE TABLE afsc448_onesnapshot.depot_bo (
    alc character varying(2),
    di_code character varying(3),
    nsn character varying(15),
    doc_nr character varying(14),
    qty bigint,
    priority_cd bigint,
    micap_ind character varying(1),
    aac character varying(2),
    errc character varying(1),
    budget_cd character varying(1),
    critical_item boolean,
    ui character varying(2),
    noun character varying(37),
    procurement_src_cd character varying(1),
    retail_sos character varying(3),
    item_sos character varying(3),
    insp_data_cd character varying(3),
    unit_price numeric(12,2),
    "DATE" timestamp without time zone,
    extract_time timestamp without time zone
);


ALTER TABLE afsc448_onesnapshot.depot_bo OWNER TO postgres;

--
-- Name: depot_condemnation; Type: TABLE; Schema: afsc448_onesnapshot; Owner: postgres
--

CREATE TABLE afsc448_onesnapshot.depot_condemnation (
    count bigint,
    niin_id bigint,
    cndmn_pct bigint,
    depot_date timestamp without time zone,
    sor_alc character varying(2)
);


ALTER TABLE afsc448_onesnapshot.depot_condemnation OWNER TO postgres;

--
-- Name: epp_kind_code_definitions; Type: TABLE; Schema: afsc448_onesnapshot; Owner: postgres
--

CREATE TABLE afsc448_onesnapshot.epp_kind_code_definitions (
    epp_kind_code character varying(2),
    code_definition character varying(9),
    code_description character varying(72),
    date timestamp without time zone
);


ALTER TABLE afsc448_onesnapshot.epp_kind_code_definitions OWNER TO postgres;

--
-- Name: external_rework_and_no_bid_list; Type: TABLE; Schema: afsc448_onesnapshot; Owner: postgres
--

CREATE TABLE afsc448_onesnapshot.external_rework_and_no_bid_list (
    mdc text,
    contracting text,
    ctr_branch text,
    pi_number text,
    amd_nbr integer,
    niin text,
    rqmt_qy integer,
    unit_cost text,
    total_pr_value text,
    rqmt_type_cd text,
    amc text,
    rmc text,
    cage text,
    part_number text,
    ro_office text,
    date_in_rework text,
    days_in_rework integer,
    erc text,
    root_cause_for_no_bid text,
    saspo_assistance text,
    eom text,
    id integer NOT NULL
);


ALTER TABLE afsc448_onesnapshot.external_rework_and_no_bid_list OWNER TO postgres;

--
-- Name: external_rework_and_no_bid_list_id_seq; Type: SEQUENCE; Schema: afsc448_onesnapshot; Owner: postgres
--

CREATE SEQUENCE afsc448_onesnapshot.external_rework_and_no_bid_list_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE afsc448_onesnapshot.external_rework_and_no_bid_list_id_seq OWNER TO postgres;

--
-- Name: external_rework_and_no_bid_list_id_seq; Type: SEQUENCE OWNED BY; Schema: afsc448_onesnapshot; Owner: postgres
--

ALTER SEQUENCE afsc448_onesnapshot.external_rework_and_no_bid_list_id_seq OWNED BY afsc448_onesnapshot.external_rework_and_no_bid_list.id;


--
-- Name: field_bo; Type: TABLE; Schema: afsc448_onesnapshot; Owner: postgres
--

CREATE TABLE afsc448_onesnapshot.field_bo (
    data_month timestamp without time zone,
    sos character varying(5),
    sran bigint,
    base_backorder_flag boolean,
    sos_sgm character varying(3),
    pseudo_division character varying(19),
    inv_mgt_specialist character varying(21),
    budget_code character varying(1),
    nimsc character varying(1),
    ws_type character varying(1),
    ws_group character varying(15),
    ws_design character varying(15),
    equipment_designator character varying(15),
    srd character varying(3),
    nsn character varying(15),
    errc_code character varying(10),
    cwt_10_day_rule_flag character varying(3),
    cwt_partial_flag boolean,
    pipeline_document_number character varying(14),
    customer_request_document_number character varying(14),
    requisition_document_number character varying(14),
    activity_code character varying(1),
    maj_com character varying(3),
    customer_order_date timestamp without time zone,
    requisition_date timestamp without time zone,
    sep10_age text,
    aug10_age text,
    jul10_age text,
    jun10_age text,
    may10_age text,
    apr10_age text,
    mar10_age text,
    feb10_age text,
    jan10_age text,
    dec09_age text,
    nov09_age text,
    oct09_age text,
    cwt_status character varying(4),
    issue_priority_group bigint,
    issue_priority___ujc character varying(2),
    requisition_priority_code character varying(6),
    project_code character varying(3),
    alc text,
    rcc text,
    base_name character varying(39),
    ordered_qty numeric(10,2),
    "To_Date_100%_CWT_Days" numeric(11,2),
    to_date_weighted_avg_cwt_days numeric(10,2)
);


ALTER TABLE afsc448_onesnapshot.field_bo OWNER TO postgres;

--
-- Name: field_bo_time; Type: TABLE; Schema: afsc448_onesnapshot; Owner: postgres
--

CREATE TABLE afsc448_onesnapshot.field_bo_time (
    data_month timestamp with time zone,
    sos character varying(5),
    sran bigint,
    base_backorder_flag boolean,
    sos_sgm character varying(3),
    pseudo_division character varying(19),
    inv_mgt_specialist character varying(21),
    budget_code character varying(1),
    nimsc character varying(1),
    ws_type character varying(1),
    ws_group character varying(15),
    ws_design character varying(15),
    equipment_designator character varying(15),
    srd character varying(3),
    nsn character varying(15),
    errc_code character varying(10),
    base_name character varying(39),
    cwt_10_day_rule_flag character varying(3),
    cwt_partial_flag boolean,
    pipeline_document_number character varying(14),
    customer_request_document_number character varying(14),
    requisition_document_number character varying(14),
    ordered_qty numeric(10,2),
    activity_code character varying(1),
    maj_com character varying(3),
    customer_order_date timestamp with time zone,
    requisition_date timestamp with time zone,
    "To_Date_100%_CWT_Days" numeric(11,2),
    sep10_age text,
    aug10_age text,
    jul10_age text,
    jun10_age text,
    may10_age text,
    apr10_age text,
    mar10_age text,
    feb10_age text,
    jan10_age text,
    dec09_age text,
    nov09_age text,
    oct09_age text,
    to_date_weighted_avg_cwt_days numeric(10,2),
    cwt_status character varying(4),
    issue_priority_group bigint,
    issue_priority___ujc character varying(2),
    requisition_priority_code character varying(6),
    project_code character varying(3),
    alc text,
    rcc text
);


ALTER TABLE afsc448_onesnapshot.field_bo_time OWNER TO postgres;

--
-- Name: filtered_bo; Type: TABLE; Schema: afsc448_onesnapshot; Owner: postgres
--

CREATE TABLE afsc448_onesnapshot.filtered_bo (
    field1 bigint,
    pdn character varying(6),
    nsn_caller bigint,
    niin bigint,
    mmac character varying(2),
    errc character varying(1),
    rfm_noun character varying(56),
    sos_caller character varying(3),
    im character varying(3),
    es character varying(2),
    aac character varying(1),
    cc character varying(1),
    ui character varying(2),
    cost numeric(11,2),
    opcode character varying(5),
    qpa bigint,
    f bigint,
    tinkerassets bigint,
    mm bigint,
    dlaassets bigint,
    mkshr numeric(8,3),
    issueseight bigint,
    stklevel bigint,
    speclevel bigint,
    duein bigint,
    dueout bigint,
    smartmdr numeric(9,1),
    pr bigint,
    contract bigint,
    overdue bigint,
    pn character varying(23),
    plt bigint,
    alt bigint,
    psc character varying(4),
    saic bigint,
    masternsn bigint,
    master_niin bigint,
    shopid bigint,
    model_desc character varying(4),
    module_desc character varying(18),
    series_desc character varying(37),
    data_month timestamp with time zone,
    sos_other character varying(5),
    sran bigint,
    base_backorder_flag boolean,
    sos_sgm character varying(3),
    pseudo_division character varying(17),
    inv_mgt_specialist character varying(19),
    budget_code character varying(1),
    nimsc character varying(1),
    ws_type character varying(1),
    ws_group character varying(15),
    ws_design character varying(15),
    equipment_designator character varying(12),
    srd character varying(3),
    nsn_other character varying(15),
    errc_code character varying(10),
    cwt_10_day_rule_flag character varying(3),
    cwt_partial_flag boolean,
    pipeline_document_number character varying(14),
    customer_request_document_number character varying(14),
    requisition_document_number character varying(14),
    activity_code character varying(1),
    maj_com character varying(3),
    customer_order_date timestamp with time zone,
    requisition_date timestamp with time zone,
    sep10_age text,
    aug10_age text,
    jul10_age text,
    jun10_age text,
    may10_age text,
    apr10_age text,
    mar10_age text,
    feb10_age text,
    jan10_age text,
    dec09_age text,
    nov09_age text,
    oct09_age text,
    cwt_status character varying(4),
    issue_priority_group bigint,
    issue_priority___ujc character varying(2),
    requisition_priority_code character varying(6),
    project_code character varying(3),
    alc text,
    rcc text,
    base_name character varying(30),
    ordered_qty numeric(6,1),
    "To_Date_100%_CWT_Days" numeric(7,1),
    to_date_weighted_avg_cwt_days numeric(8,1)
);


ALTER TABLE afsc448_onesnapshot.filtered_bo OWNER TO postgres;

--
-- Name: filtered_bo_depot; Type: TABLE; Schema: afsc448_onesnapshot; Owner: postgres
--

CREATE TABLE afsc448_onesnapshot.filtered_bo_depot (
    field1 bigint,
    pdn character varying(6),
    nsn_caller bigint,
    niin character varying(15),
    mmac character varying(2),
    errc_caller character varying(1),
    rfm_noun character varying(60),
    sos character varying(3),
    im character varying(3),
    es character varying(2),
    aac_caller character varying(1),
    cc character varying(1),
    ui_caller character varying(2),
    opcode character varying(5),
    qpa bigint,
    f bigint,
    tinkerassets bigint,
    mm bigint,
    dlaassets bigint,
    issueseight bigint,
    stklevel bigint,
    speclevel bigint,
    duein bigint,
    dueout bigint,
    pr bigint,
    contract bigint,
    overdue bigint,
    pn character varying(25),
    plt bigint,
    alt bigint,
    psc character varying(4),
    saic bigint,
    masternsn bigint,
    master_niin bigint,
    shopid bigint,
    model_desc character varying(4),
    module_desc character varying(18),
    series_desc character varying(38),
    alc character varying(2),
    di_code character varying(3),
    nsn_other character varying(15),
    doc_nr character varying(14),
    qty bigint,
    priority_cd bigint,
    micap_ind character varying(1),
    aac_other character varying(1),
    errc_other character varying(1),
    budget_cd character varying(1),
    critical_item boolean,
    ui_other character varying(2),
    noun character varying(29),
    procurement_src_cd character varying(1),
    retail_sos character varying(3),
    item_sos character varying(3),
    insp_data_cd character varying(3),
    extract_time timestamp without time zone,
    data_date timestamp without time zone,
    cost numeric(11,2),
    mkshr numeric(9,3),
    smartmdr numeric(9,1),
    unit_price numeric(11,2)
);


ALTER TABLE afsc448_onesnapshot.filtered_bo_depot OWNER TO postgres;

--
-- Name: filtered_bo_depot_date; Type: TABLE; Schema: afsc448_onesnapshot; Owner: postgres
--

CREATE TABLE afsc448_onesnapshot.filtered_bo_depot_date (
    field1 bigint,
    pdn character varying(6),
    nsn_caller bigint,
    niin character varying(15),
    mmac character varying(2),
    errc_caller character varying(1),
    rfm_noun character varying(60),
    sos character varying(3),
    im character varying(3),
    es character varying(2),
    aac_caller character varying(1),
    cc character varying(1),
    ui_caller character varying(2),
    cost numeric(11,2),
    opcode character varying(5),
    qpa bigint,
    f bigint,
    tinkerassets bigint,
    mm bigint,
    dlaassets bigint,
    mkshr numeric(9,3),
    issueseight bigint,
    stklevel bigint,
    speclevel bigint,
    duein bigint,
    dueout bigint,
    smartmdr numeric(9,1),
    pr bigint,
    contract bigint,
    overdue bigint,
    pn character varying(25),
    plt bigint,
    alt bigint,
    psc character varying(4),
    saic bigint,
    masternsn bigint,
    master_niin bigint,
    shopid bigint,
    model_desc character varying(4),
    module_desc character varying(18),
    series_desc character varying(38),
    alc character varying(2),
    di_code character varying(3),
    nsn_other character varying(15),
    doc_nr character varying(14),
    qty bigint,
    priority_cd bigint,
    micap_ind character varying(1),
    aac_other character varying(1),
    errc_other character varying(1),
    budget_cd character varying(1),
    critical_item boolean,
    ui_other character varying(2),
    noun character varying(29),
    procurement_src_cd character varying(1),
    retail_sos character varying(3),
    item_sos character varying(3),
    insp_data_cd character varying(3),
    unit_price numeric(11,2),
    data_date date,
    extract_time timestamp without time zone
);


ALTER TABLE afsc448_onesnapshot.filtered_bo_depot_date OWNER TO postgres;

--
-- Name: filtered_bo_depot_notz; Type: TABLE; Schema: afsc448_onesnapshot; Owner: postgres
--

CREATE TABLE afsc448_onesnapshot.filtered_bo_depot_notz (
    field1 bigint,
    pdn character varying(6),
    nsn_caller bigint,
    niin character varying(15),
    mmac character varying(2),
    errc_caller character varying(1),
    rfm_noun character varying(60),
    sos character varying(3),
    im character varying(3),
    es character varying(2),
    aac_caller character varying(1),
    cc character varying(1),
    ui_caller character varying(2),
    cost numeric(11,2),
    opcode character varying(5),
    qpa bigint,
    f bigint,
    tinkerassets bigint,
    mm bigint,
    dlaassets bigint,
    mkshr numeric(9,3),
    issueseight bigint,
    stklevel bigint,
    speclevel bigint,
    duein bigint,
    dueout bigint,
    smartmdr numeric(9,1),
    pr bigint,
    contract bigint,
    overdue bigint,
    pn character varying(25),
    plt bigint,
    alt bigint,
    psc character varying(4),
    saic bigint,
    masternsn bigint,
    master_niin bigint,
    shopid bigint,
    model_desc character varying(4),
    module_desc character varying(18),
    series_desc character varying(38),
    alc character varying(2),
    di_code character varying(3),
    nsn_other character varying(15),
    doc_nr character varying(14),
    qty bigint,
    priority_cd bigint,
    micap_ind character varying(1),
    aac_other character varying(1),
    errc_other character varying(1),
    budget_cd character varying(1),
    critical_item boolean,
    ui_other character varying(2),
    noun character varying(29),
    procurement_src_cd character varying(1),
    retail_sos character varying(3),
    item_sos character varying(3),
    insp_data_cd character varying(3),
    unit_price numeric(11,2),
    data_date timestamp without time zone,
    extract_time timestamp without time zone
);


ALTER TABLE afsc448_onesnapshot.filtered_bo_depot_notz OWNER TO postgres;

--
-- Name: g004l_data; Type: TABLE; Schema: afsc448_onesnapshot; Owner: postgres
--

CREATE TABLE afsc448_onesnapshot.g004l_data (
    actual_niin bigint,
    time_stamp character varying(28),
    date timestamp without time zone,
    fsc character varying(4),
    mc character varying(210),
    ei_config_cd bigint,
    errc_cd character varying(11),
    nomenclature character varying(8),
    planning_tech character varying(6),
    wrkldr_tech character varying(5),
    pssd character varying(6),
    control_num bigint,
    job_designator character varying(10),
    job_suffix character varying(3),
    data_proces_cd character varying(10),
    im_clerk character varying(20),
    procurement_src character varying(10),
    program_control_num character varying(6),
    proj_order_num bigint,
    fcrn_future character varying(4),
    fcrn character varying(4),
    priority_cd character varying(20),
    jon_class character varying(10),
    jon_class_future character varying(10),
    min_trans_auth character varying(10),
    jon_class_spprt character varying(10),
    prod_cnt character varying(10),
    prod_cnt_future character varying(10),
    cost_class bigint,
    jon_status bigint,
    prod_delay_cd character varying(10),
    dt_established bigint,
    dt_last_action bigint,
    del_code character varying(10),
    unit_of_meas character varying(20),
    serial_num character varying(6),
    mon_sales_cd character varying(10),
    dt_induction character varying(7),
    dt_completion character varying(7),
    ei_sales_price bigint,
    ei_labor_rate numeric(8,1),
    hr_sales_rate numeric(4,1),
    dpeh_qty numeric(31,1),
    earned_hrs_qty numeric(31,1),
    fiscal_yr_cd bigint,
    yr_ord_qty bigint,
    yr_ord_qty_future bigint,
    remaining_ord_qty bigint,
    awm_qty bigint,
    awm_qty_sup_gen bigint,
    awm_qty_non_sup_gen bigint,
    awp_qty bigint,
    awp_qty_sup_gen bigint,
    awp_qty_non_sup_gen bigint,
    jon_induct_qty bigint,
    jon_induct_qty_sup_gen bigint,
    jon_induct_qty_non_sup_gen bigint,
    jon_comp_qty bigint,
    jon_comp_qty_sup_gen bigint,
    jon_comp_qty_non_sup_gen bigint,
    jon_owo_qty_sup_gen bigint,
    jon_owo_qty_non_sup_gen bigint,
    induct_qty_sup_gen bigint,
    induct_qty_non_sup_gen bigint,
    serv_comp_qty_sup_gen bigint,
    serv_comp_qty_non_sup_gen bigint,
    induct_qty_sup_gen_mon bigint,
    induct_qty_non_sup_gen_mon bigint,
    serv_comp_qty_sup_gen_mon bigint,
    serv_comp_qty_non_sup_gen_mon bigint,
    induct_qty_sup_gen_qtr bigint,
    induct_qty_non_sup_gen_qtr bigint,
    serv_comp_qty_sup_gen_qtr bigint,
    serv_comp_qty_non_sup_gen_qtr bigint,
    condemn_qty bigint,
    rep_gen_qty bigint,
    condemn_qty_sup_gen bigint,
    condemn_qty_non_sup_gen bigint,
    unserv_ltd_restore_qty bigint,
    unserv_incomplete_qty bigint,
    unserv_condemned_qty bigint,
    unserv_complete_qty bigint,
    jon_indicator character varying(10),
    alc_code character varying(20)
);


ALTER TABLE afsc448_onesnapshot.g004l_data OWNER TO postgres;

--
-- Name: gcss_bobj_d043_niins; Type: TABLE; Schema: afsc448_onesnapshot; Owner: postgres
--

CREATE TABLE afsc448_onesnapshot.gcss_bobj_d043_niins (
    nsn text,
    fsc integer,
    niin text,
    mmac text,
    nomenclature text,
    niin_sgm integer,
    niin_family_master integer,
    errc text,
    aac text,
    acq_method_code integer,
    acq_method_suffix_code text,
    sos text,
    im_office_symbol text,
    budget_code text,
    div_manager_designator_code text,
    mdc_code text,
    im_name text,
    equipment_specialist_code text,
    standard_price numeric,
    lac text,
    order_of_use_code text,
    "group" text,
    squadron text,
    application_data_desc text,
    id integer NOT NULL
);


ALTER TABLE afsc448_onesnapshot.gcss_bobj_d043_niins OWNER TO postgres;

--
-- Name: gcss_bobj_d043_niins_id_seq; Type: SEQUENCE; Schema: afsc448_onesnapshot; Owner: postgres
--

CREATE SEQUENCE afsc448_onesnapshot.gcss_bobj_d043_niins_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE afsc448_onesnapshot.gcss_bobj_d043_niins_id_seq OWNER TO postgres;

--
-- Name: gcss_bobj_d043_niins_id_seq; Type: SEQUENCE OWNED BY; Schema: afsc448_onesnapshot; Owner: postgres
--

ALTER SEQUENCE afsc448_onesnapshot.gcss_bobj_d043_niins_id_seq OWNED BY afsc448_onesnapshot.gcss_bobj_d043_niins.id;


--
-- Name: hq_bill_of_materials; Type: TABLE; Schema: afsc448_onesnapshot; Owner: postgres
--

CREATE TABLE afsc448_onesnapshot.hq_bill_of_materials (
    niin_id bigint,
    actual_niin bigint,
    comp_niin character varying(9),
    comp_fsc bigint,
    comp_mmc character varying(2),
    alc_location character varying(2),
    pdn character varying(6),
    planner character varying(6),
    mgr_code character varying(2),
    bud_code character varying(1),
    unit_of_issue character varying(2),
    cust_code character varying(1),
    errc character varying(1),
    smc character varying(4),
    unit_cost numeric(11,2),
    occ_fac bigint,
    qpa bigint,
    std_rpl bigint,
    act_rpl bigint,
    curr_prod bigint,
    qtr1_prod bigint,
    qtr2_prod bigint,
    qtr3_prod bigint,
    qtr4_prod bigint,
    qtr5_prod bigint,
    qtr6_prod bigint,
    qtr7_prod bigint,
    curr_issue bigint,
    qtr1_issue bigint,
    qtr2_issue bigint,
    qtr3_issue bigint,
    qtr4_issue bigint,
    qtr5_issue bigint,
    qtr6_issue bigint,
    qtr7_issue bigint,
    include_component_switch bigint,
    time_stamp character varying(28),
    date timestamp without time zone
);


ALTER TABLE afsc448_onesnapshot.hq_bill_of_materials OWNER TO postgres;

--
-- Name: hq_depot_name; Type: TABLE; Schema: afsc448_onesnapshot; Owner: postgres
--

CREATE TABLE afsc448_onesnapshot.hq_depot_name (
    alc_location character varying(2),
    sos_alc character varying(2),
    sran character varying(6),
    alc_name character varying(24),
    router_id character varying(3),
    sos_checkbook numeric(14,2),
    sos_remain_days bigint,
    funding_k_factor numeric(6,2),
    percent_avail numeric(6,2),
    cum_avail numeric(12,2),
    fund_appl_sw bigint,
    h103_date bigint,
    h103_time bigint,
    time_stamp character varying(28),
    date timestamp without time zone
);


ALTER TABLE afsc448_onesnapshot.hq_depot_name OWNER TO postgres;

--
-- Name: hq_spt_results; Type: TABLE; Schema: afsc448_onesnapshot; Owner: postgres
--

CREATE TABLE afsc448_onesnapshot.hq_spt_results (
    execution_date character varying(28),
    niin_id bigint,
    row_index bigint,
    sran character varying(6),
    sgm_nsn character varying(15),
    item_manager_code character varying(3),
    noun character varying(10),
    pdn character varying(6),
    repair_res_code character varying(8),
    carc_avail character varying(11),
    parts_avail character varying(11),
    hours_avail character varying(11),
    funds_avail character varying(11),
    sort_value character varying(21),
    spaws_rank bigint,
    ws_category character varying(12),
    sprs_seq bigint,
    item_count bigint,
    buffer_hours_avail character varying(11),
    sos_alc character varying(2),
    sor_alc character varying(2),
    original_compout_nsn character varying(15),
    supply_chain_manager character varying(4),
    actual_nsn character varying(15),
    date timestamp without time zone,
    prob_repair character varying(150),
    pap numeric(10,4),
    repair_cost numeric(11,2),
    repair_hours numeric(8,2),
    sprt_ind numeric(4,1),
    slimm_pap numeric(6,2)
);


ALTER TABLE afsc448_onesnapshot.hq_spt_results OWNER TO postgres;

--
-- Name: indenture; Type: TABLE; Schema: afsc448_onesnapshot; Owner: postgres
--

CREATE TABLE afsc448_onesnapshot.indenture (
    niin_id bigint,
    niin_id_sru bigint,
    qpa bigint,
    common_sru_sw bigint,
    minimum_qpa bigint,
    depot_repl_frac bigint,
    cirf_repl_frac bigint,
    base_repl_frac bigint,
    time_stamp character varying(28),
    date timestamp without time zone
);


ALTER TABLE afsc448_onesnapshot.indenture OWNER TO postgres;

--
-- Name: low_percent_ws; Type: TABLE; Schema: afsc448_onesnapshot; Owner: postgres
--

CREATE TABLE afsc448_onesnapshot.low_percent_ws (
    ws_category character varying(12),
    sor_sos_total_cost numeric(12,3),
    target_ws_percent character varying(12),
    sor_total_cost numeric(12,3),
    time_stamp character varying(28),
    date timestamp without time zone
);


ALTER TABLE afsc448_onesnapshot.low_percent_ws OWNER TO postgres;

--
-- Name: new_buys; Type: TABLE; Schema: afsc448_onesnapshot; Owner: postgres
--

CREATE TABLE afsc448_onesnapshot.new_buys (
    niin_id bigint,
    date_due_in character varying(28),
    balance_due_in bigint,
    time_stamp character varying(28),
    date timestamp without time zone
);


ALTER TABLE afsc448_onesnapshot.new_buys OWNER TO postgres;

--
-- Name: niin_percent; Type: TABLE; Schema: afsc448_onesnapshot; Owner: postgres
--

CREATE TABLE afsc448_onesnapshot.niin_percent (
    niin_id bigint,
    sran character varying(6),
    ws_category character varying(12),
    ws_index bigint,
    peace_flying_hours numeric(4,1),
    niin_sran_percent numeric(12,5),
    niin_ws_percent character varying(7),
    time_stamp character varying(28),
    date timestamp without time zone
);


ALTER TABLE afsc448_onesnapshot.niin_percent OWNER TO postgres;

--
-- Name: nsn_niin_id_xref; Type: TABLE; Schema: afsc448_onesnapshot; Owner: postgres
--

CREATE TABLE afsc448_onesnapshot.nsn_niin_id_xref (
    nsn character varying(15),
    niin_id bigint,
    least_preferred_nsn character varying(15),
    time_stamp character varying(28),
    date timestamp without time zone
);


ALTER TABLE afsc448_onesnapshot.nsn_niin_id_xref OWNER TO postgres;

--
-- Name: part_base; Type: TABLE; Schema: afsc448_onesnapshot; Owner: postgres
--

CREATE TABLE afsc448_onesnapshot.part_base (
    niin_id bigint NOT NULL,
    pctm_proc_percent bigint,
    base_cndnm_pct bigint,
    pos_serviceable bigint,
    wrm_serviceable bigint,
    wrm_authorized bigint,
    base_svc_intran bigint,
    base_difm bigint,
    micap bigint,
    non_paa bigint,
    pos_level bigint,
    holes bigint,
    hpmsk_stock bigint,
    hpmsk_level bigint,
    project_level bigint,
    base_due_outs bigint,
    tot_inaccess_asset_bal_qty bigint,
    lim_inaccess_asset_bal_qty bigint,
    inaccess_maint_asset_bal_qty bigint,
    difm_awp_bal_qty bigint,
    base_req_objective bigint,
    process_switch character varying(10),
    sran_type_ind character varying(10),
    total_fsl_ro bigint,
    total_fsl_assets bigint,
    total_fsl_intransit bigint,
    total_oh bigint,
    ro_need bigint,
    base_need bigint,
    total_ro bigint,
    base_rpr_cyc_time bigint,
    suspended_qty bigint,
    quality_deficit_qty bigint,
    unserv_bal_qty bigint,
    unserv_tech_bal_qty bigint,
    time_stamp character varying(28),
    date timestamp without time zone,
    sran character varying(26) NOT NULL,
    pctm_dmnd_rate character varying(26),
    daily_demand_rate character varying(26),
    pct_base_repair numeric(6,2),
    computed_nrts numeric(4,1),
    computed_nonpaa numeric(4,1)
);


ALTER TABLE afsc448_onesnapshot.part_base OWNER TO postgres;

--
-- Name: part_depot; Type: TABLE; Schema: afsc448_onesnapshot; Owner: postgres
--

CREATE TABLE afsc448_onesnapshot.part_depot (
    niin_id bigint,
    sor_alc character varying(2),
    msor_ind bigint,
    stock_0a bigint,
    svc_due_in bigint,
    cndmn_pct bigint,
    carc_on_hand bigint,
    g_condition bigint,
    y_condition bigint,
    z_condition bigint,
    dmsc bigint,
    njr_repl bigint,
    jr_repl bigint,
    owo_inducted bigint,
    awm_inducted bigint,
    unsvc_due_in bigint,
    repair_res_code character varying(8),
    working_level bigint,
    w_level bigint,
    wl_adj bigint,
    plan_wl_adj bigint,
    bv_qty bigint,
    funded_unproduced bigint,
    shop_flow_expct_nrts character varying(12),
    scp_owo_inducted bigint,
    scp_awm_inducted bigint,
    additional_owo bigint,
    awp_g_count bigint,
    depot_difm bigint,
    informal_awp bigint,
    time_stamp character varying(28),
    date timestamp without time zone,
    repair_cost numeric(14,5),
    repair_hours numeric(8,2)
);


ALTER TABLE afsc448_onesnapshot.part_depot OWNER TO postgres;

--
-- Name: part_depot_actual_assets; Type: TABLE; Schema: afsc448_onesnapshot; Owner: postgres
--

CREATE TABLE afsc448_onesnapshot.part_depot_actual_assets (
    niin_id bigint,
    location character varying(3),
    serv_assets bigint,
    intransit_reparables bigint,
    f_condition bigint,
    awp_f_condition_m_balance bigint,
    e_condition bigint,
    g_condition bigint,
    k_condition bigint,
    j_condition bigint,
    p_condition bigint,
    q_condition bigint,
    r_condition bigint,
    actual_niin bigint,
    time_stamp character varying(28),
    date timestamp without time zone
);


ALTER TABLE afsc448_onesnapshot.part_depot_actual_assets OWNER TO postgres;

--
-- Name: part_depot_assets; Type: TABLE; Schema: afsc448_onesnapshot; Owner: postgres
--

CREATE TABLE afsc448_onesnapshot.part_depot_assets (
    niin_id bigint,
    location character varying(3),
    serv_assets bigint,
    intransit_reparables bigint,
    f_condition bigint,
    awp_f_condition_m_balance bigint,
    e_condition bigint,
    g_condition bigint,
    k_condition bigint,
    j_condition bigint,
    p_condition bigint,
    q_condition bigint,
    r_condition bigint,
    time_stamp character varying(28),
    date timestamp without time zone
);


ALTER TABLE afsc448_onesnapshot.part_depot_assets OWNER TO postgres;

--
-- Name: part_description; Type: TABLE; Schema: afsc448_onesnapshot; Owner: postgres
--

CREATE TABLE afsc448_onesnapshot.part_description (
    niin_id bigint,
    fsc bigint,
    niin bigint,
    mmc character varying(21),
    noun character varying(10),
    part_number character varying(15),
    shop_control_num character varying(6),
    item_manager_code character varying(3),
    equip_spec_code character varying(2),
    pm_spec_code character varying(3),
    pctm_mm_div character varying(10),
    wrtm_mm_div character varying(10),
    failed_sru_policy character varying(10),
    wuc character varying(6),
    depot_cyc_time bigint,
    depot_rpr_limit bigint,
    dmnd_rt_multi bigint,
    prepos_flag bigint,
    pap numeric(10,4),
    slimm_pap numeric(6,2),
    spt_max_buffer bigint,
    pap_default_switch bigint,
    spt_k_factor numeric(8,3),
    k_default_switch bigint,
    jon_default_ind character varying(10),
    spt_switches bigint,
    organic_pct_sw bigint,
    fcrn character varying(4),
    fcrn_future character varying(4),
    program_control_num character varying(6),
    ww_fill_rate_target numeric(4,1),
    time_stamp character varying(28),
    date timestamp without time zone
);


ALTER TABLE afsc448_onesnapshot.part_description OWNER TO postgres;

--
-- Name: part_mds; Type: TABLE; Schema: afsc448_onesnapshot; Owner: postgres
--

CREATE TABLE afsc448_onesnapshot.part_mds (
    niin_id bigint,
    sran character varying(6),
    organization character varying(9),
    mds character varying(7),
    qpa bigint,
    app_fraction bigint,
    block bigint,
    minimum_qty_qpa bigint,
    time_stamp character varying(28),
    date timestamp without time zone
);


ALTER TABLE afsc448_onesnapshot.part_mds OWNER TO postgres;

--
-- Name: part_model; Type: TABLE; Schema: afsc448_onesnapshot; Owner: postgres
--

CREATE TABLE afsc448_onesnapshot.part_model (
    niin_id bigint,
    non_aircft_ind bigint,
    other_non_paa_demands bigint,
    fms_demands bigint,
    njr_depot_demands bigint,
    jr_cndnm_demands bigint,
    owrm_demands bigint,
    ilm_flag bigint,
    lru_sru_ind character varying(1),
    program_sel_code character varying(4),
    common_sru_sw bigint,
    sos_alc character varying(21),
    order_ship_time bigint,
    depot_rpr_flow_days bigint,
    d041_svc_assets bigint,
    base_rpr_cyce_time bigint,
    depot_daily_demands numeric(4,1),
    depot_rep_gens bigint,
    d041_num_users bigint,
    mistr_qtr_1 bigint,
    mistr_qtr_2 bigint,
    mistr_qtr_3 bigint,
    mistr_qtr_4 bigint,
    prior_model_ind bigint,
    repair_dist_ind bigint,
    gfm_sw character varying(11),
    organic_pct bigint,
    organic_pct_flag bigint,
    computed_nrts numeric(4,1),
    expected_needs bigint,
    last_expected_needs bigint,
    time_stamp character varying(28),
    date timestamp without time zone
);


ALTER TABLE afsc448_onesnapshot.part_model OWNER TO postgres;

--
-- Name: repair_resource; Type: TABLE; Schema: afsc448_onesnapshot; Owner: postgres
--

CREATE TABLE afsc448_onesnapshot.repair_resource (
    sor_alc character varying(2),
    repair_res_code character varying(8),
    shop_code character varying(7),
    division character varying(4),
    quarterly_hours bigint,
    quarterly_dollars bigint,
    prior_model_ind bigint,
    spt_include_awp bigint,
    spt_add_micap bigint,
    spt_slimm_ind bigint,
    spt_ship_location character varying(6),
    hours numeric(9,1),
    dollars numeric(10,1),
    cum_hours numeric(11,2),
    cum_dollars numeric(18,7),
    spt_buffer bigint,
    spt_max_buffer bigint,
    spt_buffer_hours numeric(8,1),
    pap numeric(6,2),
    slimm_pap numeric(6,2),
    capping_switch character varying(1),
    spt_max_item_switch bigint,
    spt_k_factor numeric(6,2),
    shop_clock numeric(6,2),
    spt_switches bigint,
    shop_execution_cycle character varying(1),
    shop_execution_day bigint,
    last_execution_date character varying(28),
    next_execution_date character varying(28),
    organic_pct_sw bigint,
    time_stamp character varying(28),
    date timestamp without time zone
);


ALTER TABLE afsc448_onesnapshot.repair_resource OWNER TO postgres;

--
-- Name: report_a; Type: TABLE; Schema: afsc448_onesnapshot; Owner: postgres
--

CREATE TABLE afsc448_onesnapshot.report_a (
    niin_id bigint,
    location character varying(3),
    wholesale_serv numeric,
    intransit numeric,
    f_cond numeric,
    awp_f numeric,
    sumofk_condition numeric,
    sumofr_condition numeric
);


ALTER TABLE afsc448_onesnapshot.report_a OWNER TO postgres;

--
-- Name: report_b; Type: TABLE; Schema: afsc448_onesnapshot; Owner: postgres
--

CREATE TABLE afsc448_onesnapshot.report_b (
    niin_id bigint,
    carc numeric,
    y_cond numeric,
    awm numeric,
    owo numeric,
    z_cond numeric,
    repair_cost numeric,
    maxofshop_flow_expct_nrts text
);


ALTER TABLE afsc448_onesnapshot.report_b OWNER TO postgres;

--
-- Name: report_c; Type: TABLE; Schema: afsc448_onesnapshot; Owner: postgres
--

CREATE TABLE afsc448_onesnapshot.report_c (
    niin_id bigint,
    nsn character varying(15),
    sumofbase_due_outs numeric,
    sumofpos_level numeric,
    sumofwrm_authorized numeric,
    sumofhpmsk_level numeric,
    sumofpos_serviceable numeric,
    sumofwrm_serviceable numeric,
    sumofbase_difm numeric,
    sumofbase_svc_intran numeric
);


ALTER TABLE afsc448_onesnapshot.report_c OWNER TO postgres;

--
-- Name: report_d; Type: TABLE; Schema: afsc448_onesnapshot; Owner: postgres
--

CREATE TABLE afsc448_onesnapshot.report_d (
    niin_id bigint,
    nsn character varying(15),
    ro numeric,
    oh numeric,
    sumofbase_due_outs numeric,
    sumofpos_level numeric,
    sumofbdopos numeric,
    sumofwrm_authorized numeric,
    sumofhpmsk_level numeric,
    sumofpos_serviceable numeric,
    sumofwrm_serviceable numeric,
    sumofbase_difm numeric,
    sumofbase_svc_intran numeric
);


ALTER TABLE afsc448_onesnapshot.report_d OWNER TO postgres;

--
-- Name: requisition; Type: TABLE; Schema: afsc448_onesnapshot; Owner: postgres
--

CREATE TABLE afsc448_onesnapshot.requisition (
    niin_id bigint,
    sran character varying(6),
    document_num character varying(15),
    priority_code character varying(3),
    document_date bigint,
    actual_niin bigint,
    preposition_code character varying(1),
    document_id character varying(3),
    supp_address character varying(6),
    signal_code character varying(1),
    project_code character varying(3),
    rdd character varying(3),
    quantity bigint,
    sprs_seq bigint,
    advice_code character varying(2),
    action_code character varying(2),
    time_stamp character varying(28),
    date timestamp without time zone
);


ALTER TABLE afsc448_onesnapshot.requisition OWNER TO postgres;

--
-- Name: scs_carcass_constraint; Type: TABLE; Schema: afsc448_onesnapshot; Owner: postgres
--

CREATE TABLE afsc448_onesnapshot.scs_carcass_constraint (
    actual_nsn character varying(15),
    sor_dodaac character varying(6),
    carcass_constraint_qty bigint,
    repair_node character varying(8),
    crf_flag boolean,
    express_item_flag boolean,
    high_priority_flag boolean,
    contract_number character varying(13),
    delivery_order_num character varying(4),
    clin character varying(6),
    clin_qty bigint,
    time_stamp character varying(28),
    date timestamp without time zone
);


ALTER TABLE afsc448_onesnapshot.scs_carcass_constraint OWNER TO postgres;

--
-- Name: spt_results; Type: TABLE; Schema: afsc448_onesnapshot; Owner: postgres
--

CREATE TABLE afsc448_onesnapshot.spt_results (
    niin_id bigint,
    row_index bigint,
    sran character varying(6),
    pdn character varying(6),
    prob_repair numeric(4,1),
    repair_res_code character varying(8),
    pap numeric(10,4),
    carc_avail character varying(1),
    parts_avail character varying(1),
    hours_avail character varying(1),
    funds_avail character varying(1),
    repair_cost numeric(11,2),
    repair_hours numeric(8,2),
    sort_value character varying(21),
    spaws_rank bigint,
    sprt_ind numeric(4,1),
    ws_index bigint,
    sprs_seq bigint,
    item_count bigint,
    buffer_hours_avail character varying(1),
    slimm_pap numeric(6,2),
    sos_alc character varying(2),
    original_compout_nsn character varying(15),
    actual_nsn character varying(15),
    date timestamp without time zone
);


ALTER TABLE afsc448_onesnapshot.spt_results OWNER TO postgres;

--
-- Name: tf33bom; Type: TABLE; Schema: afsc448_onesnapshot; Owner: postgres
--

CREATE TABLE afsc448_onesnapshot.tf33bom (
    pdn character varying(6) NOT NULL,
    nsn bigint NOT NULL,
    niin bigint NOT NULL,
    mmac character varying(2),
    errc character varying(1),
    rfm_noun character varying(60),
    sos character varying(3),
    im character varying(3),
    es character varying(2),
    aac character varying(1),
    cc character varying(1),
    ui character varying(2),
    cost numeric(11,2),
    opcode character varying(5),
    qpa bigint,
    f bigint,
    tinkerassets bigint,
    mm bigint,
    dlaassets bigint,
    mkshr numeric(9,3),
    issueseight bigint,
    stklevel bigint,
    speclevel bigint,
    duein bigint,
    dueout bigint,
    smartmdr numeric(9,1),
    pr bigint,
    contract bigint,
    overdue bigint,
    pn character varying(27),
    plt bigint,
    alt bigint,
    psc character varying(4),
    saic bigint,
    masternsn bigint,
    master_niin bigint,
    shopid bigint,
    model_desc character varying(4),
    module_desc character varying(18),
    series_desc character varying(38)
);


ALTER TABLE afsc448_onesnapshot.tf33bom OWNER TO postgres;

--
-- Name: xpress; Type: TABLE; Schema: afsc448_onesnapshot; Owner: postgres
--

CREATE TABLE afsc448_onesnapshot.xpress (
    niin_id bigint,
    nsn character varying(15),
    repair_res_code character varying(9),
    ship_address character varying(6),
    qty bigint,
    spt_qty bigint,
    original_spt_qty bigint,
    control_num character varying(5),
    op_num bigint,
    action_suffix bigint,
    funded_qty bigint,
    project_order_num bigint,
    project_control_num bigint,
    j025a_comment character varying(67),
    time_stamp character varying(28),
    date timestamp without time zone,
    doc_id character varying(31),
    job_suffix character varying(31),
    routing_id character varying(31),
    project_code character varying(31),
    item_manager_code character varying(31),
    j025a_code character varying(31),
    issue_control character varying(12),
    cond_code character varying(12),
    change_switch character varying(12),
    unit_of_issue character varying(21),
    advice_code character varying(22),
    project_amendment_num character varying(23),
    trans_type character varying(55),
    job_designator character varying(56),
    urgency_of_need character varying(58),
    base_delivery_prior character varying(62),
    owner_purpose character varying(61),
    management_code character varying(59),
    cost_code character varying(63),
    demand_code character varying(52),
    force_activity character varying(51),
    jon_default_ind character varying(56)
);


ALTER TABLE afsc448_onesnapshot.xpress OWNER TO postgres;

--
-- Name: DLA ORT 3 Year v3 2018 08_FieldOrders (1); Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public."DLA ORT 3 Year v3 2018 08_FieldOrders (1)" (
    "Field[Date]" integer,
    "Field[SRAN]" integer,
    "Field[Issue Priority - UJC]" text,
    "Field[Issue Priority Group]" integer,
    "Field[Pipe]" text,
    "Field[NIIN]" integer,
    "Field[Orders]" integer,
    "Field[Ordered Qty]" integer,
    "Field[CWT 10-Day Rule Flag]" text,
    "Field[CWT Partial Flag]" text,
    "Field[TDD Buckets]" text,
    "Field[ORT Buckets]" text,
    "Field[FSG]" integer,
    "Field[FSC]" integer,
    "Field[MD]" text,
    "Field[MDS]" text,
    "Field[Missile]" text,
    "Field[Base_Name]" text,
    "Field[MAJCOM]" text,
    "Field[Theater]" text,
    "Field[NIIN type]" text,
    "Field[Count of Months]" integer,
    "Field[VTM]" numeric,
    "Field[srd]" text,
    "Field[VMR]" text,
    "Field[Demands]" text,
    "Field[SRD YN]" text,
    "Field[TDD]" text,
    "Field[Date2]" integer,
    "Field[BDC]" text,
    "Field[EBS_AAC]" text,
    "Field[EBS_RMC]" text,
    "Field[EBS_SSCM]" text,
    "Field[Collab]" text,
    "Field[AFNWC group]" text,
    "Field[AFNWC system]" text,
    "Field[NE]" text,
    "Field[Pilot Production]" text
);


ALTER TABLE afsc448_public."DLA ORT 3 Year v3 2018 08_FieldOrders (1)" OWNER TO postgres;

--
-- Name: actual_nsn_data; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.actual_nsn_data (
    sgm_niin_id bigint NOT NULL,
    actual_niin character varying(9) NOT NULL,
    carc_on_hand bigint,
    control_num character varying(5),
    job_designator character varying(1),
    repair_res_code character varying(8),
    reason character varying(87),
    bypass_ind bigint,
    whse_location character varying(14),
    time_stamp character varying(28)
);


ALTER TABLE afsc448_public.actual_nsn_data OWNER TO postgres;

--
-- Name: af_ort_3_year_2018_08_depotorderdataunfiltered; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.af_ort_3_year_2018_08_depotorderdataunfiltered (
    date timestamp without time zone,
    niin text,
    depotsran bigint,
    depotniin_type character varying(1),
    depotsos character varying(3),
    depotfrequency character varying(12),
    depotcount_of_months bigint,
    depotvmr character varying(10),
    depotdemands character varying(6),
    depotsrd text,
    depotws_design text,
    depotpipe character varying(6),
    depotmx_group_description character varying(11),
    depotmx_group character varying(11),
    depotmx_workload_group character varying(4),
    depotmx_workload character varying(12),
    depotto_date_100_cwt_days bigint,
    depotorders bigint,
    depotordered_qty bigint,
    depotne character varying(5),
    depotcwt_status character varying(6),
    depottdd_buckets character varying(13),
    depotort_buckets character varying(10),
    depotfsg bigint,
    depotfsc bigint,
    depot416th character varying(8),
    depotscms character varying(8),
    depotscmg character varying(8),
    depotmanager_review_code character varying(1),
    depotro bigint,
    depotro_bucket character varying(7),
    depotniin2 character varying(9),
    depotdate2 bigint,
    depotsa bigint,
    depotvtm numeric(20,9),
    depotsrd_yn character varying(20),
    depotro_fill numeric(20,9)
);


ALTER TABLE afsc448_public.af_ort_3_year_2018_08_depotorderdataunfiltered OWNER TO postgres;

--
-- Name: af_ort_3_year_2018_08_fieldorderdataunfiltered; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.af_ort_3_year_2018_08_fieldorderdataunfiltered (
    date timestamp without time zone,
    niin text,
    "fielddate" bigint,
    fieldsran bigint,
    fieldpipe character varying(1),
    fieldorders bigint,
    fieldordered_qty bigint,
    fieldtdd_buckets character varying(13),
    fieldort_buckets character varying(10),
    fieldfsg bigint,
    fieldmd character varying(9),
    fieldmds character varying(6),
    fieldmajcom character varying(3),
    fieldtheater character varying(7),
    fieldniin_type character varying(1),
    fieldfrequency character varying(12),
    fieldcount_of_months bigint,
    fieldsrd character varying(3),
    fieldne character varying(5),
    fieldvmr character varying(10),
    fielddemands character varying(6),
    fieldsrd_yn boolean,
    fieldsos character varying(3),
    fieldtdd character varying(13),
    fielddate2 bigint,
    fieldscms character varying(8),
    fieldscmg character varying(8),
    fieldmanager_review_code character varying(1),
    fieldro bigint,
    fieldsor character varying(5),
    fieldmx_group character varying(4),
    fieldshop character varying(16),
    fieldmx_group_description character varying(11),
    fieldro_bucket character varying(7),
    fieldsa bigint,
    fieldmissile character varying(15),
    fieldvtm numeric(20,9),
    fieldafnwc_group character varying(11),
    fieldafnwc_system character varying(15),
    field416th character varying(8),
    fieldro_fill numeric(20,9)
);


ALTER TABLE afsc448_public.af_ort_3_year_2018_08_fieldorderdataunfiltered OWNER TO postgres;

--
-- Name: af_ort_3year_2018_08_depot; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.af_ort_3year_2018_08_depot (
    depotdate integer,
    depotsran integer,
    "DepotNIIN type" text,
    depotsos text,
    depotfrequency text,
    "DepotCount of Months" integer,
    depotvtm numeric,
    depotvmr text,
    depotdemands text,
    "DepotSRD YN" text,
    depotsrd text,
    "DepotWS Design" text,
    depotpipe text,
    "DepotMX Group Description" text,
    "DepotMX Group" text,
    "DepotMX Workload Group" text,
    "DepotMx Workload" text,
    depotniin integer,
    "DepotTo-Date 100 CWT Days" integer,
    depotorders integer,
    "DepotOrdered Qty" integer,
    depotne text,
    "DepotCWT Status" text,
    "DepotTDD Buckets" text,
    "DepotORT Buckets" text,
    depotfsg integer,
    depotfsc integer,
    depot416th text,
    depotscms text,
    depotscmg text,
    "DepotManager Review Code" text,
    depotro_fill integer,
    depotro integer,
    "DepotRO Bucket" text,
    depotniin2 integer,
    depotdate2 integer,
    depotsa integer
);


ALTER TABLE afsc448_public.af_ort_3year_2018_08_depot OWNER TO postgres;

--
-- Name: part_depot_actual_assets; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.part_depot_actual_assets (
    niin_id character varying,
    location character varying(3),
    serv_assets bigint,
    intransit_reparables bigint,
    f_condition bigint,
    awp_f_condition_m_balance bigint,
    e_condition bigint,
    g_condition bigint,
    k_condition bigint,
    j_condition bigint,
    p_condition bigint,
    q_condition bigint,
    r_condition bigint,
    actual_niin bigint,
    time_stamp character varying(28),
    date timestamp without time zone
);


ALTER TABLE afsc448_public.part_depot_actual_assets OWNER TO postgres;

--
-- Name: tf33bom; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.tf33bom (
    pdn character varying(6) NOT NULL,
    nsn bigint NOT NULL,
    niin bigint NOT NULL,
    mmac character varying(2),
    errc character varying(1),
    rfm_noun character varying(60),
    sos character varying(3),
    im character varying(3),
    es character varying(2),
    aac character varying(1),
    cc character varying(1),
    ui character varying(2),
    cost numeric(11,2),
    opcode character varying(5),
    qpa bigint,
    f bigint,
    tinkerassets bigint,
    mm bigint,
    dlaassets bigint,
    mkshr numeric(9,3),
    issueseight bigint,
    stklevel bigint,
    speclevel bigint,
    duein bigint,
    dueout bigint,
    smartmdr numeric(9,1),
    pr bigint,
    contract bigint,
    overdue bigint,
    pn character varying(27),
    plt bigint,
    alt bigint,
    psc character varying(4),
    saic bigint,
    masternsn bigint,
    master_niin bigint,
    shopid bigint,
    model_desc character varying(4),
    module_desc character varying(18),
    series_desc character varying(38)
);


ALTER TABLE afsc448_public.tf33bom OWNER TO postgres;

--
-- Name: austin_inventory_data; Type: VIEW; Schema: afsc448_public; Owner: postgres
--

CREATE VIEW afsc448_public.austin_inventory_data AS
 SELECT part_depot_actual_assets.actual_niin,
    part_depot_actual_assets.location,
    part_depot_actual_assets.serv_assets,
    (((((((part_depot_actual_assets.serv_assets + part_depot_actual_assets.e_condition) + part_depot_actual_assets.g_condition) + part_depot_actual_assets.k_condition) + part_depot_actual_assets.j_condition) + part_depot_actual_assets.p_condition) + part_depot_actual_assets.q_condition) + part_depot_actual_assets.r_condition) AS total_assets,
    part_depot_actual_assets.date
   FROM afsc448_public.part_depot_actual_assets
  WHERE (part_depot_actual_assets.actual_niin IN ( SELECT DISTINCT tf33bom.niin
           FROM afsc448_public.tf33bom))
  ORDER BY part_depot_actual_assets.date DESC;


ALTER TABLE afsc448_public.austin_inventory_data OWNER TO postgres;

--
-- Name: backordertf33_dated; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.backordertf33_dated (
    alc text,
    di_code text,
    nsn text,
    doc_nr text,
    qty integer,
    priority_cd integer,
    micap_ind text,
    aac text,
    errc text,
    budget_cd integer,
    critical_item text,
    ui text,
    noun text,
    procurement_src_cd text,
    retail_sos text,
    item_sos text,
    insp_data_cd text,
    unit_price numeric,
    date text,
    extract_time text,
    niin integer,
    month integer,
    year integer
);


ALTER TABLE afsc448_public.backordertf33_dated OWNER TO postgres;

--
-- Name: carcass_contstraint; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.carcass_contstraint (
    niin_id bigint,
    nsn character varying(15),
    mds_list character varying(64),
    high_priority_flag boolean,
    carcass_failures bigint,
    maldistribution bigint,
    bypass_count bigint,
    other_alc_rep_count bigint,
    off_base_rep_count bigint,
    other_cond_rep_count bigint,
    cn_rep_count bigint,
    ybq_backorder_count bigint,
    awp_g_count bigint,
    on_contr_pr_count bigint,
    base_difm bigint,
    backorder_qty bigint,
    working_level bigint,
    carcass_shortage bigint,
    depot_difm bigint,
    time_stamp character varying(28),
    date timestamp without time zone,
    lru_sru_ind character varying(10),
    pdn character varying(10),
    sor_alc character varying(10),
    sos_alc character varying(10),
    pssd character varying(10),
    item_manager_code character varying(10)
);


ALTER TABLE afsc448_public.carcass_contstraint OWNER TO postgres;

--
-- Name: completefieldbackorderdata; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.completefieldbackorderdata (
    key text,
    data_month text,
    sos text,
    sran integer,
    base_backorder_flag text,
    sos_sgm text,
    pseudo_division text,
    inv_mgt_specialist text,
    budget_code integer,
    nimsc text,
    ws_type text,
    ws_group text,
    ws_design text,
    equipment_designator text,
    srd text,
    nsn text,
    errc_code text,
    cwt_10_day_rule_flag text,
    cwt_partial_flag text,
    pipeline_document_number text,
    customer_request_document_number text,
    requisition_document_number text,
    activity_code text,
    maj_com text,
    customer_order_date text,
    requisition_date text,
    sep10_age text,
    aug10_age text,
    jul10_age text,
    jun10_age text,
    may10_age text,
    apr10_age text,
    mar10_age text,
    feb10_age text,
    jan10_age text,
    dec09_age text,
    nov09_age text,
    oct09_age text,
    cwt_status text,
    issue_priority_group integer,
    issue_priority___ujc text,
    requisition_priority_code numeric,
    project_code integer,
    alc text,
    rcc text,
    base_name text,
    ordered_qty numeric,
    "To_Date_100%_CWT_Days" numeric,
    to_date_weighted_avg_cwt_days numeric,
    niin integer
);


ALTER TABLE afsc448_public.completefieldbackorderdata OWNER TO postgres;

--
-- Name: component_data; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.component_data (
    comp_niin bigint,
    available_assets_oc bigint,
    available_assets_oo bigint,
    available_assets_wr bigint,
    available_assets_common bigint,
    awp_qty_avail bigint,
    req_aa bigint,
    slimm_prob numeric(4,1),
    total_qpa_oc bigint,
    total_qpa_oo bigint,
    total_qpa_wr bigint,
    total_qpa_common bigint,
    total_requirement numeric(9,2),
    world_wide_replacement_percent numeric(7,2),
    process_switch bigint,
    time_stamp character varying(28),
    date timestamp without time zone
);


ALTER TABLE afsc448_public.component_data OWNER TO postgres;

--
-- Name: compout_type_3; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.compout_type_3 (
    niin_id bigint,
    sran character varying(6),
    trans_num bigint,
    tran_index bigint,
    spaws_rank bigint,
    original_spaws_rank bigint,
    sort_value character varying(21),
    sprt_ind numeric(4,1),
    sprs_seq bigint,
    ws_index bigint,
    kind_code bigint,
    base_prob character varying(12),
    ww_prob numeric(4,1),
    ship_ind bigint,
    doable boolean,
    document_num character varying(15),
    priority_code character varying(3),
    nha_niin_id bigint,
    nsn_count bigint,
    epp_kind_code character varying(1),
    comp_source character varying(1),
    cirf_sran character varying(6),
    time_stamp character varying(28),
    date timestamp without time zone
);


ALTER TABLE afsc448_public.compout_type_3 OWNER TO postgres;

--
-- Name: contract_awards; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.contract_awards (
    modification_number character varying(6),
    transaction_number bigint,
    parent_award_agency_id bigint,
    parent_award_agency_name character varying(47),
    parent_award_modification_number character varying(21),
    action_date timestamp without time zone,
    period_of_performance_start_date timestamp without time zone,
    period_of_performance_current_end_date timestamp without time zone,
    period_of_performance_potential_end_date timestamp without time zone,
    ordering_period_end_date text,
    awarding_agency_code bigint,
    awarding_agency_name character varying(27),
    awarding_sub_agency_code bigint,
    awarding_sub_agency_name character varying(21),
    awarding_office_code character varying(6),
    awarding_office_name character varying(35),
    funding_agency_code bigint,
    funding_agency_name character varying(52),
    funding_sub_agency_code character varying(4),
    funding_sub_agency_name character varying(50),
    funding_office_code character varying(6),
    funding_office_name character varying(35),
    foreign_funding character varying(1),
    foreign_funding_description character varying(21),
    sam_exception bigint,
    recipient_duns bigint,
    recipient_doing_business_as_name character varying(60),
    cage_code character varying(5),
    recipient_parent_name character varying(80),
    recipient_parent_duns bigint,
    recipient_country_code character varying(3),
    recipient_country_name character varying(13),
    recipient_address_line_1 character varying(55),
    recipient_state_code character varying(2),
    recipient_state_name character varying(24),
    recipient_zip_4_code bigint,
    recipient_congressional_district bigint,
    recipient_phone_number character varying(14),
    recipient_fax_number character varying(14),
    primary_place_of_performance_country_code character varying(3),
    primary_place_of_performance_country_name character varying(45),
    primary_place_of_performance_county_name character varying(20),
    primary_place_of_performance_state_code character varying(2),
    primary_place_of_performance_state_name character varying(24),
    primary_place_of_performance_zip_4 character varying(10),
    primary_place_of_performance_congressional_district bigint,
    award_or_idv_flag character varying(5),
    award_type_code character varying(1),
    award_type character varying(19),
    idv_type_code text,
    idv_type text,
    multiple_or_single_award_idv_code text,
    multiple_or_single_award_idv text,
    type_of_idc_code text,
    type_of_idc text,
    type_of_contract_pricing_code character varying(1),
    type_of_contract_pricing character varying(55),
    action_type_code character varying(1),
    action_type character varying(50),
    number_of_actions bigint,
    inherently_governmental_functions character varying(5),
    inherently_governmental_functions_description character varying(37),
    product_or_service_code character varying(4),
    product_or_service_code_description character varying(100),
    contract_bundling_code character varying(1),
    contract_bundling character varying(53),
    dod_claimant_program_code character varying(3),
    dod_claimant_program_description character varying(60),
    naics_code bigint,
    naics_description character varying(118),
    recovered_materials_sustainability_code character varying(1),
    recovered_materials_sustainability character varying(72),
    domestic_or_foreign_entity_code character varying(1),
    domestic_or_foreign_entity character varying(51),
    dod_acquisition_program_code character varying(4),
    dod_acquisition_program_description character varying(33),
    information_technology_commercial_item_category_code character varying(1),
    information_technology_commercial_item_category character varying(27),
    epa_designated_product_code character varying(1),
    epa_designated_product character varying(27),
    country_of_product_or_service_origin_code character varying(3),
    place_of_manufacture_code character varying(1),
    place_of_manufacture character varying(109),
    subcontracting_plan_code character varying(1),
    subcontracting_plan character varying(52),
    extent_competed_code character varying(1),
    extent_competed character varying(52),
    solicitation_procedures_code character varying(4),
    solicitation_procedures character varying(42),
    type_of_set_aside_code character varying(8),
    type_of_set_aside character varying(65),
    evaluated_preference_code character varying(4),
    evaluated_preference character varying(25),
    research_code character varying(3),
    research character varying(59),
    fair_opportunity_limited_sources_code character varying(4),
    fair_opportunity_limited_sources character varying(53),
    other_than_full_and_open_competition_code character varying(3),
    number_of_offers_received bigint,
    commercial_item_acquisition_procedures_code character varying(1),
    commercial_item_acquisition_procedures character varying(46),
    small_business_competitiveness_demonstration_program character varying(1),
    commercial_item_test_program_code boolean,
    commercial_item_test_program character varying(3),
    a76_fair_act_action_code boolean,
    a76_fair_act_action character varying(3),
    fed_biz_opps_code character varying(1),
    fed_biz_opps character varying(14),
    local_area_set_aside_code boolean,
    local_area_set_aside character varying(3),
    clinger_cohen_act_planning_code boolean,
    clinger_cohen_act_planning character varying(3),
    materials_supplies_articles_equipment_code character varying(1),
    materials_supplies_articles_equipment character varying(14),
    labor_standards_code character varying(1),
    labor_standards character varying(14),
    construction_wage_rate_requirements_code character varying(1),
    construction_wage_rate_requirements character varying(14),
    interagency_contracting_authority_code character varying(1),
    interagency_contracting_authority character varying(25),
    other_statutory_authority character varying(89),
    program_acronym text,
    parent_award_type_code character varying(1),
    parent_award_type character varying(4),
    parent_award_single_or_multiple_code character varying(1),
    parent_award_single_or_multiple character varying(14),
    major_program character varying(50),
    national_interest_action_code character varying(4),
    national_interest_action character varying(34),
    cost_or_pricing_data_code character varying(1),
    cost_or_pricing_data character varying(21),
    cost_accounting_standards_clause_code character varying(1),
    cost_accounting_standards_clause character varying(30),
    gfe_gfp_code boolean,
    gfe_gfp character varying(32),
    sea_transportation_code character varying(1),
    sea_transportation character varying(7),
    undefinitized_action_code character varying(1),
    undefinitized_action character varying(26),
    consolidated_contract_code character varying(1),
    consolidated_contract character varying(56),
    performance_based_service_acquisition_code character varying(1),
    performance_based_service_acquisition character varying(35),
    multi_year_contract_code boolean,
    multi_year_contract character varying(3),
    contract_financing_code character varying(1),
    contract_financing character varying(45),
    purchase_card_as_payment_method_code boolean,
    purchase_card_as_payment_method character varying(3),
    contingency_humanitarian_or_peacekeeping_operation_code character varying(1),
    contingency_humanitarian_or_peacekeeping_operation character varying(70),
    alaskan_native_owned_corporation_or_firm character varying(1),
    american_indian_owned_business character varying(1),
    indian_tribe_federally_recognized character varying(1),
    native_hawaiian_owned_business character varying(1),
    tribally_owned_business character varying(1),
    veteran_owned_business character varying(1),
    service_disabled_veteran_owned_business character varying(1),
    woman_owned_business character varying(1),
    women_owned_small_business character varying(1),
    economically_disadvantaged_women_owned_small_business character varying(1),
    joint_venture_women_owned_small_business character varying(1),
    joint_venture_economic_disadvantaged_women_owned_small_bus character varying(1),
    minority_owned_business character varying(1),
    subcontinent_asian_asian_indian_american_owned_business character varying(1),
    asian_pacific_american_owned_business character varying(1),
    black_american_owned_business character varying(1),
    hispanic_american_owned_business character varying(1),
    native_american_owned_business character varying(1),
    other_minority_owned_business character varying(1),
    contracting_officers_determination_of_business_size character varying(25),
    contracting_officers_determination_of_business_size_code character varying(1),
    emerging_small_business character varying(1),
    community_developed_corporation_owned_firm character varying(1),
    labor_surplus_area_firm character varying(1),
    us_federal_government character varying(1),
    federally_funded_research_and_development_corp character varying(1),
    federal_agency character varying(1),
    us_state_government character varying(1),
    us_local_government character varying(1),
    city_local_government character varying(1),
    county_local_government character varying(1),
    inter_municipal_local_government character varying(1),
    local_government_owned character varying(1),
    municipality_local_government character varying(1),
    school_district_local_government character varying(1),
    township_local_government character varying(1),
    us_tribal_government character varying(1),
    foreign_government character varying(1),
    organizational_type character varying(24),
    corporate_entity_not_tax_exempt character varying(1),
    corporate_entity_tax_exempt character varying(1),
    partnership_or_limited_liability_partnership character varying(1),
    sole_proprietorship character varying(1),
    small_agricultural_cooperative character varying(1),
    international_organization character varying(1),
    us_government_entity character varying(1),
    community_development_corporation character varying(1),
    domestic_shelter character varying(1),
    educational_institution character varying(1),
    foundation character varying(1),
    hospital_flag character varying(1),
    manufacturer_of_goods character varying(1),
    veterinary_hospital character varying(1),
    hispanic_servicing_institution character varying(1),
    receives_contracts character varying(1),
    receives_grants character varying(1),
    receives_contracts_and_grants character varying(1),
    airport_authority character varying(1),
    council_of_governments character varying(1),
    housing_authorities_public_tribal character varying(1),
    interstate_entity character varying(1),
    planning_commission character varying(1),
    port_authority character varying(1),
    transit_authority character varying(1),
    subchapter_scorporation character varying(1),
    limited_liability_corporation character varying(1),
    foreign_owned_and_located character varying(1),
    for_profit_organization character varying(1),
    nonprofit_organization character varying(1),
    other_not_for_profit_organization character varying(1),
    the_ability_one_program character varying(1),
    number_of_employees bigint,
    annual_revenue bigint,
    private_university_or_college character varying(1),
    state_controlled_institution_of_higher_learning character varying(1),
    a1862_land_grant_college character varying(1),
    a1890_land_grant_college character varying(1),
    a1994_land_grant_college character varying(1),
    minority_institution character varying(1),
    historically_black_college character varying(1),
    tribal_college character varying(1),
    alaskan_native_servicing_institution character varying(1),
    native_hawaiian_servicing_institution character varying(1),
    school_of_forestry character varying(1),
    veterinary_college character varying(1),
    dot_certified_disadvantage character varying(1),
    self_certified_small_disadvantaged_business character varying(1),
    small_disadvantaged_business character varying(1),
    c8a_program_participant character varying(1),
    historically_underutilized_business_zone_hubzone_firm character varying(1),
    sba_certified_8a_joint_venture character varying(1),
    last_modified_date timestamp without time zone,
    award_id_piid character varying(14),
    parent_award_id character varying(21),
    federal_action_obligation numeric(15,2),
    base_and_exercised_options_value numeric(15,2),
    current_total_value_of_award numeric(16,2),
    base_and_all_options_value numeric(16,2),
    potential_total_value_of_award numeric(16,2),
    sam_exception_description character varying(70),
    recipient_name character varying(85),
    recipient_address_line_2 character varying(27),
    recipient_city_name character varying(25),
    primary_place_of_performance_city_name character varying(27),
    award_description character varying(2860),
    solicitation_identifier character varying(14),
    country_of_product_or_service_origin character varying(20),
    price_evaluation_adjustment_preference_percent_difference numeric(7,2),
    total_dollars_obligated numeric(56,2),
    other_than_full_and_open_competition character varying(146)
);


ALTER TABLE afsc448_public.contract_awards OWNER TO postgres;

--
-- Name: contract_awards_2; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.contract_awards_2 (
    award_id_piid character varying(13),
    modification_number character varying(6),
    transaction_number bigint,
    parent_award_agency_id bigint,
    parent_award_agency_name character varying(47),
    parent_award_id character varying(17),
    parent_award_modification_number character varying(21),
    federal_action_obligation numeric(15,2),
    total_dollars_obligated numeric(16,2),
    base_and_exercised_options_value numeric(15,2),
    current_total_value_of_award numeric(16,2),
    base_and_all_options_value numeric(15,2),
    potential_total_value_of_award numeric(16,2),
    action_date timestamp without time zone,
    period_of_performance_start_date timestamp without time zone,
    period_of_performance_current_end_date timestamp without time zone,
    period_of_performance_potential_end_date timestamp without time zone,
    ordering_period_end_date text,
    awarding_agency_code bigint,
    awarding_agency_name character varying(27),
    awarding_sub_agency_code bigint,
    awarding_sub_agency_name character varying(21),
    awarding_office_code character varying(6),
    awarding_office_name character varying(35),
    funding_agency_code bigint,
    funding_agency_name character varying(52),
    funding_sub_agency_code character varying(4),
    funding_sub_agency_name character varying(50),
    funding_office_code character varying(6),
    funding_office_name character varying(35),
    foreign_funding character varying(1),
    foreign_funding_description character varying(21),
    sam_exception bigint,
    sam_exception_description character varying(49),
    recipient_duns bigint,
    recipient_name character varying(81),
    recipient_doing_business_as_name character varying(60),
    cage_code character varying(5),
    recipient_parent_name character varying(80),
    recipient_parent_duns bigint,
    recipient_country_code character varying(3),
    recipient_country_name character varying(13),
    recipient_address_line_1 character varying(55),
    recipient_address_line_2 character varying(15),
    recipient_city_name character varying(23),
    recipient_state_code character varying(2),
    recipient_state_name character varying(24),
    recipient_zip_4_code bigint,
    recipient_congressional_district bigint,
    recipient_phone_number character varying(14),
    recipient_fax_number character varying(14),
    primary_place_of_performance_country_code character varying(3),
    primary_place_of_performance_country_name character varying(45),
    primary_place_of_performance_city_name character varying(25),
    primary_place_of_performance_county_name character varying(20),
    primary_place_of_performance_state_code character varying(2),
    primary_place_of_performance_state_name character varying(24),
    primary_place_of_performance_zip_4 character varying(10),
    primary_place_of_performance_congressional_district bigint,
    award_or_idv_flag character varying(5),
    award_type_code character varying(1),
    award_type character varying(19),
    idv_type_code text,
    idv_type text,
    multiple_or_single_award_idv_code text,
    multiple_or_single_award_idv text,
    type_of_idc_code text,
    type_of_idc text,
    type_of_contract_pricing_code character varying(1),
    type_of_contract_pricing character varying(55),
    award_description character varying(1669),
    action_type_code character varying(1),
    action_type character varying(50),
    solicitation_identifier character varying(13),
    number_of_actions bigint,
    inherently_governmental_functions character varying(5),
    inherently_governmental_functions_description character varying(37),
    product_or_service_code character varying(4),
    product_or_service_code_description character varying(100),
    contract_bundling_code character varying(1),
    contract_bundling character varying(53),
    dod_claimant_program_code character varying(3),
    dod_claimant_program_description character varying(60),
    naics_code bigint,
    naics_description character varying(118),
    recovered_materials_sustainability_code character varying(1),
    recovered_materials_sustainability character varying(72),
    domestic_or_foreign_entity_code character varying(1),
    domestic_or_foreign_entity character varying(51),
    dod_acquisition_program_code character varying(4),
    dod_acquisition_program_description character varying(33),
    information_technology_commercial_item_category_code character varying(1),
    information_technology_commercial_item_category character varying(27),
    epa_designated_product_code character varying(1),
    epa_designated_product character varying(27),
    country_of_product_or_service_origin_code character varying(3),
    country_of_product_or_service_origin character varying(45),
    place_of_manufacture_code character varying(1),
    place_of_manufacture character varying(109),
    subcontracting_plan_code character varying(1),
    subcontracting_plan character varying(52),
    extent_competed_code character varying(1),
    extent_competed character varying(52),
    solicitation_procedures_code character varying(4),
    solicitation_procedures character varying(42),
    type_of_set_aside_code character varying(8),
    type_of_set_aside character varying(65),
    evaluated_preference_code character varying(4),
    evaluated_preference character varying(25),
    research_code character varying(3),
    research character varying(59),
    fair_opportunity_limited_sources_code character varying(4),
    fair_opportunity_limited_sources character varying(53),
    other_than_full_and_open_competition_code character varying(3),
    other_than_full_and_open_competition character varying(52),
    number_of_offers_received bigint,
    commercial_item_acquisition_procedures_code character varying(1),
    commercial_item_acquisition_procedures character varying(46),
    small_business_competitiveness_demonstration_program character varying(1),
    commercial_item_test_program_code boolean,
    commercial_item_test_program character varying(3),
    a76_fair_act_action_code boolean,
    a76_fair_act_action character varying(3),
    fed_biz_opps_code character varying(1),
    fed_biz_opps character varying(14),
    local_area_set_aside_code boolean,
    local_area_set_aside character varying(3),
    price_evaluation_adjustment_preference_percent_difference numeric(6,2),
    clinger_cohen_act_planning_code boolean,
    clinger_cohen_act_planning character varying(3),
    materials_supplies_articles_equipment_code character varying(1),
    materials_supplies_articles_equipment character varying(14),
    labor_standards_code character varying(1),
    labor_standards character varying(14),
    construction_wage_rate_requirements_code character varying(1),
    construction_wage_rate_requirements character varying(14),
    interagency_contracting_authority_code character varying(1),
    interagency_contracting_authority character varying(25),
    other_statutory_authority character varying(89),
    program_acronym text,
    parent_award_type_code character varying(1),
    parent_award_type character varying(4),
    parent_award_single_or_multiple_code character varying(1),
    parent_award_single_or_multiple character varying(14),
    major_program character varying(50),
    national_interest_action_code character varying(4),
    national_interest_action character varying(34),
    cost_or_pricing_data_code character varying(1),
    cost_or_pricing_data character varying(21),
    cost_accounting_standards_clause_code character varying(1),
    cost_accounting_standards_clause character varying(30),
    gfe_gfp_code boolean,
    gfe_gfp character varying(32),
    sea_transportation_code character varying(1),
    sea_transportation character varying(7),
    undefinitized_action_code character varying(1),
    undefinitized_action character varying(26),
    consolidated_contract_code character varying(1),
    consolidated_contract character varying(56),
    performance_based_service_acquisition_code character varying(1),
    performance_based_service_acquisition character varying(35),
    multi_year_contract_code boolean,
    multi_year_contract character varying(3),
    contract_financing_code character varying(1),
    contract_financing character varying(45),
    purchase_card_as_payment_method_code boolean,
    purchase_card_as_payment_method character varying(3),
    contingency_humanitarian_or_peacekeeping_operation_code character varying(1),
    contingency_humanitarian_or_peacekeeping_operation character varying(70),
    alaskan_native_owned_corporation_or_firm character varying(1),
    american_indian_owned_business character varying(1),
    indian_tribe_federally_recognized character varying(1),
    native_hawaiian_owned_business character varying(1),
    tribally_owned_business character varying(1),
    veteran_owned_business character varying(1),
    service_disabled_veteran_owned_business character varying(1),
    woman_owned_business character varying(1),
    women_owned_small_business character varying(1),
    economically_disadvantaged_women_owned_small_business character varying(1),
    joint_venture_women_owned_small_business character varying(1),
    joint_venture_economic_disadvantaged_women_owned_small_bus character varying(1),
    minority_owned_business character varying(1),
    subcontinent_asian_asian_indian_american_owned_business character varying(1),
    asian_pacific_american_owned_business character varying(1),
    black_american_owned_business character varying(1),
    hispanic_american_owned_business character varying(1),
    native_american_owned_business character varying(1),
    other_minority_owned_business character varying(1),
    contracting_officers_determination_of_business_size character varying(25),
    contracting_officers_determination_of_business_size_code character varying(1),
    emerging_small_business character varying(1),
    community_developed_corporation_owned_firm character varying(1),
    labor_surplus_area_firm character varying(1),
    us_federal_government character varying(1),
    federally_funded_research_and_development_corp character varying(1),
    federal_agency character varying(1),
    us_state_government character varying(1),
    us_local_government character varying(1),
    city_local_government character varying(1),
    county_local_government character varying(1),
    inter_municipal_local_government character varying(1),
    local_government_owned character varying(1),
    municipality_local_government character varying(1),
    school_district_local_government character varying(1),
    township_local_government character varying(1),
    us_tribal_government character varying(1),
    foreign_government character varying(1),
    organizational_type character varying(24),
    corporate_entity_not_tax_exempt character varying(1),
    corporate_entity_tax_exempt character varying(1),
    partnership_or_limited_liability_partnership character varying(1),
    sole_proprietorship character varying(1),
    small_agricultural_cooperative character varying(1),
    international_organization character varying(1),
    us_government_entity character varying(1),
    community_development_corporation character varying(1),
    domestic_shelter character varying(1),
    educational_institution character varying(1),
    foundation character varying(1),
    hospital_flag character varying(1),
    manufacturer_of_goods character varying(1),
    veterinary_hospital character varying(1),
    hispanic_servicing_institution character varying(1),
    receives_contracts character varying(1),
    receives_grants character varying(1),
    receives_contracts_and_grants character varying(1),
    airport_authority character varying(1),
    council_of_governments character varying(1),
    housing_authorities_public_tribal character varying(1),
    interstate_entity character varying(1),
    planning_commission character varying(1),
    port_authority character varying(1),
    transit_authority character varying(1),
    subchapter_scorporation character varying(1),
    limited_liability_corporation character varying(1),
    foreign_owned_and_located character varying(1),
    for_profit_organization character varying(1),
    nonprofit_organization character varying(1),
    other_not_for_profit_organization character varying(1),
    the_ability_one_program character varying(1),
    number_of_employees bigint,
    annual_revenue bigint,
    private_university_or_college character varying(1),
    state_controlled_institution_of_higher_learning character varying(1),
    a1862_land_grant_college character varying(1),
    a1890_land_grant_college character varying(1),
    a1994_land_grant_college character varying(1),
    minority_institution character varying(1),
    historically_black_college character varying(1),
    tribal_college character varying(1),
    alaskan_native_servicing_institution character varying(1),
    native_hawaiian_servicing_institution character varying(1),
    school_of_forestry character varying(1),
    veterinary_college character varying(1),
    dot_certified_disadvantage character varying(1),
    self_certified_small_disadvantaged_business character varying(1),
    small_disadvantaged_business character varying(1),
    c8a_program_participant character varying(1),
    historically_underutilized_business_zone_hubzone_firm character varying(1),
    sba_certified_8a_joint_venture character varying(1),
    last_modified_date timestamp without time zone
);


ALTER TABLE afsc448_public.contract_awards_2 OWNER TO postgres;

--
-- Name: contract_awards_all; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.contract_awards_all (
    award_id_piid character varying(255),
    modification_number character varying(255),
    transaction_number bigint,
    parent_award_agency_id bigint,
    parent_award_agency_name character varying(255),
    parent_award_id character varying(31),
    parent_award_modification_number character varying(31),
    federal_action_obligation numeric(255,2),
    total_dollars_obligated numeric(255,2),
    base_and_exercised_options_value numeric(255,2),
    current_total_value_of_award numeric(255,2),
    base_and_all_options_value numeric(255,2),
    potential_total_value_of_award numeric(255,2),
    action_date timestamp without time zone,
    period_of_performance_start_date timestamp without time zone,
    period_of_performance_current_end_date timestamp without time zone,
    period_of_performance_potential_end_date timestamp without time zone,
    ordering_period_end_date text,
    awarding_agency_code bigint,
    awarding_agency_name character varying(255),
    awarding_sub_agency_code bigint,
    awarding_sub_agency_name character varying(255),
    awarding_office_code character varying(255),
    awarding_office_name character varying(255),
    funding_agency_code bigint,
    funding_agency_name character varying(255),
    funding_sub_agency_code character varying(255),
    funding_sub_agency_name character varying(255),
    funding_office_code character varying(255),
    funding_office_name character varying(255),
    foreign_funding character varying(255),
    foreign_funding_description character varying(255),
    sam_exception bigint,
    sam_exception_description character varying(255),
    recipient_duns bigint,
    recipient_name character varying(255),
    recipient_doing_business_as_name character varying(255),
    cage_code character varying(255),
    recipient_parent_name character varying(255),
    recipient_parent_duns bigint,
    recipient_country_code character varying(255),
    recipient_country_name character varying(255),
    recipient_address_line_1 character varying(255),
    recipient_address_line_2 character varying(255),
    recipient_city_name character varying(255),
    recipient_state_code character varying(255),
    recipient_state_name character varying(255),
    recipient_zip_4_code bigint,
    recipient_congressional_district bigint,
    recipient_phone_number character varying(255),
    recipient_fax_number character varying(255),
    primary_place_of_performance_country_code character varying(255),
    primary_place_of_performance_country_name character varying(255),
    primary_place_of_performance_city_name character varying(255),
    primary_place_of_performance_county_name character varying(255),
    primary_place_of_performance_state_code character varying(255),
    primary_place_of_performance_state_name character varying(255),
    primary_place_of_performance_zip_4 character varying(255),
    primary_place_of_performance_congressional_district bigint,
    award_or_idv_flag character varying(255),
    award_type_code character varying(255),
    award_type character varying(255),
    idv_type_code text,
    idv_type text,
    multiple_or_single_award_idv_code text,
    multiple_or_single_award_idv text,
    type_of_idc_code text,
    type_of_idc text,
    type_of_contract_pricing_code character varying(255),
    type_of_contract_pricing character varying(255),
    award_description character varying(2860),
    action_type_code character varying(255),
    action_type character varying(255),
    solicitation_identifier character varying(255),
    number_of_actions bigint,
    inherently_governmental_functions character varying(255),
    inherently_governmental_functions_description character varying(255),
    product_or_service_code character varying(255),
    product_or_service_code_description character varying(255),
    contract_bundling_code character varying(255),
    contract_bundling character varying(255),
    dod_claimant_program_code character varying(255),
    dod_claimant_program_description character varying(255),
    naics_code bigint,
    naics_description character varying(255),
    recovered_materials_sustainability_code character varying(255),
    recovered_materials_sustainability character varying(255),
    domestic_or_foreign_entity_code character varying(255),
    domestic_or_foreign_entity character varying(255),
    dod_acquisition_program_code character varying(255),
    dod_acquisition_program_description character varying(313),
    information_technology_commercial_item_category_code character varying(255),
    information_technology_commercial_item_category character varying(271),
    epa_designated_product_code character varying(255),
    epa_designated_product character varying(255),
    country_of_product_or_service_origin_code character varying(31),
    country_of_product_or_service_origin character varying(201),
    place_of_manufacture_code character varying(11),
    place_of_manufacture character varying(255),
    subcontracting_plan_code character varying(11),
    subcontracting_plan character varying(512),
    extent_competed_code character varying(11),
    extent_competed character varying(255),
    solicitation_procedures_code character varying(41),
    solicitation_procedures character varying(421),
    type_of_set_aside_code character varying(81),
    type_of_set_aside character varying(255),
    evaluated_preference_code character varying(41),
    evaluated_preference character varying(251),
    research_code character varying(31),
    research character varying(591),
    fair_opportunity_limited_sources_code character varying(41),
    fair_opportunity_limited_sources character varying(531),
    other_than_full_and_open_competition_code character varying(31),
    other_than_full_and_open_competition character varying(416),
    number_of_offers_received bigint,
    commercial_item_acquisition_procedures_code character varying(255),
    commercial_item_acquisition_procedures character varying(461),
    small_business_competitiveness_demonstration_program character varying(11),
    commercial_item_test_program_code boolean,
    commercial_item_test_program character varying(31),
    a76_fair_act_action_code boolean,
    a76_fair_act_action character varying(31),
    fed_biz_opps_code character varying(11),
    fed_biz_opps character varying(114),
    local_area_set_aside_code boolean,
    local_area_set_aside character varying(31),
    price_evaluation_adjustment_preference_percent_difference numeric(71,2),
    clinger_cohen_act_planning_code boolean,
    clinger_cohen_act_planning character varying(31),
    materials_supplies_articles_equipment_code character varying(11),
    materials_supplies_articles_equipment character varying(141),
    labor_standards_code character varying(11),
    labor_standards character varying(141),
    construction_wage_rate_requirements_code character varying(11),
    construction_wage_rate_requirements character varying(141),
    interagency_contracting_authority_code character varying(11),
    interagency_contracting_authority character varying(251),
    other_statutory_authority character varying(189),
    program_acronym text,
    parent_award_type_code character varying(11),
    parent_award_type character varying(41),
    parent_award_single_or_multiple_code character varying(11),
    parent_award_single_or_multiple character varying(114),
    major_program character varying(501),
    national_interest_action_code character varying(41),
    national_interest_action character varying(34),
    cost_or_pricing_data_code character varying(1),
    cost_or_pricing_data character varying(21),
    cost_accounting_standards_clause_code character varying(1),
    cost_accounting_standards_clause character varying(30),
    gfe_gfp_code boolean,
    gfe_gfp character varying(32),
    sea_transportation_code character varying(1),
    sea_transportation character varying(7),
    undefinitized_action_code character varying(1),
    undefinitized_action character varying(26),
    consolidated_contract_code character varying(1),
    consolidated_contract character varying(56),
    performance_based_service_acquisition_code character varying(1),
    performance_based_service_acquisition character varying(35),
    multi_year_contract_code boolean,
    multi_year_contract character varying(3),
    contract_financing_code character varying(1),
    contract_financing character varying(45),
    purchase_card_as_payment_method_code boolean,
    purchase_card_as_payment_method character varying(3),
    contingency_humanitarian_or_peacekeeping_operation_code character varying(1),
    contingency_humanitarian_or_peacekeeping_operation character varying(70),
    alaskan_native_owned_corporation_or_firm character varying(1),
    american_indian_owned_business character varying(1),
    indian_tribe_federally_recognized character varying(1),
    native_hawaiian_owned_business character varying(1),
    tribally_owned_business character varying(1),
    veteran_owned_business character varying(1),
    service_disabled_veteran_owned_business character varying(1),
    woman_owned_business character varying(1),
    women_owned_small_business character varying(1),
    economically_disadvantaged_women_owned_small_business character varying(1),
    joint_venture_women_owned_small_business character varying(1),
    joint_venture_economic_disadvantaged_women_owned_small_bus character varying(1),
    minority_owned_business character varying(1),
    subcontinent_asian_asian_indian_american_owned_business character varying(1),
    asian_pacific_american_owned_business character varying(1),
    black_american_owned_business character varying(1),
    hispanic_american_owned_business character varying(1),
    native_american_owned_business character varying(1),
    other_minority_owned_business character varying(1),
    contracting_officers_determination_of_business_size character varying(251),
    contracting_officers_determination_of_business_size_code character varying(1),
    emerging_small_business character varying(1),
    community_developed_corporation_owned_firm character varying(1),
    labor_surplus_area_firm character varying(1),
    us_federal_government character varying(1),
    federally_funded_research_and_development_corp character varying(1),
    federal_agency character varying(1),
    us_state_government character varying(1),
    us_local_government character varying(1),
    city_local_government character varying(1),
    county_local_government character varying(1),
    inter_municipal_local_government character varying(1),
    local_government_owned character varying(1),
    municipality_local_government character varying(1),
    school_district_local_government character varying(1),
    township_local_government character varying(1),
    us_tribal_government character varying(1),
    foreign_government character varying(1),
    organizational_type character varying(24),
    corporate_entity_not_tax_exempt character varying(1),
    corporate_entity_tax_exempt character varying(1),
    partnership_or_limited_liability_partnership character varying(1),
    sole_proprietorship character varying(1),
    small_agricultural_cooperative character varying(1),
    international_organization character varying(1),
    us_government_entity character varying(1),
    community_development_corporation character varying(1),
    domestic_shelter character varying(1),
    educational_institution character varying(1),
    foundation character varying(1),
    hospital_flag character varying(1),
    manufacturer_of_goods character varying(1),
    veterinary_hospital character varying(1),
    hispanic_servicing_institution character varying(1),
    receives_contracts character varying(1),
    receives_grants character varying(1),
    receives_contracts_and_grants character varying(1),
    airport_authority character varying(1),
    council_of_governments character varying(1),
    housing_authorities_public_tribal character varying(1),
    interstate_entity character varying(1),
    planning_commission character varying(1),
    port_authority character varying(1),
    transit_authority character varying(1),
    subchapter_scorporation character varying(1),
    limited_liability_corporation character varying(1),
    foreign_owned_and_located character varying(1),
    for_profit_organization character varying(1),
    nonprofit_organization character varying(1),
    other_not_for_profit_organization character varying(1),
    the_ability_one_program character varying(1),
    number_of_employees bigint,
    annual_revenue bigint,
    private_university_or_college character varying(1),
    state_controlled_institution_of_higher_learning character varying(1),
    a1862_land_grant_college character varying(1),
    a1890_land_grant_college character varying(1),
    a1994_land_grant_college character varying(1),
    minority_institution character varying(1),
    historically_black_college character varying(1),
    tribal_college character varying(1),
    alaskan_native_servicing_institution character varying(1),
    native_hawaiian_servicing_institution character varying(1),
    school_of_forestry character varying(1),
    veterinary_college character varying(1),
    dot_certified_disadvantage character varying(1),
    self_certified_small_disadvantaged_business character varying(1),
    small_disadvantaged_business character varying(1),
    c8a_program_participant character varying(1),
    historically_underutilized_business_zone_hubzone_firm character varying(1),
    sba_certified_8a_joint_venture character varying(1),
    last_modified_date timestamp without time zone
);


ALTER TABLE afsc448_public.contract_awards_all OWNER TO postgres;

--
-- Name: daily_demand_excp; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.daily_demand_excp (
    niin_id bigint,
    daily_demand_rate numeric(10,4),
    time_stamp character varying(28),
    date timestamp without time zone,
    sran character varying(10),
    d035k_daily_demand_rate character varying(150),
    d035k_daily_demand_rate_njr character varying(150)
);


ALTER TABLE afsc448_public.daily_demand_excp OWNER TO postgres;

--
-- Name: depot_awp; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.depot_awp (
    niin_id bigint,
    niin_id_sru bigint,
    quantity bigint,
    end_item_nsn character varying(15),
    end_item_doc_num character varying(14),
    comp_due_out_nsn character varying(15),
    comp_due_out_doc_num character varying(14),
    comp_due_out_sos character varying(30),
    comp_due_out_errc character varying(10),
    bo_release_qty bigint,
    time_stamp character varying(28),
    date timestamp without time zone
);


ALTER TABLE afsc448_public.depot_awp OWNER TO postgres;

--
-- Name: depot_bo; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.depot_bo (
    alc character varying(2),
    di_code character varying(3),
    nsn character varying(15),
    doc_nr character varying(14),
    qty bigint,
    priority_cd bigint,
    micap_ind character varying(1),
    aac character varying(2),
    errc character varying(1),
    budget_cd character varying(1),
    critical_item boolean,
    ui character varying(2),
    noun character varying(37),
    procurement_src_cd character varying(1),
    retail_sos character varying(3),
    item_sos character varying(3),
    insp_data_cd character varying(3),
    unit_price numeric(12,2),
    "DATE" timestamp without time zone,
    extract_time timestamp without time zone
);


ALTER TABLE afsc448_public.depot_bo OWNER TO postgres;

--
-- Name: depot_bo_niin; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.depot_bo_niin (
    niin text,
    alc character varying(2),
    di_code character varying(3),
    nsn character varying(15),
    doc_nr character varying(14),
    qty bigint,
    priority_cd bigint,
    micap_ind character varying(1),
    aac character varying(2),
    errc character varying(1),
    budget_cd character varying(1),
    critical_item boolean,
    ui character varying(2),
    noun character varying(37),
    procurement_src_cd character varying(1),
    retail_sos character varying(3),
    item_sos character varying(3),
    insp_data_cd character varying(3),
    unit_price numeric(12,2),
    "DATE" timestamp without time zone,
    extract_time timestamp without time zone
);


ALTER TABLE afsc448_public.depot_bo_niin OWNER TO postgres;

--
-- Name: depot_condemnation; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.depot_condemnation (
    count bigint,
    niin_id character varying(50),
    cndmn_pct bigint,
    depot_date date,
    sor_alc character varying(2)
);


ALTER TABLE afsc448_public.depot_condemnation OWNER TO postgres;

--
-- Name: depot_ortorder_inventory; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.depot_ortorder_inventory (
    month double precision,
    niin character varying,
    serv_assets numeric,
    intransit_reparables numeric,
    f_condition numeric,
    q_condition numeric,
    date timestamp without time zone,
    depotsran bigint,
    depotniin_type character varying(1),
    depotsos character varying(3),
    depotfrequency character varying(12),
    depotcount_of_months bigint,
    depotvmr character varying(10),
    depotdemands character varying(6),
    depotsrd text,
    depotws_design text,
    depotpipe character varying(6),
    depotmx_group_description character varying(11),
    depotmx_group character varying(11),
    depotmx_workload_group character varying(4),
    depotmx_workload character varying(12),
    depotto_date_100_cwt_days bigint,
    depotorders bigint,
    depotordered_qty bigint,
    depotne character varying(5),
    depotcwt_status character varying(6),
    depottdd_buckets character varying(13),
    depotort_buckets character varying(10),
    depotfsg bigint,
    depotfsc bigint,
    depot416th character varying(8),
    depotscms character varying(8),
    depotscmg character varying(8),
    depotmanager_review_code character varying(1),
    depotro bigint,
    depotro_bucket character varying(7),
    depotniin2 character varying(9),
    depotdate2 bigint,
    depotsa bigint,
    depotvtm numeric(20,9),
    depotsrd_yn character varying(20),
    depotro_fill numeric(20,9)
);


ALTER TABLE afsc448_public.depot_ortorder_inventory OWNER TO postgres;

--
-- Name: epp_kind_code_definitions; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.epp_kind_code_definitions (
    epp_kind_code character varying(2),
    code_definition character varying(9),
    code_description character varying(72),
    date timestamp without time zone
);


ALTER TABLE afsc448_public.epp_kind_code_definitions OWNER TO postgres;

--
-- Name: external_rework_and_no_bid_list; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.external_rework_and_no_bid_list (
    mdc text,
    contracting text,
    ctr_branch text,
    pi_number text,
    amd_nbr integer,
    niin text,
    rqmt_qy integer,
    unit_cost text,
    total_pr_value text,
    rqmt_type_cd text,
    amc text,
    rmc text,
    cage text,
    part_number text,
    ro_office text,
    date_in_rework text,
    days_in_rework integer,
    erc text,
    root_cause_for_no_bid text,
    saspo_assistance text,
    eom text,
    id integer NOT NULL
);


ALTER TABLE afsc448_public.external_rework_and_no_bid_list OWNER TO postgres;

--
-- Name: external_rework_and_no_bid_list_id_seq; Type: SEQUENCE; Schema: afsc448_public; Owner: postgres
--

CREATE SEQUENCE afsc448_public.external_rework_and_no_bid_list_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE afsc448_public.external_rework_and_no_bid_list_id_seq OWNER TO postgres;

--
-- Name: external_rework_and_no_bid_list_id_seq; Type: SEQUENCE OWNED BY; Schema: afsc448_public; Owner: postgres
--

ALTER SEQUENCE afsc448_public.external_rework_and_no_bid_list_id_seq OWNED BY afsc448_public.external_rework_and_no_bid_list.id;


--
-- Name: field_bo; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.field_bo (
    data_month timestamp without time zone,
    sos character varying(5),
    sran bigint,
    base_backorder_flag boolean,
    sos_sgm character varying(3),
    pseudo_division character varying(19),
    inv_mgt_specialist character varying(21),
    budget_code character varying(1),
    nimsc character varying(1),
    ws_type character varying(1),
    ws_group character varying(15),
    ws_design character varying(15),
    equipment_designator character varying(15),
    srd character varying(3),
    nsn character varying(15),
    errc_code character varying(10),
    cwt_10_day_rule_flag character varying(3),
    cwt_partial_flag boolean,
    pipeline_document_number character varying(14),
    customer_request_document_number character varying(14),
    requisition_document_number character varying(14),
    activity_code character varying(1),
    maj_com character varying(3),
    customer_order_date timestamp without time zone,
    requisition_date timestamp without time zone,
    sep10_age text,
    aug10_age text,
    jul10_age text,
    jun10_age text,
    may10_age text,
    apr10_age text,
    mar10_age text,
    feb10_age text,
    jan10_age text,
    dec09_age text,
    nov09_age text,
    oct09_age text,
    cwt_status character varying(4),
    issue_priority_group bigint,
    issue_priority___ujc character varying(2),
    requisition_priority_code character varying(6),
    project_code character varying(3),
    alc text,
    rcc text,
    base_name character varying(39),
    ordered_qty numeric(10,2),
    "To_Date_100%_CWT_Days" numeric(11,2),
    to_date_weighted_avg_cwt_days numeric(10,2)
);


ALTER TABLE afsc448_public.field_bo OWNER TO postgres;

--
-- Name: field_bo_niin; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.field_bo_niin (
    niin text,
    data_month timestamp without time zone,
    sos character varying(5),
    sran bigint,
    base_backorder_flag boolean,
    sos_sgm character varying(3),
    pseudo_division character varying(19),
    inv_mgt_specialist character varying(21),
    budget_code character varying(1),
    nimsc character varying(1),
    ws_type character varying(1),
    ws_group character varying(15),
    ws_design character varying(15),
    equipment_designator character varying(15),
    srd character varying(3),
    nsn character varying(15),
    errc_code character varying(10),
    cwt_10_day_rule_flag character varying(3),
    cwt_partial_flag boolean,
    pipeline_document_number character varying(14),
    customer_request_document_number character varying(14),
    requisition_document_number character varying(14),
    activity_code character varying(1),
    maj_com character varying(3),
    customer_order_date timestamp without time zone,
    requisition_date timestamp without time zone,
    sep10_age text,
    aug10_age text,
    jul10_age text,
    jun10_age text,
    may10_age text,
    apr10_age text,
    mar10_age text,
    feb10_age text,
    jan10_age text,
    dec09_age text,
    nov09_age text,
    oct09_age text,
    cwt_status character varying(4),
    issue_priority_group bigint,
    issue_priority___ujc character varying(2),
    requisition_priority_code character varying(6),
    project_code character varying(3),
    alc text,
    rcc text,
    base_name character varying(39),
    ordered_qty numeric(10,2),
    "To_Date_100%_CWT_Days" numeric(11,2),
    to_date_weighted_avg_cwt_days numeric(10,2)
);


ALTER TABLE afsc448_public.field_bo_niin OWNER TO postgres;

--
-- Name: field_bo_time; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.field_bo_time (
    data_month timestamp without time zone,
    sos character varying(5),
    sran bigint,
    base_backorder_flag boolean,
    sos_sgm character varying(3),
    pseudo_division character varying(19),
    inv_mgt_specialist character varying(21),
    budget_code character varying(1),
    nimsc character varying(1),
    ws_type character varying(1),
    ws_group character varying(15),
    ws_design character varying(15),
    equipment_designator character varying(15),
    srd character varying(3),
    nsn character varying(15),
    errc_code character varying(10),
    base_name character varying(39),
    cwt_10_day_rule_flag character varying(3),
    cwt_partial_flag boolean,
    pipeline_document_number character varying(14),
    customer_request_document_number character varying(14),
    requisition_document_number character varying(14),
    ordered_qty numeric(10,2),
    activity_code character varying(1),
    maj_com character varying(3),
    customer_order_date timestamp without time zone,
    requisition_date timestamp without time zone,
    "To_Date_100%_CWT_Days" numeric(11,2),
    sep10_age text,
    aug10_age text,
    jul10_age text,
    jun10_age text,
    may10_age text,
    apr10_age text,
    mar10_age text,
    feb10_age text,
    jan10_age text,
    dec09_age text,
    nov09_age text,
    oct09_age text,
    to_date_weighted_avg_cwt_days numeric(10,2),
    cwt_status character varying(4),
    issue_priority_group bigint,
    issue_priority___ujc character varying(2),
    requisition_priority_code character varying(6),
    project_code character varying(3),
    alc text,
    rcc text
);


ALTER TABLE afsc448_public.field_bo_time OWNER TO postgres;

--
-- Name: field_ort_bo; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.field_ort_bo (
    niin text,
    "Date" timestamp without time zone,
    sran bigint,
    pipe character varying(1),
    orders bigint,
    ordered_qty bigint,
    tdd_buckets character varying(13),
    ort_buckets character varying(10),
    fsg bigint,
    md character varying(9),
    mds character varying(6),
    missile character varying(15),
    majcom character varying(3),
    theater character varying(7),
    niin_type character varying(1),
    frequency character varying(12),
    count_of_months bigint,
    vtm numeric(34,16),
    afnwc_group character varying(11),
    afnwc_system character varying(15),
    ne character varying(5),
    vmr character varying(10),
    demands character varying(6),
    srd_yn boolean,
    sos character varying(3),
    tdd character varying(13),
    date2 bigint,
    four16th character varying(8),
    scms character varying(8),
    scmg character varying(8),
    manager_review_code character varying(1),
    ro_fill numeric(38,18),
    ro numeric(6,1),
    sor character varying(5),
    mx_group character varying(4),
    shop character varying(16),
    mx_group_description character varying(11),
    ro_bucket character varying(7),
    sa numeric(6,1),
    key character varying(17),
    back_order bigint,
    month bigint
);


ALTER TABLE afsc448_public.field_ort_bo OWNER TO postgres;

--
-- Name: field_ort_bo_old; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.field_ort_bo_old (
    "Date" timestamp without time zone,
    sran bigint,
    pipe character varying(1),
    niin character varying(9),
    orders bigint,
    ordered_qty bigint,
    tdd_buckets character varying(13),
    ort_buckets character varying(10),
    fsg bigint,
    md character varying(9),
    mds character varying(6),
    missile character varying(15),
    majcom character varying(3),
    theater character varying(7),
    niin_type character varying(1),
    frequency character varying(12),
    count_of_months bigint,
    vtm numeric(34,16),
    afnwc_group character varying(11),
    afnwc_system character varying(15),
    ne character varying(5),
    vmr character varying(10),
    demands character varying(6),
    srd_yn boolean,
    sos character varying(3),
    tdd character varying(13),
    date2 bigint,
    four16th character varying(8),
    scms character varying(8),
    scmg character varying(8),
    manager_review_code character varying(1),
    ro_fill numeric(38,18),
    ro numeric(6,1),
    sor character varying(5),
    mx_group character varying(4),
    shop character varying(16),
    mx_group_description character varying(11),
    ro_bucket character varying(7),
    sa numeric(6,1),
    key character varying(17),
    back_order bigint,
    month bigint
);


ALTER TABLE afsc448_public.field_ort_bo_old OWNER TO postgres;

--
-- Name: field_ortorder_backorder; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.field_ortorder_backorder (
    date timestamp without time zone,
    niin text,
    "fielddate" bigint,
    fieldsran bigint,
    fieldpipe character varying(1),
    fieldorders bigint,
    fieldordered_qty bigint,
    fieldtdd_buckets character varying(13),
    fieldort_buckets character varying(10),
    fieldfsg bigint,
    fieldmd character varying(9),
    fieldmds character varying(6),
    fieldmajcom character varying(3),
    fieldtheater character varying(7),
    fieldniin_type character varying(1),
    fieldfrequency character varying(12),
    fieldcount_of_months bigint,
    fieldsrd character varying(3),
    fieldne character varying(5),
    fieldvmr character varying(10),
    fielddemands character varying(6),
    fieldsrd_yn boolean,
    fieldsos character varying(3),
    fieldtdd character varying(13),
    fielddate2 bigint,
    fieldscms character varying(8),
    fieldscmg character varying(8),
    fieldmanager_review_code character varying(1),
    fieldro bigint,
    fieldsor character varying(5),
    fieldmx_group character varying(4),
    fieldshop character varying(16),
    fieldmx_group_description character varying(11),
    fieldro_bucket character varying(7),
    fieldsa bigint,
    fieldmissile character varying(15),
    fieldvtm numeric(20,9),
    fieldafnwc_group character varying(11),
    fieldafnwc_system character varying(15),
    field416th character varying(8),
    fieldro_fill numeric(20,9),
    month double precision,
    backorder_status integer
);


ALTER TABLE afsc448_public.field_ortorder_backorder OWNER TO postgres;

--
-- Name: field_ortorder_backorder_inventory; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.field_ortorder_backorder_inventory (
    month double precision,
    year double precision,
    serv_assets numeric,
    intransit_reparables numeric,
    f_condition numeric,
    q_condition numeric,
    date timestamp without time zone,
    niin text,
    fieldsran bigint,
    fieldpipe character varying(1),
    fieldorders bigint,
    fieldordered_qty bigint,
    fieldtdd_buckets character varying(13),
    fieldort_buckets character varying(10),
    fieldfsg bigint,
    fieldmd character varying(9),
    fieldmds character varying(6),
    fieldmajcom character varying(3),
    fieldtheater character varying(7),
    fieldniin_type character varying(1),
    fieldfrequency character varying(12),
    fieldcount_of_months bigint,
    fieldsrd character varying(3),
    fieldne character varying(5),
    fieldvmr character varying(10),
    fielddemands character varying(6),
    fieldsrd_yn boolean,
    fieldsos character varying(3),
    fieldtdd character varying(13),
    fielddate2 bigint,
    fieldscms character varying(8),
    fieldscmg character varying(8),
    fieldmanager_review_code character varying(1),
    fieldro bigint,
    fieldsor character varying(5),
    fieldmx_group character varying(4),
    fieldshop character varying(16),
    fieldmx_group_description character varying(11),
    fieldro_bucket character varying(7),
    fieldsa bigint,
    fieldmissile character varying(15),
    fieldvtm numeric(20,9),
    fieldafnwc_group character varying(11),
    fieldafnwc_system character varying(15),
    field416th character varying(8),
    fieldro_fill numeric(20,9),
    backorder_status integer
);


ALTER TABLE afsc448_public.field_ortorder_backorder_inventory OWNER TO postgres;

--
-- Name: filtered_bo; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.filtered_bo (
    index bigint,
    pdn text,
    nsn_caller bigint,
    niin bigint,
    mmac text,
    errc text,
    rfm_noun text,
    sos_caller text,
    im text,
    es text,
    aac text,
    cc text,
    ui text,
    cost double precision,
    opcode text,
    qpa bigint,
    f bigint,
    tinkerassets bigint,
    mm bigint,
    dlaassets bigint,
    mkshr double precision,
    issueseight bigint,
    stklevel bigint,
    speclevel bigint,
    duein bigint,
    dueout bigint,
    smartmdr double precision,
    pr bigint,
    contract bigint,
    overdue bigint,
    pn text,
    plt bigint,
    alt bigint,
    psc text,
    saic bigint,
    masternsn bigint,
    master_niin bigint,
    shopid bigint,
    model_desc text,
    module_desc text,
    series_desc text,
    data_month timestamp without time zone,
    sos_other text,
    sran bigint,
    base_backorder_flag boolean,
    sos_sgm text,
    pseudo_division text,
    inv_mgt_specialist text,
    budget_code text,
    nimsc text,
    ws_type text,
    ws_group text,
    ws_design text,
    equipment_designator text,
    srd text,
    nsn_other text,
    errc_code text,
    cwt_10_day_rule_flag text,
    cwt_partial_flag boolean,
    pipeline_document_number text,
    customer_request_document_number text,
    requisition_document_number text,
    activity_code text,
    maj_com text,
    customer_order_date timestamp without time zone,
    requisition_date timestamp without time zone,
    sep10_age text,
    aug10_age text,
    jul10_age text,
    jun10_age text,
    may10_age text,
    apr10_age text,
    mar10_age text,
    feb10_age text,
    jan10_age text,
    dec09_age text,
    nov09_age text,
    oct09_age text,
    cwt_status text,
    issue_priority_group bigint,
    issue_priority___ujc text,
    requisition_priority_code text,
    project_code text,
    alc text,
    rcc text,
    base_name text,
    ordered_qty double precision,
    "To_Date_100%_CWT_Days" double precision,
    to_date_weighted_avg_cwt_days double precision
);


ALTER TABLE afsc448_public.filtered_bo OWNER TO postgres;

--
-- Name: g004l_data; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.g004l_data (
    actual_niin bigint,
    time_stamp character varying(28),
    date timestamp without time zone,
    fsc character varying(4),
    mc character varying(210),
    ei_config_cd bigint,
    errc_cd character varying(11),
    nomenclature character varying(8),
    planning_tech character varying(6),
    wrkldr_tech character varying(5),
    pssd character varying(6),
    control_num bigint,
    job_designator character varying(10),
    job_suffix character varying(3),
    data_proces_cd character varying(10),
    im_clerk character varying(20),
    procurement_src character varying(10),
    program_control_num character varying(6),
    proj_order_num bigint,
    fcrn_future character varying(4),
    fcrn character varying(4),
    priority_cd character varying(20),
    jon_class character varying(10),
    jon_class_future character varying(10),
    min_trans_auth character varying(10),
    jon_class_spprt character varying(10),
    prod_cnt character varying(10),
    prod_cnt_future character varying(10),
    cost_class bigint,
    jon_status bigint,
    prod_delay_cd character varying(10),
    dt_established bigint,
    dt_last_action bigint,
    del_code character varying(10),
    unit_of_meas character varying(20),
    serial_num character varying(6),
    mon_sales_cd character varying(10),
    dt_induction character varying(7),
    dt_completion character varying(7),
    ei_sales_price bigint,
    ei_labor_rate numeric(8,1),
    hr_sales_rate numeric(4,1),
    dpeh_qty numeric(31,1),
    earned_hrs_qty numeric(31,1),
    fiscal_yr_cd bigint,
    yr_ord_qty bigint,
    yr_ord_qty_future bigint,
    remaining_ord_qty bigint,
    awm_qty bigint,
    awm_qty_sup_gen bigint,
    awm_qty_non_sup_gen bigint,
    awp_qty bigint,
    awp_qty_sup_gen bigint,
    awp_qty_non_sup_gen bigint,
    jon_induct_qty bigint,
    jon_induct_qty_sup_gen bigint,
    jon_induct_qty_non_sup_gen bigint,
    jon_comp_qty bigint,
    jon_comp_qty_sup_gen bigint,
    jon_comp_qty_non_sup_gen bigint,
    jon_owo_qty_sup_gen bigint,
    jon_owo_qty_non_sup_gen bigint,
    induct_qty_sup_gen bigint,
    induct_qty_non_sup_gen bigint,
    serv_comp_qty_sup_gen bigint,
    serv_comp_qty_non_sup_gen bigint,
    induct_qty_sup_gen_mon bigint,
    induct_qty_non_sup_gen_mon bigint,
    serv_comp_qty_sup_gen_mon bigint,
    serv_comp_qty_non_sup_gen_mon bigint,
    induct_qty_sup_gen_qtr bigint,
    induct_qty_non_sup_gen_qtr bigint,
    serv_comp_qty_sup_gen_qtr bigint,
    serv_comp_qty_non_sup_gen_qtr bigint,
    condemn_qty bigint,
    rep_gen_qty bigint,
    condemn_qty_sup_gen bigint,
    condemn_qty_non_sup_gen bigint,
    unserv_ltd_restore_qty bigint,
    unserv_incomplete_qty bigint,
    unserv_condemned_qty bigint,
    unserv_complete_qty bigint,
    jon_indicator character varying(10),
    alc_code character varying(20)
);


ALTER TABLE afsc448_public.g004l_data OWNER TO postgres;

--
-- Name: gcss_bobj_d043_niins; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.gcss_bobj_d043_niins (
    nsn text,
    fsc integer,
    niin text,
    mmac text,
    nomenclature text,
    niin_sgm integer,
    niin_family_master integer,
    errc text,
    aac text,
    acq_method_code integer,
    acq_method_suffix_code text,
    sos text,
    im_office_symbol text,
    budget_code text,
    div_manager_designator_code text,
    mdc_code text,
    im_name text,
    equipment_specialist_code text,
    standard_price numeric,
    lac text,
    order_of_use_code text,
    "group" text,
    squadron text,
    application_data_desc text,
    id integer NOT NULL
);


ALTER TABLE afsc448_public.gcss_bobj_d043_niins OWNER TO postgres;

--
-- Name: gcss_bobj_d043_niins_id_seq; Type: SEQUENCE; Schema: afsc448_public; Owner: postgres
--

CREATE SEQUENCE afsc448_public.gcss_bobj_d043_niins_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE afsc448_public.gcss_bobj_d043_niins_id_seq OWNER TO postgres;

--
-- Name: gcss_bobj_d043_niins_id_seq; Type: SEQUENCE OWNED BY; Schema: afsc448_public; Owner: postgres
--

ALTER SEQUENCE afsc448_public.gcss_bobj_d043_niins_id_seq OWNED BY afsc448_public.gcss_bobj_d043_niins.id;


--
-- Name: hq_bill_of_materials; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.hq_bill_of_materials (
    niin_id bigint,
    actual_niin bigint,
    comp_niin character varying(9),
    comp_fsc bigint,
    comp_mmc character varying(2),
    alc_location character varying(2),
    pdn character varying(6),
    planner character varying(6),
    mgr_code character varying(2),
    bud_code character varying(1),
    unit_of_issue character varying(2),
    cust_code character varying(1),
    errc character varying(1),
    smc character varying(4),
    unit_cost numeric(11,2),
    occ_fac bigint,
    qpa bigint,
    std_rpl bigint,
    act_rpl bigint,
    curr_prod bigint,
    qtr1_prod bigint,
    qtr2_prod bigint,
    qtr3_prod bigint,
    qtr4_prod bigint,
    qtr5_prod bigint,
    qtr6_prod bigint,
    qtr7_prod bigint,
    curr_issue bigint,
    qtr1_issue bigint,
    qtr2_issue bigint,
    qtr3_issue bigint,
    qtr4_issue bigint,
    qtr5_issue bigint,
    qtr6_issue bigint,
    qtr7_issue bigint,
    include_component_switch bigint,
    time_stamp character varying(28),
    date timestamp without time zone
);


ALTER TABLE afsc448_public.hq_bill_of_materials OWNER TO postgres;

--
-- Name: hq_depot_name; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.hq_depot_name (
    alc_location character varying(2),
    sos_alc character varying(2),
    sran character varying(6),
    alc_name character varying(24),
    router_id character varying(3),
    sos_checkbook numeric(14,2),
    sos_remain_days bigint,
    funding_k_factor numeric(6,2),
    percent_avail numeric(6,2),
    cum_avail numeric(12,2),
    fund_appl_sw bigint,
    h103_date bigint,
    h103_time bigint,
    time_stamp character varying(28),
    date timestamp without time zone
);


ALTER TABLE afsc448_public.hq_depot_name OWNER TO postgres;

--
-- Name: hq_spt_results; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.hq_spt_results (
    execution_date character varying(28),
    niin_id bigint,
    row_index bigint,
    sran character varying(6),
    sgm_nsn character varying(15),
    item_manager_code character varying(3),
    noun character varying(10),
    pdn character varying(6),
    repair_res_code character varying(8),
    carc_avail character varying(11),
    parts_avail character varying(11),
    hours_avail character varying(11),
    funds_avail character varying(11),
    sort_value character varying(21),
    spaws_rank bigint,
    ws_category character varying(12),
    sprs_seq bigint,
    item_count bigint,
    buffer_hours_avail character varying(11),
    sos_alc character varying(2),
    sor_alc character varying(2),
    original_compout_nsn character varying(15),
    supply_chain_manager character varying(4),
    actual_nsn character varying(15),
    date timestamp without time zone,
    prob_repair character varying(150),
    pap numeric(10,4),
    repair_cost numeric(11,2),
    repair_hours numeric(8,2),
    sprt_ind numeric(4,1),
    slimm_pap numeric(6,2)
);


ALTER TABLE afsc448_public.hq_spt_results OWNER TO postgres;

--
-- Name: indenture; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.indenture (
    niin_id bigint,
    niin_id_sru bigint,
    qpa bigint,
    common_sru_sw bigint,
    minimum_qpa bigint,
    depot_repl_frac bigint,
    cirf_repl_frac bigint,
    base_repl_frac bigint,
    time_stamp character varying(28),
    date timestamp without time zone
);


ALTER TABLE afsc448_public.indenture OWNER TO postgres;

--
-- Name: insurance_model_landing; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.insurance_model_landing (
    contracted_name character varying(4096),
    contracted_address character varying(4096),
    city character varying(4096),
    state character varying(4096),
    zip character varying(4096),
    personal_responsibility_score character varying(4096),
    native_tier integer,
    adjusted_tier integer,
    consumer_credit_score integer,
    home_equityindicator character varying(4096),
    mortgageor_refinance_date character varying(4096),
    home_equity_loan_amountin100 character varying(4096),
    current_loanto_value_ratio character varying(4096),
    home_value character varying(4096),
    income_trigger integer,
    new_income_rank integer,
    new_numberof_credit_cards_ran integer,
    advantage_target_income30 integer,
    liquid_resources integer,
    investment_resources integer,
    mortgage_liability integer,
    average_home_market_value integer,
    average_home_market_value2 character varying(4096)
);


ALTER TABLE afsc448_public.insurance_model_landing OWNER TO postgres;

--
-- Name: inventory_backorder_tf33; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.inventory_backorder_tf33 (
    year double precision,
    month double precision,
    loc character varying(3),
    niin bigint,
    assets numeric,
    f_cond numeric,
    total_bo bigint
);


ALTER TABLE afsc448_public.inventory_backorder_tf33 OWNER TO postgres;

--
-- Name: inventorytf33_dated; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.inventorytf33_dated (
    location text,
    serv_assets integer,
    f_condition integer,
    actual_niin integer,
    date text,
    month integer,
    year integer
);


ALTER TABLE afsc448_public.inventorytf33_dated OWNER TO postgres;

--
-- Name: low_percent_ws; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.low_percent_ws (
    ws_category character varying(12),
    sor_sos_total_cost numeric(12,3),
    target_ws_percent character varying(12),
    sor_total_cost numeric(12,3),
    time_stamp character varying(28),
    date timestamp without time zone
);


ALTER TABLE afsc448_public.low_percent_ws OWNER TO postgres;

--
-- Name: most_act_lag; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.most_act_lag (
    act_lag_sum numeric,
    std_lag_sum numeric,
    actual_niin character varying(30),
    comp_niin character varying(9),
    pdn character varying(6)
);


ALTER TABLE afsc448_public.most_act_lag OWNER TO postgres;

--
-- Name: mster_metric; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.mster_metric (
    fsc character varying(15),
    sgm_niin character varying(15),
    mmac character varying(2),
    noun character varying(19),
    smc character varying(4),
    budget_code character varying(1),
    bpcd character varying(2),
    sos_alc character varying(2),
    groupfield character varying(10),
    squadron character varying(10),
    ims character varying(3),
    es character varying(3),
    item_category_code character varying(1),
    errc character varying(1),
    fic character varying(3),
    ipsc character varying(4),
    oc_sor_per bigint,
    oo_sor_per bigint,
    wr_sor_per bigint,
    ct_sor_per bigint,
    sa_sor_per bigint,
    sm_sor_per bigint,
    dm_sor_per bigint,
    ot_sor_per bigint,
    un_sor_per bigint,
    four_qtr_total_base_nrts bigint,
    eight_qtr_total_base_nrts bigint,
    bnrts1 bigint,
    bnrts2 bigint,
    bnrts3 bigint,
    bnrts4 bigint,
    bnrts5 bigint,
    bnrts6 bigint,
    bnrts7 bigint,
    bnrts8 bigint,
    four_qtr_total_base_rts bigint,
    eight_qtr_total_base_rts bigint,
    brts1 bigint,
    brts2 bigint,
    brts3 bigint,
    brts4 bigint,
    brts5 bigint,
    brts6 bigint,
    brts7 bigint,
    brts8 bigint,
    four_qtr_total_base_cndmn bigint,
    eight_qtr_total_base_cndmn bigint,
    bcond1 bigint,
    bcond2 bigint,
    bcond3 bigint,
    bcond4 bigint,
    bcond5 bigint,
    bcond6 bigint,
    bcond7 bigint,
    bcond8 bigint,
    four_qtr_total_base_repgens bigint,
    eight_qtr_total_base_repgens bigint,
    baserepgens1 bigint,
    baserepgens2 bigint,
    baserepgens3 bigint,
    baserepgens4 bigint,
    baserepgens5 bigint,
    baserepgens6 bigint,
    baserepgens7 bigint,
    baserepgens8 bigint,
    four_qtr_total_dep_repgens bigint,
    eight_qtr_total_dep_repgens bigint,
    deprepgens1 bigint,
    deprepgens2 bigint,
    deprepgens3 bigint,
    deprepgens4 bigint,
    deprepgens5 bigint,
    deprepgens6 bigint,
    deprepgens7 bigint,
    deprepgens8 bigint,
    four_qtr_total_mistr_rpr bigint,
    eight_qtr_total_mistr_rpr bigint,
    mistrrpr1 bigint,
    mistrrpr2 bigint,
    mistrrpr3 bigint,
    mistrrpr4 bigint,
    mistrrpr5 bigint,
    mistrrpr6 bigint,
    mistrrpr7 bigint,
    mistrrpr8 bigint,
    four_qtr_total_mistr_cndmn bigint,
    eight_qtr_total_mistr_cndmn bigint,
    mistrcond1 bigint,
    mistrcond2 bigint,
    mistrcond3 bigint,
    mistrcond4 bigint,
    mistrcond5 bigint,
    mistrcond6 bigint,
    mistrcond7 bigint,
    mistrcond8 bigint,
    four_qtr_total_dep_cndmn_tot bigint,
    eight_qtr_total_dep_cndmn_tot bigint,
    depcond1 bigint,
    depcond2 bigint,
    depcond3 bigint,
    depcond4 bigint,
    depcond5 bigint,
    depcond6 bigint,
    depcond7 bigint,
    depcond8 bigint,
    four_qtr_total_oim bigint,
    four_qtr_total_pdm bigint,
    four_qtr_total_eng_oh bigint,
    four_qtr_total_nha_mistr bigint,
    eight_qtr_total_oim bigint,
    eight_qtr_total_pdm bigint,
    eight_qtr_total_eng_oh bigint,
    eight_qtr_total_nha_mistr bigint,
    cy_forecasted_base_rts bigint,
    cy_forecasted_base_nrts bigint,
    cy_forecasted_base_cndmn bigint,
    ay_forecasted_base_rts bigint,
    ay_forecasted_base_nrts bigint,
    ay_forecasted_base_cndmn bigint,
    ay_oim_future_program bigint,
    ay_pdm_njr_rqmt bigint,
    ay_pdm_njr_program bigint,
    ay_pdm_jr_conds bigint,
    ay_pdm_jr_program bigint,
    ay_eoh_njr_rqmt bigint,
    ay_eoh_njr_program bigint,
    ay_eoh_jr_conds bigint,
    ay_eoh_jr_program bigint,
    ay_nha_mistr_njr_rqmt bigint,
    ay_nha_mistr_njr_program bigint,
    ay_nha_mistr_jr_conds bigint,
    ay_nha_mistr_jr_program bigint,
    by_forecasted_base_rts bigint,
    by_forecasted_base_nrts bigint,
    by_forecasted_base_cndmn bigint,
    by_oim_future_program bigint,
    by_pdm_njr_rqmt bigint,
    by_pdm_njr_program bigint,
    by_pdm_jr_conds bigint,
    by_pdm_jr_program bigint,
    by_eoh_njr_rqmt bigint,
    by_eoh_njr_program bigint,
    by_eoh_jr_conds bigint,
    by_eoh_jr_program bigint,
    by_nha_mistr_njr_rqmt bigint,
    by_nha_mistr_njr_program bigint,
    by_nha_mistr_jr_conds bigint,
    by_nha_mistr_jr_program bigint,
    ey_forecasted_base_rts bigint,
    ey_forecasted_base_nrts bigint,
    ey_forecasted_base_cndmn bigint,
    ey_oim_future_program bigint,
    ey_pdm_njr_rqmt bigint,
    ey_pdm_njr_program bigint,
    ey_pdm_jr_conds bigint,
    ey_pdm_jr_program bigint,
    ey_eoh_njr_rqmt bigint,
    ey_eoh_njr_program bigint,
    ey_eoh_jr_conds bigint,
    ey_eoh_jr_program bigint,
    ey_nha_mistr_njr_rqmt bigint,
    ey_nha_mistr_njr_program bigint,
    ey_nha_mistr_jr_conds bigint,
    ey_nha_mistr_jr_program bigint,
    "Group" character varying(10),
    four_qtr_total_base_nrts_1 bigint,
    eight_qtr_total_base_nrts_1 bigint,
    four_qtr_total_base_rts_1 bigint,
    eight_qtr_total_base_rts_1 bigint,
    four_qtr_total_base_cndmn_1 bigint,
    eight_qtr_total_base_cndmn_1 bigint,
    four_qtr_total_base_repgens_1 bigint,
    eight_qtr_total_base_repgens_1 bigint,
    four_qtr_total_dep_repgens_1 bigint,
    eight_qtr_total_dep_repgens_1 bigint,
    four_qtr_total_mistr_rpr_1 bigint,
    eight_qtr_total_mistr_rpr_1 bigint,
    four_qtr_total_mistr_cndmn_1 bigint,
    eight_qtr_total_mistr_cndmn_1 bigint,
    four_qtr_total_dep_cndmn_tot_1 bigint,
    eight_qtr_total_dep_cndmn_tot_1 bigint,
    four_qtr_total_oim_1 bigint,
    four_qtr_total_pdm_1 bigint,
    four_qtr_total_eng_oh_1 bigint,
    four_qtr_total_nha_mistr_1 bigint,
    eight_qtr_total_oim_1 bigint,
    eight_qtr_total_pdm_1 bigint,
    eight_qtr_total_eng_oh_1 bigint,
    eight_qtr_total_nha_mistr_1 bigint,
    snapshot_date date
);


ALTER TABLE afsc448_public.mster_metric OWNER TO postgres;

--
-- Name: mster_metric_lag; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.mster_metric_lag (
    fsc character varying(15),
    sgm_niin character varying(15),
    mmac character varying(2),
    noun character varying(19),
    smc character varying(4),
    budget_code character varying(1),
    bpcd character varying(2),
    sos_alc character varying(2),
    groupfield character varying(10),
    squadron character varying(10),
    ims character varying(3),
    es character varying(3),
    item_category_code character varying(1),
    errc character varying(1),
    fic character varying(3),
    ipsc character varying(4),
    oc_sor_per bigint,
    oo_sor_per bigint,
    wr_sor_per bigint,
    ct_sor_per bigint,
    sa_sor_per bigint,
    sm_sor_per bigint,
    dm_sor_per bigint,
    ot_sor_per bigint,
    un_sor_per bigint,
    four_qtr_total_base_nrts bigint,
    eight_qtr_total_base_nrts bigint,
    bnrts1 bigint,
    bnrts2 bigint,
    bnrts3 bigint,
    bnrts4 bigint,
    bnrts5 bigint,
    bnrts6 bigint,
    bnrts7 bigint,
    bnrts8 bigint,
    four_qtr_total_base_rts bigint,
    eight_qtr_total_base_rts bigint,
    brts1 bigint,
    brts2 bigint,
    brts3 bigint,
    brts4 bigint,
    brts5 bigint,
    brts6 bigint,
    brts7 bigint,
    brts8 bigint,
    four_qtr_total_base_cndmn bigint,
    eight_qtr_total_base_cndmn bigint,
    bcond1 bigint,
    bcond2 bigint,
    bcond3 bigint,
    bcond4 bigint,
    bcond5 bigint,
    bcond6 bigint,
    bcond7 bigint,
    bcond8 bigint,
    four_qtr_total_base_repgens bigint,
    eight_qtr_total_base_repgens bigint,
    baserepgens1 bigint,
    baserepgens2 bigint,
    baserepgens3 bigint,
    baserepgens4 bigint,
    baserepgens5 bigint,
    baserepgens6 bigint,
    baserepgens7 bigint,
    baserepgens8 bigint,
    four_qtr_total_dep_repgens bigint,
    eight_qtr_total_dep_repgens bigint,
    deprepgens1 bigint,
    deprepgens2 bigint,
    deprepgens3 bigint,
    deprepgens4 bigint,
    deprepgens5 bigint,
    deprepgens6 bigint,
    deprepgens7 bigint,
    deprepgens8 bigint,
    four_qtr_total_mistr_rpr bigint,
    eight_qtr_total_mistr_rpr bigint,
    mistrrpr1 bigint,
    mistrrpr2 bigint,
    mistrrpr3 bigint,
    mistrrpr4 bigint,
    mistrrpr5 bigint,
    mistrrpr6 bigint,
    mistrrpr7 bigint,
    mistrrpr8 bigint,
    four_qtr_total_mistr_cndmn bigint,
    eight_qtr_total_mistr_cndmn bigint,
    mistrcond1 bigint,
    mistrcond2 bigint,
    mistrcond3 bigint,
    mistrcond4 bigint,
    mistrcond5 bigint,
    mistrcond6 bigint,
    mistrcond7 bigint,
    mistrcond8 bigint,
    four_qtr_total_dep_cndmn_tot bigint,
    eight_qtr_total_dep_cndmn_tot bigint,
    depcond1 bigint,
    depcond2 bigint,
    depcond3 bigint,
    depcond4 bigint,
    depcond5 bigint,
    depcond6 bigint,
    depcond7 bigint,
    depcond8 bigint,
    four_qtr_total_oim bigint,
    four_qtr_total_pdm bigint,
    four_qtr_total_eng_oh bigint,
    four_qtr_total_nha_mistr bigint,
    eight_qtr_total_oim bigint,
    eight_qtr_total_pdm bigint,
    eight_qtr_total_eng_oh bigint,
    eight_qtr_total_nha_mistr bigint,
    cy_forecasted_base_rts bigint,
    cy_forecasted_base_nrts bigint,
    cy_forecasted_base_cndmn bigint,
    ay_forecasted_base_rts bigint,
    ay_forecasted_base_nrts bigint,
    ay_forecasted_base_cndmn bigint,
    ay_oim_future_program bigint,
    ay_pdm_njr_rqmt bigint,
    ay_pdm_njr_program bigint,
    ay_pdm_jr_conds bigint,
    ay_pdm_jr_program bigint,
    ay_eoh_njr_rqmt bigint,
    ay_eoh_njr_program bigint,
    ay_eoh_jr_conds bigint,
    ay_eoh_jr_program bigint,
    ay_nha_mistr_njr_rqmt bigint,
    ay_nha_mistr_njr_program bigint,
    ay_nha_mistr_jr_conds bigint,
    ay_nha_mistr_jr_program bigint,
    by_forecasted_base_rts bigint,
    by_forecasted_base_nrts bigint,
    by_forecasted_base_cndmn bigint,
    by_oim_future_program bigint,
    by_pdm_njr_rqmt bigint,
    by_pdm_njr_program bigint,
    by_pdm_jr_conds bigint,
    by_pdm_jr_program bigint,
    by_eoh_njr_rqmt bigint,
    by_eoh_njr_program bigint,
    by_eoh_jr_conds bigint,
    by_eoh_jr_program bigint,
    by_nha_mistr_njr_rqmt bigint,
    by_nha_mistr_njr_program bigint,
    by_nha_mistr_jr_conds bigint,
    by_nha_mistr_jr_program bigint,
    ey_forecasted_base_rts bigint,
    ey_forecasted_base_nrts bigint,
    ey_forecasted_base_cndmn bigint,
    ey_oim_future_program bigint,
    ey_pdm_njr_rqmt bigint,
    ey_pdm_njr_program bigint,
    ey_pdm_jr_conds bigint,
    ey_pdm_jr_program bigint,
    ey_eoh_njr_rqmt bigint,
    ey_eoh_njr_program bigint,
    ey_eoh_jr_conds bigint,
    ey_eoh_jr_program bigint,
    ey_nha_mistr_njr_rqmt bigint,
    ey_nha_mistr_njr_program bigint,
    ey_nha_mistr_jr_conds bigint,
    ey_nha_mistr_jr_program bigint,
    "Group" character varying(10),
    four_qtr_total_base_nrts_1 bigint,
    eight_qtr_total_base_nrts_1 bigint,
    four_qtr_total_base_rts_1 bigint,
    eight_qtr_total_base_rts_1 bigint,
    four_qtr_total_base_cndmn_1 bigint,
    eight_qtr_total_base_cndmn_1 bigint,
    four_qtr_total_base_repgens_1 bigint,
    eight_qtr_total_base_repgens_1 bigint,
    four_qtr_total_dep_repgens_1 bigint,
    eight_qtr_total_dep_repgens_1 bigint,
    four_qtr_total_mistr_rpr_1 bigint,
    eight_qtr_total_mistr_rpr_1 bigint,
    four_qtr_total_mistr_cndmn_1 bigint,
    eight_qtr_total_mistr_cndmn_1 bigint,
    four_qtr_total_dep_cndmn_tot_1 bigint,
    eight_qtr_total_dep_cndmn_tot_1 bigint,
    four_qtr_total_oim_1 bigint,
    four_qtr_total_pdm_1 bigint,
    four_qtr_total_eng_oh_1 bigint,
    four_qtr_total_nha_mistr_1 bigint,
    eight_qtr_total_oim_1 bigint,
    eight_qtr_total_pdm_1 bigint,
    eight_qtr_total_eng_oh_1 bigint,
    eight_qtr_total_nha_mistr_1 bigint,
    snapshot_date date,
    four_qtr_total_base_cndmn_lag bigint,
    eight_qtr_total_base_cndmn_lag bigint,
    four_qtr_total_mistr_cndmn_lag bigint,
    eight_qtr_total_mistr_cndmn_lag bigint,
    four_qtr_total_dep_cndmn_tot_lag bigint,
    eight_qtr_total_dep_cndmn_tot_lag bigint,
    cy_forecasted_base_cndmn_lag bigint,
    by_forecasted_base_cndmn_lag bigint,
    ey_forecasted_base_cndmn_lag bigint,
    ay_eoh_jr_conds_lag bigint,
    by_eoh_jr_conds_lag bigint,
    ey_eoh_jr_conds_lag bigint
);


ALTER TABLE afsc448_public.mster_metric_lag OWNER TO postgres;

--
-- Name: mster_metric_slope; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.mster_metric_slope (
    fsc character varying(15),
    sgm_niin character varying(15),
    mmac character varying(2),
    noun character varying(19),
    smc character varying(4),
    budget_code character varying(1),
    bpcd character varying(2),
    sos_alc character varying(2),
    groupfield character varying(10),
    squadron character varying(10),
    ims character varying(3),
    es character varying(3),
    item_category_code character varying(1),
    errc character varying(1),
    fic character varying(3),
    ipsc character varying(4),
    oc_sor_per bigint,
    oo_sor_per bigint,
    wr_sor_per bigint,
    ct_sor_per bigint,
    sa_sor_per bigint,
    sm_sor_per bigint,
    dm_sor_per bigint,
    ot_sor_per bigint,
    un_sor_per bigint,
    four_qtr_total_base_nrts bigint,
    eight_qtr_total_base_nrts bigint,
    bnrts1 bigint,
    bnrts2 bigint,
    bnrts3 bigint,
    bnrts4 bigint,
    bnrts5 bigint,
    bnrts6 bigint,
    bnrts7 bigint,
    bnrts8 bigint,
    four_qtr_total_base_rts bigint,
    eight_qtr_total_base_rts bigint,
    brts1 bigint,
    brts2 bigint,
    brts3 bigint,
    brts4 bigint,
    brts5 bigint,
    brts6 bigint,
    brts7 bigint,
    brts8 bigint,
    four_qtr_total_base_cndmn bigint,
    eight_qtr_total_base_cndmn bigint,
    bcond1 bigint,
    bcond2 bigint,
    bcond3 bigint,
    bcond4 bigint,
    bcond5 bigint,
    bcond6 bigint,
    bcond7 bigint,
    bcond8 bigint,
    four_qtr_total_base_repgens bigint,
    eight_qtr_total_base_repgens bigint,
    baserepgens1 bigint,
    baserepgens2 bigint,
    baserepgens3 bigint,
    baserepgens4 bigint,
    baserepgens5 bigint,
    baserepgens6 bigint,
    baserepgens7 bigint,
    baserepgens8 bigint,
    four_qtr_total_dep_repgens bigint,
    eight_qtr_total_dep_repgens bigint,
    deprepgens1 bigint,
    deprepgens2 bigint,
    deprepgens3 bigint,
    deprepgens4 bigint,
    deprepgens5 bigint,
    deprepgens6 bigint,
    deprepgens7 bigint,
    deprepgens8 bigint,
    four_qtr_total_mistr_rpr bigint,
    eight_qtr_total_mistr_rpr bigint,
    mistrrpr1 bigint,
    mistrrpr2 bigint,
    mistrrpr3 bigint,
    mistrrpr4 bigint,
    mistrrpr5 bigint,
    mistrrpr6 bigint,
    mistrrpr7 bigint,
    mistrrpr8 bigint,
    four_qtr_total_mistr_cndmn bigint,
    eight_qtr_total_mistr_cndmn bigint,
    mistrcond1 bigint,
    mistrcond2 bigint,
    mistrcond3 bigint,
    mistrcond4 bigint,
    mistrcond5 bigint,
    mistrcond6 bigint,
    mistrcond7 bigint,
    mistrcond8 bigint,
    four_qtr_total_dep_cndmn_tot bigint,
    eight_qtr_total_dep_cndmn_tot bigint,
    depcond1 bigint,
    depcond2 bigint,
    depcond3 bigint,
    depcond4 bigint,
    depcond5 bigint,
    depcond6 bigint,
    depcond7 bigint,
    depcond8 bigint,
    four_qtr_total_oim bigint,
    four_qtr_total_pdm bigint,
    four_qtr_total_eng_oh bigint,
    four_qtr_total_nha_mistr bigint,
    eight_qtr_total_oim bigint,
    eight_qtr_total_pdm bigint,
    eight_qtr_total_eng_oh bigint,
    eight_qtr_total_nha_mistr bigint,
    cy_forecasted_base_rts bigint,
    cy_forecasted_base_nrts bigint,
    cy_forecasted_base_cndmn bigint,
    ay_forecasted_base_rts bigint,
    ay_forecasted_base_nrts bigint,
    ay_forecasted_base_cndmn bigint,
    ay_oim_future_program bigint,
    ay_pdm_njr_rqmt bigint,
    ay_pdm_njr_program bigint,
    ay_pdm_jr_conds bigint,
    ay_pdm_jr_program bigint,
    ay_eoh_njr_rqmt bigint,
    ay_eoh_njr_program bigint,
    ay_eoh_jr_conds bigint,
    ay_eoh_jr_program bigint,
    ay_nha_mistr_njr_rqmt bigint,
    ay_nha_mistr_njr_program bigint,
    ay_nha_mistr_jr_conds bigint,
    ay_nha_mistr_jr_program bigint,
    by_forecasted_base_rts bigint,
    by_forecasted_base_nrts bigint,
    by_forecasted_base_cndmn bigint,
    by_oim_future_program bigint,
    by_pdm_njr_rqmt bigint,
    by_pdm_njr_program bigint,
    by_pdm_jr_conds bigint,
    by_pdm_jr_program bigint,
    by_eoh_njr_rqmt bigint,
    by_eoh_njr_program bigint,
    by_eoh_jr_conds bigint,
    by_eoh_jr_program bigint,
    by_nha_mistr_njr_rqmt bigint,
    by_nha_mistr_njr_program bigint,
    by_nha_mistr_jr_conds bigint,
    by_nha_mistr_jr_program bigint,
    ey_forecasted_base_rts bigint,
    ey_forecasted_base_nrts bigint,
    ey_forecasted_base_cndmn bigint,
    ey_oim_future_program bigint,
    ey_pdm_njr_rqmt bigint,
    ey_pdm_njr_program bigint,
    ey_pdm_jr_conds bigint,
    ey_pdm_jr_program bigint,
    ey_eoh_njr_rqmt bigint,
    ey_eoh_njr_program bigint,
    ey_eoh_jr_conds bigint,
    ey_eoh_jr_program bigint,
    ey_nha_mistr_njr_rqmt bigint,
    ey_nha_mistr_njr_program bigint,
    ey_nha_mistr_jr_conds bigint,
    ey_nha_mistr_jr_program bigint,
    "Group" character varying(10),
    four_qtr_total_base_nrts_1 bigint,
    eight_qtr_total_base_nrts_1 bigint,
    four_qtr_total_base_rts_1 bigint,
    eight_qtr_total_base_rts_1 bigint,
    four_qtr_total_base_cndmn_1 bigint,
    eight_qtr_total_base_cndmn_1 bigint,
    four_qtr_total_base_repgens_1 bigint,
    eight_qtr_total_base_repgens_1 bigint,
    four_qtr_total_dep_repgens_1 bigint,
    eight_qtr_total_dep_repgens_1 bigint,
    four_qtr_total_mistr_rpr_1 bigint,
    eight_qtr_total_mistr_rpr_1 bigint,
    four_qtr_total_mistr_cndmn_1 bigint,
    eight_qtr_total_mistr_cndmn_1 bigint,
    four_qtr_total_dep_cndmn_tot_1 bigint,
    eight_qtr_total_dep_cndmn_tot_1 bigint,
    four_qtr_total_oim_1 bigint,
    four_qtr_total_pdm_1 bigint,
    four_qtr_total_eng_oh_1 bigint,
    four_qtr_total_nha_mistr_1 bigint,
    eight_qtr_total_oim_1 bigint,
    eight_qtr_total_pdm_1 bigint,
    eight_qtr_total_eng_oh_1 bigint,
    eight_qtr_total_nha_mistr_1 bigint,
    snapshot_date date,
    four_qtr_total_base_cndmn_lag bigint,
    eight_qtr_total_base_cndmn_lag bigint,
    four_qtr_total_mistr_cndmn_lag bigint,
    eight_qtr_total_mistr_cndmn_lag bigint,
    four_qtr_total_dep_cndmn_tot_lag bigint,
    eight_qtr_total_dep_cndmn_tot_lag bigint,
    cy_forecasted_base_cndmn_lag bigint,
    by_forecasted_base_cndmn_lag bigint,
    ey_forecasted_base_cndmn_lag bigint,
    ay_eoh_jr_conds_lag bigint,
    by_eoh_jr_conds_lag bigint,
    ey_eoh_jr_conds_lag bigint,
    slope numeric
);


ALTER TABLE afsc448_public.mster_metric_slope OWNER TO postgres;

--
-- Name: new_buys; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.new_buys (
    niin_id bigint,
    date_due_in character varying(28),
    balance_due_in bigint,
    time_stamp character varying(28),
    date timestamp without time zone
);


ALTER TABLE afsc448_public.new_buys OWNER TO postgres;

--
-- Name: niin_percent; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.niin_percent (
    niin_id bigint,
    sran character varying(6),
    ws_category character varying(12),
    ws_index bigint,
    peace_flying_hours numeric(4,1),
    niin_sran_percent numeric(12,5),
    niin_ws_percent character varying(7),
    time_stamp character varying(28),
    date timestamp without time zone
);


ALTER TABLE afsc448_public.niin_percent OWNER TO postgres;

--
-- Name: nsn_niin_id_xref; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.nsn_niin_id_xref (
    nsn character varying(15),
    niin_id bigint,
    least_preferred_nsn character varying(15),
    time_stamp character varying(28),
    date timestamp without time zone
);


ALTER TABLE afsc448_public.nsn_niin_id_xref OWNER TO postgres;

--
-- Name: one_snapshot.filtered_bo; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public."one_snapshot.filtered_bo" (
    index bigint,
    pdn text,
    nsn_caller bigint,
    niin bigint,
    mmac text,
    errc text,
    rfm_noun text,
    sos_caller text,
    im text,
    es text,
    aac text,
    cc text,
    ui text,
    cost double precision,
    opcode text,
    qpa bigint,
    f bigint,
    tinkerassets bigint,
    mm bigint,
    dlaassets bigint,
    mkshr double precision,
    issueseight bigint,
    stklevel bigint,
    speclevel bigint,
    duein bigint,
    dueout bigint,
    smartmdr double precision,
    pr bigint,
    contract bigint,
    overdue bigint,
    pn text,
    plt bigint,
    alt bigint,
    psc text,
    saic bigint,
    masternsn bigint,
    master_niin bigint,
    shopid bigint,
    model_desc text,
    module_desc text,
    series_desc text,
    data_month timestamp without time zone,
    sos_other text,
    sran bigint,
    base_backorder_flag boolean,
    sos_sgm text,
    pseudo_division text,
    inv_mgt_specialist text,
    budget_code text,
    nimsc text,
    ws_type text,
    ws_group text,
    ws_design text,
    equipment_designator text,
    srd text,
    nsn_other text,
    errc_code text,
    cwt_10_day_rule_flag text,
    cwt_partial_flag boolean,
    pipeline_document_number text,
    customer_request_document_number text,
    requisition_document_number text,
    activity_code text,
    maj_com text,
    customer_order_date timestamp without time zone,
    requisition_date timestamp without time zone,
    sep10_age text,
    aug10_age text,
    jul10_age text,
    jun10_age text,
    may10_age text,
    apr10_age text,
    mar10_age text,
    feb10_age text,
    jan10_age text,
    dec09_age text,
    nov09_age text,
    oct09_age text,
    cwt_status text,
    issue_priority_group bigint,
    issue_priority___ujc text,
    requisition_priority_code text,
    project_code text,
    alc text,
    rcc text,
    base_name text,
    ordered_qty double precision,
    "To_Date_100%_CWT_Days" double precision,
    to_date_weighted_avg_cwt_days double precision
);


ALTER TABLE afsc448_public."one_snapshot.filtered_bo" OWNER TO postgres;

--
-- Name: open_source_otd; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.open_source_otd (
    id text,
    cmo text,
    team text,
    isw text,
    contractor text,
    cage text,
    buying_activity text,
    contract_number text,
    section text,
    prod_surv_cd text,
    surv_criticality_cd text,
    commodity_code text,
    clin text,
    clin_due_date text,
    line_item_balanced text,
    contractor_responsibility_date text,
    contract_due_date text,
    inspection_acceptance text,
    facility text,
    dlvy_sched_qty numeric,
    "SCHED QTY SHIPPED" text,
    delinquent text,
    qty_variance_under text,
    nsn text,
    noun text,
    part_number text,
    weapons_system_cd text,
    dpas_rating text,
    sustainment_customer text,
    strategic_supplier text,
    monthofmeasurement text,
    bacode text,
    delinquentyn text,
    tdpiin text,
    cnsn text,
    delinq text,
    procuring_dept text,
    procuring_org text,
    contract_kind text,
    contractkind_lcp text,
    life_cycle_phase text,
    procuring_office text,
    life_cycle_phase_source text,
    cissued_by text,
    "cIssued_By Source" text,
    contract_category text,
    contracting_officers_determination_of_business_size character varying(25),
    num_airforce_contracts bigint,
    total_awarded numeric,
    annual_revenue bigint,
    number_of_employees bigint,
    cage_code character varying(5)
);


ALTER TABLE afsc448_public.open_source_otd OWNER TO postgres;

--
-- Name: order_backorder_tf33; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.order_backorder_tf33 (
    year integer,
    month integer,
    loc integer,
    niin integer,
    orders bigint,
    total_bo bigint
);


ALTER TABLE afsc448_public.order_backorder_tf33 OWNER TO postgres;

--
-- Name: order_tf33_tdd; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.order_tf33_tdd (
    year integer,
    month integer,
    niin integer,
    tdd text,
    tdd_encode integer
);


ALTER TABLE afsc448_public.order_tf33_tdd OWNER TO postgres;

--
-- Name: ordertf33_dated; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.ordertf33_dated (
    date text,
    sran integer,
    und text,
    pipe text,
    niin integer,
    "To-Date 100 CWT Days" integer,
    orders integer,
    "Ordered Qty" integer,
    "CWT Partial Flag" text,
    "CWT Status" text,
    "TDD Buckets" text,
    "ORT Buckets" text,
    fsg integer,
    fsc integer,
    "MX Group" text,
    "MX Group Description" text,
    "Mx SOR  Group" text,
    "Mx Workload" text,
    "WS Design" text,
    "NIIN type" text,
    "Count of Months" integer,
    id text,
    ne text,
    demands text,
    "SRD YN" text,
    srd text,
    tdd text,
    date2 integer,
    frequency text,
    "New VTM" numeric,
    "New VMR" text,
    "Old VTM" numeric,
    "Old VMR" text,
    "VMR Change" text,
    freq12mth integer,
    month integer,
    year integer
);


ALTER TABLE afsc448_public.ordertf33_dated OWNER TO postgres;

--
-- Name: otd_dcma; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.otd_dcma (
    id text,
    cmo text,
    team text,
    isw text,
    contractor text,
    cage text,
    buying_activity text,
    contract_number text,
    section text,
    prod_surv_cd text,
    surv_criticality_cd text,
    commodity_code text,
    clin text,
    clin_due_date text,
    line_item_balanced text,
    contractor_responsibility_date text,
    contract_due_date text,
    inspection_acceptance text,
    facility text,
    dlvy_sched_qty numeric,
    "SCHED QTY SHIPPED" text,
    delinquent text,
    qty_variance_under text,
    nsn text,
    noun text,
    part_number text,
    weapons_system_cd text,
    dpas_rating text,
    sustainment_customer text,
    strategic_supplier text,
    monthofmeasurement text,
    bacode text,
    delinquentyn text,
    tdpiin text,
    cnsn text,
    delinq text,
    procuring_dept text,
    procuring_org text,
    contract_kind text,
    contractkind_lcp text,
    life_cycle_phase text,
    procuring_office text,
    life_cycle_phase_source text,
    cissued_by text,
    "cIssued_By Source" text,
    contract_category text
);


ALTER TABLE afsc448_public.otd_dcma OWNER TO postgres;

--
-- Name: otd_dcma_fixed; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.otd_dcma_fixed (
    id text,
    cmo text,
    team text,
    isw text,
    contractor text,
    cage text,
    buying_activity text,
    contract_number text,
    section text,
    prod_surv_cd text,
    surv_criticality_cd text,
    commodity_code text,
    clin text,
    clin_due_date text,
    line_item_balanced text,
    contractor_responsibility_date text,
    contract_due_date text,
    inspection_acceptance text,
    facility text,
    dlvy_sched_qty numeric,
    "SCHED QTY SHIPPED" text,
    delinquent text,
    qty_variance_under text,
    nsn text,
    noun text,
    part_number text,
    weapons_system_cd text,
    dpas_rating text,
    sustainment_customer text,
    strategic_supplier text,
    monthofmeasurement text,
    bacode text,
    delinquentyn text,
    tdpiin text,
    cnsn text,
    delinq text,
    procuring_dept text,
    procuring_org text,
    contract_kind text,
    contractkind_lcp text,
    life_cycle_phase text,
    procuring_office text,
    life_cycle_phase_source text,
    cissued_by text,
    "cIssued_By Source" text,
    contract_category text
);


ALTER TABLE afsc448_public.otd_dcma_fixed OWNER TO postgres;

--
-- Name: otd_dcma_fixed_joined; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.otd_dcma_fixed_joined (
    id text,
    cmo text,
    team text,
    isw text,
    contractor text,
    cage text,
    buying_activity text,
    contract_number text,
    section text,
    prod_surv_cd text,
    surv_criticality_cd text,
    commodity_code text,
    clin text,
    clin_due_date text,
    line_item_balanced text,
    contractor_responsibility_date text,
    contract_due_date text,
    inspection_acceptance text,
    facility text,
    dlvy_sched_qty numeric,
    "SCHED QTY SHIPPED" text,
    delinquent text,
    qty_variance_under text,
    nsn text,
    noun text,
    part_number text,
    weapons_system_cd text,
    dpas_rating text,
    sustainment_customer text,
    strategic_supplier text,
    monthofmeasurement text,
    bacode text,
    delinquentyn text,
    tdpiin text,
    cnsn text,
    delinq text,
    procuring_dept text,
    procuring_org text,
    contract_kind text,
    contractkind_lcp text,
    life_cycle_phase text,
    procuring_office text,
    life_cycle_phase_source text,
    cissued_by text,
    "cIssued_By Source" text,
    contract_category text,
    contracting_officers_determination_of_business_size text,
    num_airforce_contracts bigint,
    total_awarded numeric,
    annual_revenue bigint,
    number_of_employees bigint,
    cage_code character varying(5)
);


ALTER TABLE afsc448_public.otd_dcma_fixed_joined OWNER TO postgres;

--
-- Name: part_base; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.part_base (
    niin_id bigint NOT NULL,
    pctm_proc_percent bigint,
    base_cndnm_pct bigint,
    pos_serviceable bigint,
    wrm_serviceable bigint,
    wrm_authorized bigint,
    base_svc_intran bigint,
    base_difm bigint,
    micap bigint,
    non_paa bigint,
    pos_level bigint,
    holes bigint,
    hpmsk_stock bigint,
    hpmsk_level bigint,
    project_level bigint,
    base_due_outs bigint,
    tot_inaccess_asset_bal_qty bigint,
    lim_inaccess_asset_bal_qty bigint,
    inaccess_maint_asset_bal_qty bigint,
    difm_awp_bal_qty bigint,
    base_req_objective bigint,
    process_switch character varying(10),
    sran_type_ind character varying(10),
    total_fsl_ro bigint,
    total_fsl_assets bigint,
    total_fsl_intransit bigint,
    total_oh bigint,
    ro_need bigint,
    base_need bigint,
    total_ro bigint,
    base_rpr_cyc_time bigint,
    suspended_qty bigint,
    quality_deficit_qty bigint,
    unserv_bal_qty bigint,
    unserv_tech_bal_qty bigint,
    time_stamp character varying(28),
    date timestamp without time zone,
    sran character varying(26) NOT NULL,
    pctm_dmnd_rate character varying(26),
    daily_demand_rate character varying(26),
    pct_base_repair numeric(6,2),
    computed_nrts numeric(4,1),
    computed_nonpaa numeric(4,1)
);


ALTER TABLE afsc448_public.part_base OWNER TO postgres;

--
-- Name: part_depot; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.part_depot (
    niin_id bigint,
    sor_alc character varying(2),
    msor_ind bigint,
    stock_0a bigint,
    svc_due_in bigint,
    cndmn_pct bigint,
    carc_on_hand bigint,
    g_condition bigint,
    y_condition bigint,
    z_condition bigint,
    dmsc bigint,
    njr_repl bigint,
    jr_repl bigint,
    owo_inducted bigint,
    awm_inducted bigint,
    unsvc_due_in bigint,
    repair_res_code character varying(8),
    working_level bigint,
    w_level bigint,
    wl_adj bigint,
    plan_wl_adj bigint,
    bv_qty bigint,
    funded_unproduced bigint,
    shop_flow_expct_nrts character varying(12),
    scp_owo_inducted bigint,
    scp_awm_inducted bigint,
    additional_owo bigint,
    awp_g_count bigint,
    depot_difm bigint,
    informal_awp bigint,
    time_stamp character varying(28),
    date timestamp without time zone,
    repair_cost numeric(14,5),
    repair_hours numeric(8,2)
);


ALTER TABLE afsc448_public.part_depot OWNER TO postgres;

--
-- Name: part_depot_assets; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.part_depot_assets (
    niin_id bigint,
    location character varying(3),
    serv_assets bigint,
    intransit_reparables bigint,
    f_condition bigint,
    awp_f_condition_m_balance bigint,
    e_condition bigint,
    g_condition bigint,
    k_condition bigint,
    j_condition bigint,
    p_condition bigint,
    q_condition bigint,
    r_condition bigint,
    time_stamp character varying(28),
    date timestamp without time zone
);


ALTER TABLE afsc448_public.part_depot_assets OWNER TO postgres;

--
-- Name: part_depot_filtered_tf33; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.part_depot_filtered_tf33 (
    niin_id bigint,
    location character varying(3),
    serv_assets bigint,
    intransit_reparables bigint,
    f_condition bigint,
    awp_f_condition_m_balance bigint,
    e_condition bigint,
    g_condition bigint,
    k_condition bigint,
    j_condition bigint,
    p_condition bigint,
    q_condition bigint,
    r_condition bigint,
    actual_niin bigint,
    time_stamp character varying(28),
    date timestamp without time zone,
    month double precision,
    year double precision
);


ALTER TABLE afsc448_public.part_depot_filtered_tf33 OWNER TO postgres;

--
-- Name: part_description; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.part_description (
    niin_id bigint,
    fsc bigint,
    niin bigint,
    mmc character varying(21),
    noun character varying(10),
    part_number character varying(15),
    shop_control_num character varying(6),
    item_manager_code character varying(3),
    equip_spec_code character varying(2),
    pm_spec_code character varying(3),
    pctm_mm_div character varying(10),
    wrtm_mm_div character varying(10),
    failed_sru_policy character varying(10),
    wuc character varying(6),
    depot_cyc_time bigint,
    depot_rpr_limit bigint,
    dmnd_rt_multi bigint,
    prepos_flag bigint,
    pap numeric(10,4),
    slimm_pap numeric(6,2),
    spt_max_buffer bigint,
    pap_default_switch bigint,
    spt_k_factor numeric(8,3),
    k_default_switch bigint,
    jon_default_ind character varying(10),
    spt_switches bigint,
    organic_pct_sw bigint,
    fcrn character varying(4),
    fcrn_future character varying(4),
    program_control_num character varying(6),
    ww_fill_rate_target numeric(4,1),
    time_stamp character varying(28),
    date timestamp without time zone
);


ALTER TABLE afsc448_public.part_description OWNER TO postgres;

--
-- Name: part_mds; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.part_mds (
    niin_id bigint,
    sran character varying(6),
    organization character varying(9),
    mds character varying(7),
    qpa bigint,
    app_fraction bigint,
    block bigint,
    minimum_qty_qpa bigint,
    time_stamp character varying(28),
    date timestamp without time zone
);


ALTER TABLE afsc448_public.part_mds OWNER TO postgres;

--
-- Name: part_model; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.part_model (
    niin_id bigint,
    non_aircft_ind bigint,
    other_non_paa_demands bigint,
    fms_demands bigint,
    njr_depot_demands bigint,
    jr_cndnm_demands bigint,
    owrm_demands bigint,
    ilm_flag bigint,
    lru_sru_ind character varying(1),
    program_sel_code character varying(4),
    common_sru_sw bigint,
    sos_alc character varying(21),
    order_ship_time bigint,
    depot_rpr_flow_days bigint,
    d041_svc_assets bigint,
    base_rpr_cyce_time bigint,
    depot_daily_demands numeric(4,1),
    depot_rep_gens bigint,
    d041_num_users bigint,
    mistr_qtr_1 bigint,
    mistr_qtr_2 bigint,
    mistr_qtr_3 bigint,
    mistr_qtr_4 bigint,
    prior_model_ind bigint,
    repair_dist_ind bigint,
    gfm_sw character varying(11),
    organic_pct bigint,
    organic_pct_flag bigint,
    computed_nrts numeric(4,1),
    expected_needs bigint,
    last_expected_needs bigint,
    time_stamp character varying(28),
    date timestamp without time zone
);


ALTER TABLE afsc448_public.part_model OWNER TO postgres;

--
-- Name: repair_resource; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.repair_resource (
    sor_alc character varying(2),
    repair_res_code character varying(8),
    shop_code character varying(7),
    division character varying(4),
    quarterly_hours bigint,
    quarterly_dollars bigint,
    prior_model_ind bigint,
    spt_include_awp bigint,
    spt_add_micap bigint,
    spt_slimm_ind bigint,
    spt_ship_location character varying(6),
    hours numeric(9,1),
    dollars numeric(10,1),
    cum_hours numeric(11,2),
    cum_dollars numeric(18,7),
    spt_buffer bigint,
    spt_max_buffer bigint,
    spt_buffer_hours numeric(8,1),
    pap numeric(6,2),
    slimm_pap numeric(6,2),
    capping_switch character varying(1),
    spt_max_item_switch bigint,
    spt_k_factor numeric(6,2),
    shop_clock numeric(6,2),
    spt_switches bigint,
    shop_execution_cycle character varying(1),
    shop_execution_day bigint,
    last_execution_date character varying(28),
    next_execution_date character varying(28),
    organic_pct_sw bigint,
    time_stamp character varying(28),
    date timestamp without time zone
);


ALTER TABLE afsc448_public.repair_resource OWNER TO postgres;

--
-- Name: replacement_rates; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.replacement_rates (
    count bigint,
    actual_niin bigint,
    comp_niin character varying(9),
    pdn character varying(6),
    snapshot_date timestamp without time zone,
    time_stamp character varying(28),
    act_rpl bigint,
    std_rpl bigint,
    diff bigint
);


ALTER TABLE afsc448_public.replacement_rates OWNER TO postgres;

--
-- Name: replacement_rates_lag; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.replacement_rates_lag (
    count bigint,
    actual_niin character varying(30),
    comp_niin character varying(9),
    pdn character varying(6),
    snapshot_date timestamp without time zone,
    time_stamp character varying(28),
    act_rpl bigint,
    std_rpl bigint,
    diff bigint,
    act_lag bigint,
    std_lag bigint
);


ALTER TABLE afsc448_public.replacement_rates_lag OWNER TO postgres;

--
-- Name: report_a; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.report_a (
    niin_id bigint,
    location character varying(3),
    wholesale_serv numeric,
    intransit numeric,
    f_cond numeric,
    awp_f numeric,
    sumofk_condition numeric,
    sumofr_condition numeric
);


ALTER TABLE afsc448_public.report_a OWNER TO postgres;

--
-- Name: report_b; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.report_b (
    niin_id bigint,
    carc numeric,
    y_cond numeric,
    awm numeric,
    owo numeric,
    z_cond numeric,
    repair_cost numeric,
    maxofshop_flow_expct_nrts text
);


ALTER TABLE afsc448_public.report_b OWNER TO postgres;

--
-- Name: report_c; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.report_c (
    niin_id bigint,
    nsn character varying(15),
    sumofbase_due_outs numeric,
    sumofpos_level numeric,
    sumofwrm_authorized numeric,
    sumofhpmsk_level numeric,
    sumofpos_serviceable numeric,
    sumofwrm_serviceable numeric,
    sumofbase_difm numeric,
    sumofbase_svc_intran numeric
);


ALTER TABLE afsc448_public.report_c OWNER TO postgres;

--
-- Name: report_d; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.report_d (
    niin_id bigint,
    nsn character varying(15),
    ro numeric,
    oh numeric,
    sumofbase_due_outs numeric,
    sumofpos_level numeric,
    sumofbdopos numeric,
    sumofwrm_authorized numeric,
    sumofhpmsk_level numeric,
    sumofpos_serviceable numeric,
    sumofwrm_serviceable numeric,
    sumofbase_difm numeric,
    sumofbase_svc_intran numeric
);


ALTER TABLE afsc448_public.report_d OWNER TO postgres;

--
-- Name: requisition; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.requisition (
    niin_id bigint,
    sran character varying(6),
    document_num character varying(15),
    priority_code character varying(3),
    document_date bigint,
    actual_niin bigint,
    preposition_code character varying(1),
    document_id character varying(3),
    supp_address character varying(6),
    signal_code character varying(1),
    project_code character varying(3),
    rdd character varying(3),
    quantity bigint,
    sprs_seq bigint,
    advice_code character varying(2),
    action_code character varying(2),
    time_stamp character varying(28),
    date timestamp without time zone
);


ALTER TABLE afsc448_public.requisition OWNER TO postgres;

--
-- Name: scs_carcass_constraint; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.scs_carcass_constraint (
    actual_nsn character varying(15),
    sor_dodaac character varying(6),
    carcass_constraint_qty bigint,
    repair_node character varying(8),
    crf_flag boolean,
    express_item_flag boolean,
    high_priority_flag boolean,
    contract_number character varying(13),
    delivery_order_num character varying(4),
    clin character varying(6),
    clin_qty bigint,
    time_stamp character varying(28),
    date timestamp without time zone
);


ALTER TABLE afsc448_public.scs_carcass_constraint OWNER TO postgres;

--
-- Name: spt_results; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.spt_results (
    niin_id bigint,
    row_index bigint,
    sran character varying(6),
    pdn character varying(6),
    prob_repair numeric(4,1),
    repair_res_code character varying(8),
    pap numeric(10,4),
    carc_avail character varying(1),
    parts_avail character varying(1),
    hours_avail character varying(1),
    funds_avail character varying(1),
    repair_cost numeric(11,2),
    repair_hours numeric(8,2),
    sort_value character varying(21),
    spaws_rank bigint,
    sprt_ind numeric(4,1),
    ws_index bigint,
    sprs_seq bigint,
    item_count bigint,
    buffer_hours_avail character varying(1),
    slimm_pap numeric(6,2),
    sos_alc character varying(2),
    original_compout_nsn character varying(15),
    actual_nsn character varying(15),
    date timestamp without time zone
);


ALTER TABLE afsc448_public.spt_results OWNER TO postgres;

--
-- Name: table_name; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.table_name (
    pdn text,
    nsn_caller bigint,
    niin bigint,
    mmac text,
    errc text,
    rfm_noun text,
    sos_caller text,
    im text,
    es text,
    aac text,
    cc text,
    ui text,
    cost double precision,
    opcode text,
    qpa bigint,
    f bigint,
    tinkerassets bigint,
    mm bigint,
    dlaassets bigint,
    mkshr double precision,
    issueseight bigint,
    stklevel bigint,
    speclevel bigint,
    duein bigint,
    dueout bigint,
    smartmdr double precision,
    pr bigint,
    contract bigint,
    overdue bigint,
    pn text,
    plt bigint,
    alt bigint,
    psc text,
    saic bigint,
    masternsn bigint,
    master_niin bigint,
    shopid bigint,
    model_desc text,
    module_desc text,
    series_desc text,
    data_month timestamp without time zone,
    sos_other text,
    sran bigint,
    base_backorder_flag boolean,
    sos_sgm text,
    pseudo_division text,
    inv_mgt_specialist text,
    budget_code text,
    nimsc text,
    ws_type text,
    ws_group text,
    ws_design text,
    equipment_designator text,
    srd text,
    nsn_other text,
    errc_code text,
    cwt_10_day_rule_flag text,
    cwt_partial_flag text,
    pipeline_document_number text,
    customer_request_document_number text,
    requisition_document_number text,
    activity_code text,
    maj_com text,
    customer_order_date timestamp without time zone,
    requisition_date timestamp without time zone,
    sep10_age text,
    aug10_age text,
    jul10_age text,
    jun10_age text,
    may10_age text,
    apr10_age text,
    mar10_age text,
    feb10_age text,
    jan10_age text,
    dec09_age text,
    nov09_age text,
    oct09_age text,
    cwt_status text,
    issue_priority_group bigint,
    issue_priority___ujc text,
    requisition_priority_code text,
    project_code text,
    alc text,
    rcc text,
    base_name text,
    ordered_qty double precision,
    "To_Date_100%_CWT_Days" double precision,
    to_date_weighted_avg_cwt_days double precision
);


ALTER TABLE afsc448_public.table_name OWNER TO postgres;

--
-- Name: tf33bom_string; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.tf33bom_string (
    pdn character varying(6),
    nsn bigint,
    niin character varying(30),
    mmac character varying(2),
    errc character varying(1),
    rfm_noun character varying(60),
    sos character varying(3),
    im character varying(3),
    es character varying(2),
    aac character varying(1),
    cc character varying(1),
    ui character varying(2),
    cost numeric(11,2),
    opcode character varying(5),
    qpa bigint,
    f bigint,
    tinkerassets bigint,
    mm bigint,
    dlaassets bigint,
    mkshr numeric(9,3),
    issueseight bigint,
    stklevel bigint,
    speclevel bigint,
    duein bigint,
    dueout bigint,
    smartmdr numeric(9,1),
    pr bigint,
    contract bigint,
    overdue bigint,
    pn character varying(27),
    plt bigint,
    alt bigint,
    psc character varying(4),
    saic bigint,
    masternsn bigint,
    master_niin bigint,
    shopid bigint,
    model_desc character varying(4),
    module_desc character varying(18),
    series_desc character varying(38)
);


ALTER TABLE afsc448_public.tf33bom_string OWNER TO postgres;

--
-- Name: xpress; Type: TABLE; Schema: afsc448_public; Owner: postgres
--

CREATE TABLE afsc448_public.xpress (
    niin_id bigint,
    nsn character varying(15),
    repair_res_code character varying(9),
    ship_address character varying(6),
    qty bigint,
    spt_qty bigint,
    original_spt_qty bigint,
    control_num character varying(5),
    op_num bigint,
    action_suffix bigint,
    funded_qty bigint,
    project_order_num bigint,
    project_control_num bigint,
    j025a_comment character varying(67),
    time_stamp character varying(28),
    date timestamp without time zone,
    doc_id character varying(31),
    job_suffix character varying(31),
    routing_id character varying(31),
    project_code character varying(31),
    item_manager_code character varying(31),
    j025a_code character varying(31),
    issue_control character varying(12),
    cond_code character varying(12),
    change_switch character varying(12),
    unit_of_issue character varying(21),
    advice_code character varying(22),
    project_amendment_num character varying(23),
    trans_type character varying(55),
    job_designator character varying(56),
    urgency_of_need character varying(58),
    base_delivery_prior character varying(62),
    owner_purpose character varying(61),
    management_code character varying(59),
    cost_code character varying(63),
    demand_code character varying(52),
    force_activity character varying(51),
    jon_default_ind character varying(56)
);


ALTER TABLE afsc448_public.xpress OWNER TO postgres;

--
-- Name: external_rework_and_no_bid_list id; Type: DEFAULT; Schema: afsc448_onesnapshot; Owner: postgres
--

ALTER TABLE ONLY afsc448_onesnapshot.external_rework_and_no_bid_list ALTER COLUMN id SET DEFAULT nextval('afsc448_onesnapshot.external_rework_and_no_bid_list_id_seq'::regclass);


--
-- Name: gcss_bobj_d043_niins id; Type: DEFAULT; Schema: afsc448_onesnapshot; Owner: postgres
--

ALTER TABLE ONLY afsc448_onesnapshot.gcss_bobj_d043_niins ALTER COLUMN id SET DEFAULT nextval('afsc448_onesnapshot.gcss_bobj_d043_niins_id_seq'::regclass);


--
-- Name: external_rework_and_no_bid_list id; Type: DEFAULT; Schema: afsc448_public; Owner: postgres
--

ALTER TABLE ONLY afsc448_public.external_rework_and_no_bid_list ALTER COLUMN id SET DEFAULT nextval('afsc448_public.external_rework_and_no_bid_list_id_seq'::regclass);


--
-- Name: gcss_bobj_d043_niins id; Type: DEFAULT; Schema: afsc448_public; Owner: postgres
--

ALTER TABLE ONLY afsc448_public.gcss_bobj_d043_niins ALTER COLUMN id SET DEFAULT nextval('afsc448_public.gcss_bobj_d043_niins_id_seq'::regclass);


--
-- Name: external_rework_and_no_bid_list external_rework_and_no_bid_list_pkey; Type: CONSTRAINT; Schema: afsc448_onesnapshot; Owner: postgres
--

ALTER TABLE ONLY afsc448_onesnapshot.external_rework_and_no_bid_list
    ADD CONSTRAINT external_rework_and_no_bid_list_pkey PRIMARY KEY (id);


--
-- Name: gcss_bobj_d043_niins gcss_bobj_d043_niins_pkey; Type: CONSTRAINT; Schema: afsc448_onesnapshot; Owner: postgres
--

ALTER TABLE ONLY afsc448_onesnapshot.gcss_bobj_d043_niins
    ADD CONSTRAINT gcss_bobj_d043_niins_pkey PRIMARY KEY (id);


--
-- Name: part_base part_base_pk; Type: CONSTRAINT; Schema: afsc448_onesnapshot; Owner: postgres
--

ALTER TABLE ONLY afsc448_onesnapshot.part_base
    ADD CONSTRAINT part_base_pk PRIMARY KEY (niin_id, sran);


--
-- Name: tf33bom tf33bom_pk; Type: CONSTRAINT; Schema: afsc448_onesnapshot; Owner: postgres
--

ALTER TABLE ONLY afsc448_onesnapshot.tf33bom
    ADD CONSTRAINT tf33bom_pk PRIMARY KEY (pdn, niin);


--
-- Name: external_rework_and_no_bid_list external_rework_and_no_bid_list_pkey; Type: CONSTRAINT; Schema: afsc448_public; Owner: postgres
--

ALTER TABLE ONLY afsc448_public.external_rework_and_no_bid_list
    ADD CONSTRAINT external_rework_and_no_bid_list_pkey PRIMARY KEY (id);


--
-- Name: gcss_bobj_d043_niins gcss_bobj_d043_niins_pkey; Type: CONSTRAINT; Schema: afsc448_public; Owner: postgres
--

ALTER TABLE ONLY afsc448_public.gcss_bobj_d043_niins
    ADD CONSTRAINT gcss_bobj_d043_niins_pkey PRIMARY KEY (id);


--
-- Name: part_base part_base_pk; Type: CONSTRAINT; Schema: afsc448_public; Owner: postgres
--

ALTER TABLE ONLY afsc448_public.part_base
    ADD CONSTRAINT part_base_pk PRIMARY KEY (niin_id, sran);


--
-- Name: tf33bom tf33bom_pk; Type: CONSTRAINT; Schema: afsc448_public; Owner: postgres
--

ALTER TABLE ONLY afsc448_public.tf33bom
    ADD CONSTRAINT tf33bom_pk PRIMARY KEY (pdn, niin);


--
-- Name: ix_filtered_bo_index; Type: INDEX; Schema: afsc448_public; Owner: postgres
--

CREATE INDEX ix_filtered_bo_index ON afsc448_public.filtered_bo USING btree (index);


--
-- Name: ix_one_snapshot.filtered_bo_index; Type: INDEX; Schema: afsc448_public; Owner: postgres
--

CREATE INDEX "ix_one_snapshot.filtered_bo_index" ON afsc448_public."one_snapshot.filtered_bo" USING btree (index);


--
-- PostgreSQL database dump complete
--

\connect superset

SET default_transaction_read_only = off;

--
-- PostgreSQL database dump
--

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

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;

--
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: 
--

CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;


--
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: 
--

COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';


SET default_tablespace = '';

SET default_with_oids = false;

--
-- Name: ab_permission; Type: TABLE; Schema: public; Owner: superset
--

CREATE TABLE public.ab_permission (
    id integer NOT NULL,
    name character varying(100) NOT NULL
);


ALTER TABLE public.ab_permission OWNER TO superset;

--
-- Name: ab_permission_id_seq; Type: SEQUENCE; Schema: public; Owner: superset
--

CREATE SEQUENCE public.ab_permission_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.ab_permission_id_seq OWNER TO superset;

--
-- Name: ab_permission_view; Type: TABLE; Schema: public; Owner: superset
--

CREATE TABLE public.ab_permission_view (
    id integer NOT NULL,
    permission_id integer,
    view_menu_id integer
);


ALTER TABLE public.ab_permission_view OWNER TO superset;

--
-- Name: ab_permission_view_id_seq; Type: SEQUENCE; Schema: public; Owner: superset
--

CREATE SEQUENCE public.ab_permission_view_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.ab_permission_view_id_seq OWNER TO superset;

--
-- Name: ab_permission_view_role; Type: TABLE; Schema: public; Owner: superset
--

CREATE TABLE public.ab_permission_view_role (
    id integer NOT NULL,
    permission_view_id integer,
    role_id integer
);


ALTER TABLE public.ab_permission_view_role OWNER TO superset;

--
-- Name: ab_permission_view_role_id_seq; Type: SEQUENCE; Schema: public; Owner: superset
--

CREATE SEQUENCE public.ab_permission_view_role_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.ab_permission_view_role_id_seq OWNER TO superset;

--
-- Name: ab_register_user; Type: TABLE; Schema: public; Owner: superset
--

CREATE TABLE public.ab_register_user (
    id integer NOT NULL,
    first_name character varying(64) NOT NULL,
    last_name character varying(64) NOT NULL,
    username character varying(64) NOT NULL,
    password character varying(256),
    email character varying(64) NOT NULL,
    registration_date timestamp without time zone,
    registration_hash character varying(256)
);


ALTER TABLE public.ab_register_user OWNER TO superset;

--
-- Name: ab_register_user_id_seq; Type: SEQUENCE; Schema: public; Owner: superset
--

CREATE SEQUENCE public.ab_register_user_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.ab_register_user_id_seq OWNER TO superset;

--
-- Name: ab_role; Type: TABLE; Schema: public; Owner: superset
--

CREATE TABLE public.ab_role (
    id integer NOT NULL,
    name character varying(64) NOT NULL
);


ALTER TABLE public.ab_role OWNER TO superset;

--
-- Name: ab_role_id_seq; Type: SEQUENCE; Schema: public; Owner: superset
--

CREATE SEQUENCE public.ab_role_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.ab_role_id_seq OWNER TO superset;

--
-- Name: ab_user; Type: TABLE; Schema: public; Owner: superset
--

CREATE TABLE public.ab_user (
    id integer NOT NULL,
    first_name character varying(64) NOT NULL,
    last_name character varying(64) NOT NULL,
    username character varying(64) NOT NULL,
    password character varying(256),
    active boolean,
    email character varying(64) NOT NULL,
    last_login timestamp without time zone,
    login_count integer,
    fail_login_count integer,
    created_on timestamp without time zone,
    changed_on timestamp without time zone,
    created_by_fk integer,
    changed_by_fk integer
);


ALTER TABLE public.ab_user OWNER TO superset;

--
-- Name: ab_user_id_seq; Type: SEQUENCE; Schema: public; Owner: superset
--

CREATE SEQUENCE public.ab_user_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.ab_user_id_seq OWNER TO superset;

--
-- Name: ab_user_role; Type: TABLE; Schema: public; Owner: superset
--

CREATE TABLE public.ab_user_role (
    id integer NOT NULL,
    user_id integer,
    role_id integer
);


ALTER TABLE public.ab_user_role OWNER TO superset;

--
-- Name: ab_user_role_id_seq; Type: SEQUENCE; Schema: public; Owner: superset
--

CREATE SEQUENCE public.ab_user_role_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.ab_user_role_id_seq OWNER TO superset;

--
-- Name: ab_view_menu; Type: TABLE; Schema: public; Owner: superset
--

CREATE TABLE public.ab_view_menu (
    id integer NOT NULL,
    name character varying(100) NOT NULL
);


ALTER TABLE public.ab_view_menu OWNER TO superset;

--
-- Name: ab_view_menu_id_seq; Type: SEQUENCE; Schema: public; Owner: superset
--

CREATE SEQUENCE public.ab_view_menu_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.ab_view_menu_id_seq OWNER TO superset;

--
-- Name: access_request; Type: TABLE; Schema: public; Owner: superset
--

CREATE TABLE public.access_request (
    created_on timestamp without time zone,
    changed_on timestamp without time zone,
    id integer NOT NULL,
    datasource_type character varying(200),
    datasource_id integer,
    changed_by_fk integer,
    created_by_fk integer
);


ALTER TABLE public.access_request OWNER TO superset;

--
-- Name: access_request_id_seq; Type: SEQUENCE; Schema: public; Owner: superset
--

CREATE SEQUENCE public.access_request_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.access_request_id_seq OWNER TO superset;

--
-- Name: access_request_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: superset
--

ALTER SEQUENCE public.access_request_id_seq OWNED BY public.access_request.id;


--
-- Name: alembic_version; Type: TABLE; Schema: public; Owner: superset
--

CREATE TABLE public.alembic_version (
    version_num character varying(32) NOT NULL
);


ALTER TABLE public.alembic_version OWNER TO superset;

--
-- Name: annotation; Type: TABLE; Schema: public; Owner: superset
--

CREATE TABLE public.annotation (
    created_on timestamp without time zone,
    changed_on timestamp without time zone,
    id integer NOT NULL,
    start_dttm timestamp without time zone,
    end_dttm timestamp without time zone,
    layer_id integer,
    short_descr character varying(500),
    long_descr text,
    changed_by_fk integer,
    created_by_fk integer,
    json_metadata text
);


ALTER TABLE public.annotation OWNER TO superset;

--
-- Name: annotation_id_seq; Type: SEQUENCE; Schema: public; Owner: superset
--

CREATE SEQUENCE public.annotation_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.annotation_id_seq OWNER TO superset;

--
-- Name: annotation_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: superset
--

ALTER SEQUENCE public.annotation_id_seq OWNED BY public.annotation.id;


--
-- Name: annotation_layer; Type: TABLE; Schema: public; Owner: superset
--

CREATE TABLE public.annotation_layer (
    created_on timestamp without time zone,
    changed_on timestamp without time zone,
    id integer NOT NULL,
    name character varying(250),
    descr text,
    changed_by_fk integer,
    created_by_fk integer
);


ALTER TABLE public.annotation_layer OWNER TO superset;

--
-- Name: annotation_layer_id_seq; Type: SEQUENCE; Schema: public; Owner: superset
--

CREATE SEQUENCE public.annotation_layer_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.annotation_layer_id_seq OWNER TO superset;

--
-- Name: annotation_layer_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: superset
--

ALTER SEQUENCE public.annotation_layer_id_seq OWNED BY public.annotation_layer.id;


--
-- Name: clusters; Type: TABLE; Schema: public; Owner: superset
--

CREATE TABLE public.clusters (
    created_on timestamp without time zone,
    changed_on timestamp without time zone,
    id integer NOT NULL,
    cluster_name character varying(250),
    broker_host character varying(255),
    broker_port integer,
    broker_endpoint character varying(255),
    metadata_last_refreshed timestamp without time zone,
    created_by_fk integer,
    changed_by_fk integer,
    cache_timeout integer,
    verbose_name character varying(250)
);


ALTER TABLE public.clusters OWNER TO superset;

--
-- Name: clusters_id_seq; Type: SEQUENCE; Schema: public; Owner: superset
--

CREATE SEQUENCE public.clusters_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.clusters_id_seq OWNER TO superset;

--
-- Name: clusters_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: superset
--

ALTER SEQUENCE public.clusters_id_seq OWNED BY public.clusters.id;


--
-- Name: columns; Type: TABLE; Schema: public; Owner: superset
--

CREATE TABLE public.columns (
    created_on timestamp without time zone,
    changed_on timestamp without time zone,
    id integer NOT NULL,
    column_name character varying(255),
    is_active boolean,
    type character varying(32),
    groupby boolean,
    count_distinct boolean,
    sum boolean,
    max boolean,
    min boolean,
    filterable boolean,
    description text,
    created_by_fk integer,
    changed_by_fk integer,
    avg boolean,
    dimension_spec_json text,
    verbose_name character varying(1024),
    datasource_id integer
);


ALTER TABLE public.columns OWNER TO superset;

--
-- Name: columns_id_seq; Type: SEQUENCE; Schema: public; Owner: superset
--

CREATE SEQUENCE public.columns_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.columns_id_seq OWNER TO superset;

--
-- Name: columns_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: superset
--

ALTER SEQUENCE public.columns_id_seq OWNED BY public.columns.id;


--
-- Name: css_templates; Type: TABLE; Schema: public; Owner: superset
--

CREATE TABLE public.css_templates (
    created_on timestamp without time zone,
    changed_on timestamp without time zone,
    id integer NOT NULL,
    template_name character varying(250),
    css text,
    changed_by_fk integer,
    created_by_fk integer
);


ALTER TABLE public.css_templates OWNER TO superset;

--
-- Name: css_templates_id_seq; Type: SEQUENCE; Schema: public; Owner: superset
--

CREATE SEQUENCE public.css_templates_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.css_templates_id_seq OWNER TO superset;

--
-- Name: css_templates_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: superset
--

ALTER SEQUENCE public.css_templates_id_seq OWNED BY public.css_templates.id;


--
-- Name: dashboard_slices; Type: TABLE; Schema: public; Owner: superset
--

CREATE TABLE public.dashboard_slices (
    id integer NOT NULL,
    dashboard_id integer,
    slice_id integer
);


ALTER TABLE public.dashboard_slices OWNER TO superset;

--
-- Name: dashboard_slices_id_seq; Type: SEQUENCE; Schema: public; Owner: superset
--

CREATE SEQUENCE public.dashboard_slices_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.dashboard_slices_id_seq OWNER TO superset;

--
-- Name: dashboard_slices_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: superset
--

ALTER SEQUENCE public.dashboard_slices_id_seq OWNED BY public.dashboard_slices.id;


--
-- Name: dashboard_user; Type: TABLE; Schema: public; Owner: superset
--

CREATE TABLE public.dashboard_user (
    id integer NOT NULL,
    user_id integer,
    dashboard_id integer
);


ALTER TABLE public.dashboard_user OWNER TO superset;

--
-- Name: dashboard_user_id_seq; Type: SEQUENCE; Schema: public; Owner: superset
--

CREATE SEQUENCE public.dashboard_user_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.dashboard_user_id_seq OWNER TO superset;

--
-- Name: dashboard_user_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: superset
--

ALTER SEQUENCE public.dashboard_user_id_seq OWNED BY public.dashboard_user.id;


--
-- Name: dashboards; Type: TABLE; Schema: public; Owner: superset
--

CREATE TABLE public.dashboards (
    created_on timestamp without time zone,
    changed_on timestamp without time zone,
    id integer NOT NULL,
    dashboard_title character varying(500),
    position_json text,
    created_by_fk integer,
    changed_by_fk integer,
    css text,
    description text,
    slug character varying(255),
    json_metadata text
);


ALTER TABLE public.dashboards OWNER TO superset;

--
-- Name: dashboards_id_seq; Type: SEQUENCE; Schema: public; Owner: superset
--

CREATE SEQUENCE public.dashboards_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.dashboards_id_seq OWNER TO superset;

--
-- Name: dashboards_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: superset
--

ALTER SEQUENCE public.dashboards_id_seq OWNED BY public.dashboards.id;


--
-- Name: datasources; Type: TABLE; Schema: public; Owner: superset
--

CREATE TABLE public.datasources (
    created_on timestamp without time zone,
    changed_on timestamp without time zone,
    id integer NOT NULL,
    datasource_name character varying(255),
    is_featured boolean,
    is_hidden boolean,
    description text,
    default_endpoint text,
    user_id integer,
    cluster_name character varying(250),
    created_by_fk integer,
    changed_by_fk integer,
    "offset" integer,
    cache_timeout integer,
    perm character varying(1000),
    filter_select_enabled boolean,
    params character varying(1000),
    fetch_values_from character varying(100)
);


ALTER TABLE public.datasources OWNER TO superset;

--
-- Name: datasources_id_seq; Type: SEQUENCE; Schema: public; Owner: superset
--

CREATE SEQUENCE public.datasources_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.datasources_id_seq OWNER TO superset;

--
-- Name: datasources_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: superset
--

ALTER SEQUENCE public.datasources_id_seq OWNED BY public.datasources.id;


--
-- Name: dbs; Type: TABLE; Schema: public; Owner: superset
--

CREATE TABLE public.dbs (
    created_on timestamp without time zone,
    changed_on timestamp without time zone,
    id integer NOT NULL,
    database_name character varying(250),
    sqlalchemy_uri character varying(1024),
    created_by_fk integer,
    changed_by_fk integer,
    password bytea,
    cache_timeout integer,
    extra text,
    select_as_create_table_as boolean,
    allow_ctas boolean,
    expose_in_sqllab boolean,
    force_ctas_schema character varying(250),
    allow_run_async boolean,
    allow_dml boolean,
    perm character varying(1000),
    verbose_name character varying(250),
    impersonate_user boolean,
    allow_multi_schema_metadata_fetch boolean,
    allow_csv_upload boolean DEFAULT true NOT NULL
);


ALTER TABLE public.dbs OWNER TO superset;

--
-- Name: dbs_id_seq; Type: SEQUENCE; Schema: public; Owner: superset
--

CREATE SEQUENCE public.dbs_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.dbs_id_seq OWNER TO superset;

--
-- Name: dbs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: superset
--

ALTER SEQUENCE public.dbs_id_seq OWNED BY public.dbs.id;


--
-- Name: favstar; Type: TABLE; Schema: public; Owner: superset
--

CREATE TABLE public.favstar (
    id integer NOT NULL,
    user_id integer,
    class_name character varying(50),
    obj_id integer,
    dttm timestamp without time zone
);


ALTER TABLE public.favstar OWNER TO superset;

--
-- Name: favstar_id_seq; Type: SEQUENCE; Schema: public; Owner: superset
--

CREATE SEQUENCE public.favstar_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.favstar_id_seq OWNER TO superset;

--
-- Name: favstar_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: superset
--

ALTER SEQUENCE public.favstar_id_seq OWNED BY public.favstar.id;


--
-- Name: keyvalue; Type: TABLE; Schema: public; Owner: superset
--

CREATE TABLE public.keyvalue (
    id integer NOT NULL,
    value text NOT NULL
);


ALTER TABLE public.keyvalue OWNER TO superset;

--
-- Name: keyvalue_id_seq; Type: SEQUENCE; Schema: public; Owner: superset
--

CREATE SEQUENCE public.keyvalue_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.keyvalue_id_seq OWNER TO superset;

--
-- Name: keyvalue_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: superset
--

ALTER SEQUENCE public.keyvalue_id_seq OWNED BY public.keyvalue.id;


--
-- Name: logs; Type: TABLE; Schema: public; Owner: superset
--

CREATE TABLE public.logs (
    id integer NOT NULL,
    action character varying(512),
    user_id integer,
    json text,
    dttm timestamp without time zone,
    dashboard_id integer,
    slice_id integer,
    duration_ms integer,
    referrer character varying(1024)
);


ALTER TABLE public.logs OWNER TO superset;

--
-- Name: logs_id_seq; Type: SEQUENCE; Schema: public; Owner: superset
--

CREATE SEQUENCE public.logs_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.logs_id_seq OWNER TO superset;

--
-- Name: logs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: superset
--

ALTER SEQUENCE public.logs_id_seq OWNED BY public.logs.id;


--
-- Name: metrics; Type: TABLE; Schema: public; Owner: superset
--

CREATE TABLE public.metrics (
    id integer NOT NULL,
    metric_name character varying(255),
    verbose_name character varying(1024),
    metric_type character varying(32),
    json text,
    description text,
    changed_by_fk integer,
    changed_on timestamp without time zone,
    created_by_fk integer,
    created_on timestamp without time zone,
    is_restricted boolean,
    d3format character varying(128),
    warning_text text,
    datasource_id integer
);


ALTER TABLE public.metrics OWNER TO superset;

--
-- Name: metrics_id_seq; Type: SEQUENCE; Schema: public; Owner: superset
--

CREATE SEQUENCE public.metrics_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.metrics_id_seq OWNER TO superset;

--
-- Name: metrics_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: superset
--

ALTER SEQUENCE public.metrics_id_seq OWNED BY public.metrics.id;


--
-- Name: query; Type: TABLE; Schema: public; Owner: superset
--

CREATE TABLE public.query (
    id integer NOT NULL,
    client_id character varying(11) NOT NULL,
    database_id integer NOT NULL,
    tmp_table_name character varying(256),
    tab_name character varying(256),
    sql_editor_id character varying(256),
    user_id integer,
    status character varying(16),
    schema character varying(256),
    sql text,
    select_sql text,
    executed_sql text,
    "limit" integer,
    limit_used boolean,
    select_as_cta boolean,
    select_as_cta_used boolean,
    progress integer,
    rows integer,
    error_message text,
    start_time numeric(20,6),
    changed_on timestamp without time zone,
    end_time numeric(20,6),
    results_key character varying(64),
    start_running_time numeric(20,6),
    end_result_backend_time numeric(20,6),
    tracking_url text
);


ALTER TABLE public.query OWNER TO superset;

--
-- Name: query_id_seq; Type: SEQUENCE; Schema: public; Owner: superset
--

CREATE SEQUENCE public.query_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.query_id_seq OWNER TO superset;

--
-- Name: query_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: superset
--

ALTER SEQUENCE public.query_id_seq OWNED BY public.query.id;


--
-- Name: saved_query; Type: TABLE; Schema: public; Owner: superset
--

CREATE TABLE public.saved_query (
    created_on timestamp without time zone,
    changed_on timestamp without time zone,
    id integer NOT NULL,
    user_id integer,
    db_id integer,
    label character varying(256),
    schema character varying(128),
    sql text,
    description text,
    changed_by_fk integer,
    created_by_fk integer
);


ALTER TABLE public.saved_query OWNER TO superset;

--
-- Name: saved_query_id_seq; Type: SEQUENCE; Schema: public; Owner: superset
--

CREATE SEQUENCE public.saved_query_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.saved_query_id_seq OWNER TO superset;

--
-- Name: saved_query_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: superset
--

ALTER SEQUENCE public.saved_query_id_seq OWNED BY public.saved_query.id;


--
-- Name: slice_user; Type: TABLE; Schema: public; Owner: superset
--

CREATE TABLE public.slice_user (
    id integer NOT NULL,
    user_id integer,
    slice_id integer
);


ALTER TABLE public.slice_user OWNER TO superset;

--
-- Name: slice_user_id_seq; Type: SEQUENCE; Schema: public; Owner: superset
--

CREATE SEQUENCE public.slice_user_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.slice_user_id_seq OWNER TO superset;

--
-- Name: slice_user_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: superset
--

ALTER SEQUENCE public.slice_user_id_seq OWNED BY public.slice_user.id;


--
-- Name: slices; Type: TABLE; Schema: public; Owner: superset
--

CREATE TABLE public.slices (
    created_on timestamp without time zone,
    changed_on timestamp without time zone,
    id integer NOT NULL,
    slice_name character varying(250),
    datasource_type character varying(200),
    datasource_name character varying(2000),
    viz_type character varying(250),
    params text,
    created_by_fk integer,
    changed_by_fk integer,
    description text,
    cache_timeout integer,
    perm character varying(2000),
    datasource_id integer
);


ALTER TABLE public.slices OWNER TO superset;

--
-- Name: slices_id_seq; Type: SEQUENCE; Schema: public; Owner: superset
--

CREATE SEQUENCE public.slices_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.slices_id_seq OWNER TO superset;

--
-- Name: slices_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: superset
--

ALTER SEQUENCE public.slices_id_seq OWNED BY public.slices.id;


--
-- Name: sql_metrics; Type: TABLE; Schema: public; Owner: superset
--

CREATE TABLE public.sql_metrics (
    created_on timestamp without time zone,
    changed_on timestamp without time zone,
    id integer NOT NULL,
    metric_name character varying(512),
    verbose_name character varying(1024),
    metric_type character varying(32),
    table_id integer,
    expression text,
    description text,
    created_by_fk integer,
    changed_by_fk integer,
    is_restricted boolean,
    d3format character varying(128),
    warning_text text
);


ALTER TABLE public.sql_metrics OWNER TO superset;

--
-- Name: sql_metrics_id_seq; Type: SEQUENCE; Schema: public; Owner: superset
--

CREATE SEQUENCE public.sql_metrics_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.sql_metrics_id_seq OWNER TO superset;

--
-- Name: sql_metrics_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: superset
--

ALTER SEQUENCE public.sql_metrics_id_seq OWNED BY public.sql_metrics.id;


--
-- Name: table_columns; Type: TABLE; Schema: public; Owner: superset
--

CREATE TABLE public.table_columns (
    created_on timestamp without time zone,
    changed_on timestamp without time zone,
    id integer NOT NULL,
    table_id integer,
    column_name character varying(255),
    is_dttm boolean,
    is_active boolean,
    type character varying(32),
    groupby boolean,
    count_distinct boolean,
    sum boolean,
    max boolean,
    min boolean,
    filterable boolean,
    description text,
    created_by_fk integer,
    changed_by_fk integer,
    expression text,
    verbose_name character varying(1024),
    python_date_format character varying(255),
    database_expression character varying(255),
    avg boolean
);


ALTER TABLE public.table_columns OWNER TO superset;

--
-- Name: table_columns_id_seq; Type: SEQUENCE; Schema: public; Owner: superset
--

CREATE SEQUENCE public.table_columns_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.table_columns_id_seq OWNER TO superset;

--
-- Name: table_columns_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: superset
--

ALTER SEQUENCE public.table_columns_id_seq OWNED BY public.table_columns.id;


--
-- Name: tables; Type: TABLE; Schema: public; Owner: superset
--

CREATE TABLE public.tables (
    created_on timestamp without time zone,
    changed_on timestamp without time zone,
    id integer NOT NULL,
    table_name character varying(250),
    main_dttm_col character varying(250),
    default_endpoint text,
    database_id integer NOT NULL,
    created_by_fk integer,
    changed_by_fk integer,
    "offset" integer,
    description text,
    is_featured boolean,
    user_id integer,
    cache_timeout integer,
    schema character varying(255),
    sql text,
    params text,
    perm character varying(1000),
    filter_select_enabled boolean,
    fetch_values_predicate character varying(1000),
    is_sqllab_view boolean DEFAULT false,
    template_params text
);


ALTER TABLE public.tables OWNER TO superset;

--
-- Name: tables_id_seq; Type: SEQUENCE; Schema: public; Owner: superset
--

CREATE SEQUENCE public.tables_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tables_id_seq OWNER TO superset;

--
-- Name: tables_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: superset
--

ALTER SEQUENCE public.tables_id_seq OWNED BY public.tables.id;


--
-- Name: url; Type: TABLE; Schema: public; Owner: superset
--

CREATE TABLE public.url (
    created_on timestamp without time zone,
    changed_on timestamp without time zone,
    id integer NOT NULL,
    url text,
    created_by_fk integer,
    changed_by_fk integer
);


ALTER TABLE public.url OWNER TO superset;

--
-- Name: url_id_seq; Type: SEQUENCE; Schema: public; Owner: superset
--

CREATE SEQUENCE public.url_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.url_id_seq OWNER TO superset;

--
-- Name: url_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: superset
--

ALTER SEQUENCE public.url_id_seq OWNED BY public.url.id;


--
-- Name: user_attribute; Type: TABLE; Schema: public; Owner: superset
--

CREATE TABLE public.user_attribute (
    created_on timestamp without time zone,
    changed_on timestamp without time zone,
    id integer NOT NULL,
    user_id integer,
    welcome_dashboard_id integer,
    created_by_fk integer,
    changed_by_fk integer
);


ALTER TABLE public.user_attribute OWNER TO superset;

--
-- Name: user_attribute_id_seq; Type: SEQUENCE; Schema: public; Owner: superset
--

CREATE SEQUENCE public.user_attribute_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.user_attribute_id_seq OWNER TO superset;

--
-- Name: user_attribute_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: superset
--

ALTER SEQUENCE public.user_attribute_id_seq OWNED BY public.user_attribute.id;


--
-- Name: access_request id; Type: DEFAULT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.access_request ALTER COLUMN id SET DEFAULT nextval('public.access_request_id_seq'::regclass);


--
-- Name: annotation id; Type: DEFAULT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.annotation ALTER COLUMN id SET DEFAULT nextval('public.annotation_id_seq'::regclass);


--
-- Name: annotation_layer id; Type: DEFAULT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.annotation_layer ALTER COLUMN id SET DEFAULT nextval('public.annotation_layer_id_seq'::regclass);


--
-- Name: clusters id; Type: DEFAULT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.clusters ALTER COLUMN id SET DEFAULT nextval('public.clusters_id_seq'::regclass);


--
-- Name: columns id; Type: DEFAULT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.columns ALTER COLUMN id SET DEFAULT nextval('public.columns_id_seq'::regclass);


--
-- Name: css_templates id; Type: DEFAULT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.css_templates ALTER COLUMN id SET DEFAULT nextval('public.css_templates_id_seq'::regclass);


--
-- Name: dashboard_slices id; Type: DEFAULT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.dashboard_slices ALTER COLUMN id SET DEFAULT nextval('public.dashboard_slices_id_seq'::regclass);


--
-- Name: dashboard_user id; Type: DEFAULT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.dashboard_user ALTER COLUMN id SET DEFAULT nextval('public.dashboard_user_id_seq'::regclass);


--
-- Name: dashboards id; Type: DEFAULT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.dashboards ALTER COLUMN id SET DEFAULT nextval('public.dashboards_id_seq'::regclass);


--
-- Name: datasources id; Type: DEFAULT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.datasources ALTER COLUMN id SET DEFAULT nextval('public.datasources_id_seq'::regclass);


--
-- Name: dbs id; Type: DEFAULT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.dbs ALTER COLUMN id SET DEFAULT nextval('public.dbs_id_seq'::regclass);


--
-- Name: favstar id; Type: DEFAULT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.favstar ALTER COLUMN id SET DEFAULT nextval('public.favstar_id_seq'::regclass);


--
-- Name: keyvalue id; Type: DEFAULT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.keyvalue ALTER COLUMN id SET DEFAULT nextval('public.keyvalue_id_seq'::regclass);


--
-- Name: logs id; Type: DEFAULT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.logs ALTER COLUMN id SET DEFAULT nextval('public.logs_id_seq'::regclass);


--
-- Name: metrics id; Type: DEFAULT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.metrics ALTER COLUMN id SET DEFAULT nextval('public.metrics_id_seq'::regclass);


--
-- Name: query id; Type: DEFAULT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.query ALTER COLUMN id SET DEFAULT nextval('public.query_id_seq'::regclass);


--
-- Name: saved_query id; Type: DEFAULT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.saved_query ALTER COLUMN id SET DEFAULT nextval('public.saved_query_id_seq'::regclass);


--
-- Name: slice_user id; Type: DEFAULT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.slice_user ALTER COLUMN id SET DEFAULT nextval('public.slice_user_id_seq'::regclass);


--
-- Name: slices id; Type: DEFAULT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.slices ALTER COLUMN id SET DEFAULT nextval('public.slices_id_seq'::regclass);


--
-- Name: sql_metrics id; Type: DEFAULT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.sql_metrics ALTER COLUMN id SET DEFAULT nextval('public.sql_metrics_id_seq'::regclass);


--
-- Name: table_columns id; Type: DEFAULT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.table_columns ALTER COLUMN id SET DEFAULT nextval('public.table_columns_id_seq'::regclass);


--
-- Name: tables id; Type: DEFAULT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.tables ALTER COLUMN id SET DEFAULT nextval('public.tables_id_seq'::regclass);


--
-- Name: url id; Type: DEFAULT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.url ALTER COLUMN id SET DEFAULT nextval('public.url_id_seq'::regclass);


--
-- Name: user_attribute id; Type: DEFAULT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.user_attribute ALTER COLUMN id SET DEFAULT nextval('public.user_attribute_id_seq'::regclass);


--
-- Name: tables _customer_location_uc; Type: CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.tables
    ADD CONSTRAINT _customer_location_uc UNIQUE (database_id, schema, table_name);


--
-- Name: ab_permission ab_permission_name_key; Type: CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.ab_permission
    ADD CONSTRAINT ab_permission_name_key UNIQUE (name);


--
-- Name: ab_permission ab_permission_pkey; Type: CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.ab_permission
    ADD CONSTRAINT ab_permission_pkey PRIMARY KEY (id);


--
-- Name: ab_permission_view ab_permission_view_permission_id_view_menu_id_key; Type: CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.ab_permission_view
    ADD CONSTRAINT ab_permission_view_permission_id_view_menu_id_key UNIQUE (permission_id, view_menu_id);


--
-- Name: ab_permission_view ab_permission_view_pkey; Type: CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.ab_permission_view
    ADD CONSTRAINT ab_permission_view_pkey PRIMARY KEY (id);


--
-- Name: ab_permission_view_role ab_permission_view_role_permission_view_id_role_id_key; Type: CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.ab_permission_view_role
    ADD CONSTRAINT ab_permission_view_role_permission_view_id_role_id_key UNIQUE (permission_view_id, role_id);


--
-- Name: ab_permission_view_role ab_permission_view_role_pkey; Type: CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.ab_permission_view_role
    ADD CONSTRAINT ab_permission_view_role_pkey PRIMARY KEY (id);


--
-- Name: ab_register_user ab_register_user_pkey; Type: CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.ab_register_user
    ADD CONSTRAINT ab_register_user_pkey PRIMARY KEY (id);


--
-- Name: ab_register_user ab_register_user_username_key; Type: CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.ab_register_user
    ADD CONSTRAINT ab_register_user_username_key UNIQUE (username);


--
-- Name: ab_role ab_role_name_key; Type: CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.ab_role
    ADD CONSTRAINT ab_role_name_key UNIQUE (name);


--
-- Name: ab_role ab_role_pkey; Type: CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.ab_role
    ADD CONSTRAINT ab_role_pkey PRIMARY KEY (id);


--
-- Name: ab_user ab_user_email_key; Type: CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.ab_user
    ADD CONSTRAINT ab_user_email_key UNIQUE (email);


--
-- Name: ab_user ab_user_pkey; Type: CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.ab_user
    ADD CONSTRAINT ab_user_pkey PRIMARY KEY (id);


--
-- Name: ab_user_role ab_user_role_pkey; Type: CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.ab_user_role
    ADD CONSTRAINT ab_user_role_pkey PRIMARY KEY (id);


--
-- Name: ab_user_role ab_user_role_user_id_role_id_key; Type: CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.ab_user_role
    ADD CONSTRAINT ab_user_role_user_id_role_id_key UNIQUE (user_id, role_id);


--
-- Name: ab_user ab_user_username_key; Type: CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.ab_user
    ADD CONSTRAINT ab_user_username_key UNIQUE (username);


--
-- Name: ab_view_menu ab_view_menu_name_key; Type: CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.ab_view_menu
    ADD CONSTRAINT ab_view_menu_name_key UNIQUE (name);


--
-- Name: ab_view_menu ab_view_menu_pkey; Type: CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.ab_view_menu
    ADD CONSTRAINT ab_view_menu_pkey PRIMARY KEY (id);


--
-- Name: access_request access_request_pkey; Type: CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.access_request
    ADD CONSTRAINT access_request_pkey PRIMARY KEY (id);


--
-- Name: alembic_version alembic_version_pkc; Type: CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.alembic_version
    ADD CONSTRAINT alembic_version_pkc PRIMARY KEY (version_num);


--
-- Name: annotation_layer annotation_layer_pkey; Type: CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.annotation_layer
    ADD CONSTRAINT annotation_layer_pkey PRIMARY KEY (id);


--
-- Name: annotation annotation_pkey; Type: CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.annotation
    ADD CONSTRAINT annotation_pkey PRIMARY KEY (id);


--
-- Name: query client_id; Type: CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.query
    ADD CONSTRAINT client_id UNIQUE (client_id);


--
-- Name: clusters clusters_cluster_name_key; Type: CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.clusters
    ADD CONSTRAINT clusters_cluster_name_key UNIQUE (cluster_name);


--
-- Name: clusters clusters_pkey; Type: CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.clusters
    ADD CONSTRAINT clusters_pkey PRIMARY KEY (id);


--
-- Name: clusters clusters_verbose_name_key; Type: CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.clusters
    ADD CONSTRAINT clusters_verbose_name_key UNIQUE (verbose_name);


--
-- Name: columns columns_pkey; Type: CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.columns
    ADD CONSTRAINT columns_pkey PRIMARY KEY (id);


--
-- Name: css_templates css_templates_pkey; Type: CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.css_templates
    ADD CONSTRAINT css_templates_pkey PRIMARY KEY (id);


--
-- Name: dashboard_slices dashboard_slices_pkey; Type: CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.dashboard_slices
    ADD CONSTRAINT dashboard_slices_pkey PRIMARY KEY (id);


--
-- Name: dashboard_user dashboard_user_pkey; Type: CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.dashboard_user
    ADD CONSTRAINT dashboard_user_pkey PRIMARY KEY (id);


--
-- Name: dashboards dashboards_pkey; Type: CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.dashboards
    ADD CONSTRAINT dashboards_pkey PRIMARY KEY (id);


--
-- Name: datasources datasources_pkey; Type: CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.datasources
    ADD CONSTRAINT datasources_pkey PRIMARY KEY (id);


--
-- Name: dbs dbs_database_name_key; Type: CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.dbs
    ADD CONSTRAINT dbs_database_name_key UNIQUE (database_name);


--
-- Name: dbs dbs_pkey; Type: CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.dbs
    ADD CONSTRAINT dbs_pkey PRIMARY KEY (id);


--
-- Name: dbs dbs_verbose_name_key; Type: CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.dbs
    ADD CONSTRAINT dbs_verbose_name_key UNIQUE (verbose_name);


--
-- Name: favstar favstar_pkey; Type: CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.favstar
    ADD CONSTRAINT favstar_pkey PRIMARY KEY (id);


--
-- Name: dashboards idx_unique_slug; Type: CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.dashboards
    ADD CONSTRAINT idx_unique_slug UNIQUE (slug);


--
-- Name: keyvalue keyvalue_pkey; Type: CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.keyvalue
    ADD CONSTRAINT keyvalue_pkey PRIMARY KEY (id);


--
-- Name: logs logs_pkey; Type: CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.logs
    ADD CONSTRAINT logs_pkey PRIMARY KEY (id);


--
-- Name: metrics metrics_pkey; Type: CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.metrics
    ADD CONSTRAINT metrics_pkey PRIMARY KEY (id);


--
-- Name: query query_pkey; Type: CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.query
    ADD CONSTRAINT query_pkey PRIMARY KEY (id);


--
-- Name: saved_query saved_query_pkey; Type: CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.saved_query
    ADD CONSTRAINT saved_query_pkey PRIMARY KEY (id);


--
-- Name: slice_user slice_user_pkey; Type: CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.slice_user
    ADD CONSTRAINT slice_user_pkey PRIMARY KEY (id);


--
-- Name: slices slices_pkey; Type: CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.slices
    ADD CONSTRAINT slices_pkey PRIMARY KEY (id);


--
-- Name: sql_metrics sql_metrics_pkey; Type: CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.sql_metrics
    ADD CONSTRAINT sql_metrics_pkey PRIMARY KEY (id);


--
-- Name: table_columns table_columns_pkey; Type: CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.table_columns
    ADD CONSTRAINT table_columns_pkey PRIMARY KEY (id);


--
-- Name: tables tables_pkey; Type: CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.tables
    ADD CONSTRAINT tables_pkey PRIMARY KEY (id);


--
-- Name: columns uq_columns_column_name; Type: CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.columns
    ADD CONSTRAINT uq_columns_column_name UNIQUE (column_name, datasource_id);


--
-- Name: datasources uq_datasources_cluster_name; Type: CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.datasources
    ADD CONSTRAINT uq_datasources_cluster_name UNIQUE (cluster_name, datasource_name);


--
-- Name: metrics uq_metrics_metric_name; Type: CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.metrics
    ADD CONSTRAINT uq_metrics_metric_name UNIQUE (metric_name, datasource_id);


--
-- Name: url url_pkey; Type: CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.url
    ADD CONSTRAINT url_pkey PRIMARY KEY (id);


--
-- Name: user_attribute user_attribute_pkey; Type: CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.user_attribute
    ADD CONSTRAINT user_attribute_pkey PRIMARY KEY (id);


--
-- Name: ix_query_results_key; Type: INDEX; Schema: public; Owner: superset
--

CREATE INDEX ix_query_results_key ON public.query USING btree (results_key);


--
-- Name: ti_dag_state; Type: INDEX; Schema: public; Owner: superset
--

CREATE INDEX ti_dag_state ON public.annotation USING btree (layer_id, start_dttm, end_dttm);


--
-- Name: ti_user_id_changed_on; Type: INDEX; Schema: public; Owner: superset
--

CREATE INDEX ti_user_id_changed_on ON public.query USING btree (user_id, changed_on);


--
-- Name: ab_permission_view ab_permission_view_permission_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.ab_permission_view
    ADD CONSTRAINT ab_permission_view_permission_id_fkey FOREIGN KEY (permission_id) REFERENCES public.ab_permission(id);


--
-- Name: ab_permission_view_role ab_permission_view_role_permission_view_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.ab_permission_view_role
    ADD CONSTRAINT ab_permission_view_role_permission_view_id_fkey FOREIGN KEY (permission_view_id) REFERENCES public.ab_permission_view(id);


--
-- Name: ab_permission_view_role ab_permission_view_role_role_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.ab_permission_view_role
    ADD CONSTRAINT ab_permission_view_role_role_id_fkey FOREIGN KEY (role_id) REFERENCES public.ab_role(id);


--
-- Name: ab_permission_view ab_permission_view_view_menu_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.ab_permission_view
    ADD CONSTRAINT ab_permission_view_view_menu_id_fkey FOREIGN KEY (view_menu_id) REFERENCES public.ab_view_menu(id);


--
-- Name: ab_user ab_user_changed_by_fk_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.ab_user
    ADD CONSTRAINT ab_user_changed_by_fk_fkey FOREIGN KEY (changed_by_fk) REFERENCES public.ab_user(id);


--
-- Name: ab_user ab_user_created_by_fk_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.ab_user
    ADD CONSTRAINT ab_user_created_by_fk_fkey FOREIGN KEY (created_by_fk) REFERENCES public.ab_user(id);


--
-- Name: ab_user_role ab_user_role_role_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.ab_user_role
    ADD CONSTRAINT ab_user_role_role_id_fkey FOREIGN KEY (role_id) REFERENCES public.ab_role(id);


--
-- Name: ab_user_role ab_user_role_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.ab_user_role
    ADD CONSTRAINT ab_user_role_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.ab_user(id);


--
-- Name: access_request access_request_changed_by_fk_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.access_request
    ADD CONSTRAINT access_request_changed_by_fk_fkey FOREIGN KEY (changed_by_fk) REFERENCES public.ab_user(id);


--
-- Name: access_request access_request_created_by_fk_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.access_request
    ADD CONSTRAINT access_request_created_by_fk_fkey FOREIGN KEY (created_by_fk) REFERENCES public.ab_user(id);


--
-- Name: annotation annotation_changed_by_fk_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.annotation
    ADD CONSTRAINT annotation_changed_by_fk_fkey FOREIGN KEY (changed_by_fk) REFERENCES public.ab_user(id);


--
-- Name: annotation annotation_created_by_fk_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.annotation
    ADD CONSTRAINT annotation_created_by_fk_fkey FOREIGN KEY (created_by_fk) REFERENCES public.ab_user(id);


--
-- Name: annotation_layer annotation_layer_changed_by_fk_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.annotation_layer
    ADD CONSTRAINT annotation_layer_changed_by_fk_fkey FOREIGN KEY (changed_by_fk) REFERENCES public.ab_user(id);


--
-- Name: annotation_layer annotation_layer_created_by_fk_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.annotation_layer
    ADD CONSTRAINT annotation_layer_created_by_fk_fkey FOREIGN KEY (created_by_fk) REFERENCES public.ab_user(id);


--
-- Name: annotation annotation_layer_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.annotation
    ADD CONSTRAINT annotation_layer_id_fkey FOREIGN KEY (layer_id) REFERENCES public.annotation_layer(id);


--
-- Name: clusters clusters_changed_by_fk_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.clusters
    ADD CONSTRAINT clusters_changed_by_fk_fkey FOREIGN KEY (changed_by_fk) REFERENCES public.ab_user(id);


--
-- Name: clusters clusters_created_by_fk_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.clusters
    ADD CONSTRAINT clusters_created_by_fk_fkey FOREIGN KEY (created_by_fk) REFERENCES public.ab_user(id);


--
-- Name: columns columns_changed_by_fk_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.columns
    ADD CONSTRAINT columns_changed_by_fk_fkey FOREIGN KEY (changed_by_fk) REFERENCES public.ab_user(id);


--
-- Name: columns columns_created_by_fk_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.columns
    ADD CONSTRAINT columns_created_by_fk_fkey FOREIGN KEY (created_by_fk) REFERENCES public.ab_user(id);


--
-- Name: css_templates css_templates_changed_by_fk_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.css_templates
    ADD CONSTRAINT css_templates_changed_by_fk_fkey FOREIGN KEY (changed_by_fk) REFERENCES public.ab_user(id);


--
-- Name: css_templates css_templates_created_by_fk_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.css_templates
    ADD CONSTRAINT css_templates_created_by_fk_fkey FOREIGN KEY (created_by_fk) REFERENCES public.ab_user(id);


--
-- Name: dashboard_slices dashboard_slices_dashboard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.dashboard_slices
    ADD CONSTRAINT dashboard_slices_dashboard_id_fkey FOREIGN KEY (dashboard_id) REFERENCES public.dashboards(id);


--
-- Name: dashboard_slices dashboard_slices_slice_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.dashboard_slices
    ADD CONSTRAINT dashboard_slices_slice_id_fkey FOREIGN KEY (slice_id) REFERENCES public.slices(id);


--
-- Name: dashboard_user dashboard_user_dashboard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.dashboard_user
    ADD CONSTRAINT dashboard_user_dashboard_id_fkey FOREIGN KEY (dashboard_id) REFERENCES public.dashboards(id);


--
-- Name: dashboard_user dashboard_user_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.dashboard_user
    ADD CONSTRAINT dashboard_user_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.ab_user(id);


--
-- Name: dashboards dashboards_changed_by_fk_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.dashboards
    ADD CONSTRAINT dashboards_changed_by_fk_fkey FOREIGN KEY (changed_by_fk) REFERENCES public.ab_user(id);


--
-- Name: dashboards dashboards_created_by_fk_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.dashboards
    ADD CONSTRAINT dashboards_created_by_fk_fkey FOREIGN KEY (created_by_fk) REFERENCES public.ab_user(id);


--
-- Name: datasources datasources_changed_by_fk_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.datasources
    ADD CONSTRAINT datasources_changed_by_fk_fkey FOREIGN KEY (changed_by_fk) REFERENCES public.ab_user(id);


--
-- Name: datasources datasources_cluster_name_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.datasources
    ADD CONSTRAINT datasources_cluster_name_fkey FOREIGN KEY (cluster_name) REFERENCES public.clusters(cluster_name);


--
-- Name: datasources datasources_created_by_fk_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.datasources
    ADD CONSTRAINT datasources_created_by_fk_fkey FOREIGN KEY (created_by_fk) REFERENCES public.ab_user(id);


--
-- Name: datasources datasources_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.datasources
    ADD CONSTRAINT datasources_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.ab_user(id);


--
-- Name: dbs dbs_changed_by_fk_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.dbs
    ADD CONSTRAINT dbs_changed_by_fk_fkey FOREIGN KEY (changed_by_fk) REFERENCES public.ab_user(id);


--
-- Name: dbs dbs_created_by_fk_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.dbs
    ADD CONSTRAINT dbs_created_by_fk_fkey FOREIGN KEY (created_by_fk) REFERENCES public.ab_user(id);


--
-- Name: favstar favstar_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.favstar
    ADD CONSTRAINT favstar_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.ab_user(id);


--
-- Name: columns fk_columns_datasource_id_datasources; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.columns
    ADD CONSTRAINT fk_columns_datasource_id_datasources FOREIGN KEY (datasource_id) REFERENCES public.datasources(id);


--
-- Name: metrics fk_metrics_datasource_id_datasources; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.metrics
    ADD CONSTRAINT fk_metrics_datasource_id_datasources FOREIGN KEY (datasource_id) REFERENCES public.datasources(id);


--
-- Name: logs logs_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.logs
    ADD CONSTRAINT logs_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.ab_user(id);


--
-- Name: metrics metrics_changed_by_fk_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.metrics
    ADD CONSTRAINT metrics_changed_by_fk_fkey FOREIGN KEY (changed_by_fk) REFERENCES public.ab_user(id);


--
-- Name: metrics metrics_created_by_fk_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.metrics
    ADD CONSTRAINT metrics_created_by_fk_fkey FOREIGN KEY (created_by_fk) REFERENCES public.ab_user(id);


--
-- Name: query query_database_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.query
    ADD CONSTRAINT query_database_id_fkey FOREIGN KEY (database_id) REFERENCES public.dbs(id);


--
-- Name: query query_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.query
    ADD CONSTRAINT query_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.ab_user(id);


--
-- Name: saved_query saved_query_changed_by_fk_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.saved_query
    ADD CONSTRAINT saved_query_changed_by_fk_fkey FOREIGN KEY (changed_by_fk) REFERENCES public.ab_user(id);


--
-- Name: saved_query saved_query_created_by_fk_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.saved_query
    ADD CONSTRAINT saved_query_created_by_fk_fkey FOREIGN KEY (created_by_fk) REFERENCES public.ab_user(id);


--
-- Name: saved_query saved_query_db_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.saved_query
    ADD CONSTRAINT saved_query_db_id_fkey FOREIGN KEY (db_id) REFERENCES public.dbs(id);


--
-- Name: saved_query saved_query_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.saved_query
    ADD CONSTRAINT saved_query_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.ab_user(id);


--
-- Name: slice_user slice_user_slice_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.slice_user
    ADD CONSTRAINT slice_user_slice_id_fkey FOREIGN KEY (slice_id) REFERENCES public.slices(id);


--
-- Name: slice_user slice_user_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.slice_user
    ADD CONSTRAINT slice_user_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.ab_user(id);


--
-- Name: slices slices_changed_by_fk_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.slices
    ADD CONSTRAINT slices_changed_by_fk_fkey FOREIGN KEY (changed_by_fk) REFERENCES public.ab_user(id);


--
-- Name: slices slices_created_by_fk_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.slices
    ADD CONSTRAINT slices_created_by_fk_fkey FOREIGN KEY (created_by_fk) REFERENCES public.ab_user(id);


--
-- Name: sql_metrics sql_metrics_changed_by_fk_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.sql_metrics
    ADD CONSTRAINT sql_metrics_changed_by_fk_fkey FOREIGN KEY (changed_by_fk) REFERENCES public.ab_user(id);


--
-- Name: sql_metrics sql_metrics_created_by_fk_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.sql_metrics
    ADD CONSTRAINT sql_metrics_created_by_fk_fkey FOREIGN KEY (created_by_fk) REFERENCES public.ab_user(id);


--
-- Name: sql_metrics sql_metrics_table_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.sql_metrics
    ADD CONSTRAINT sql_metrics_table_id_fkey FOREIGN KEY (table_id) REFERENCES public.tables(id);


--
-- Name: table_columns table_columns_changed_by_fk_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.table_columns
    ADD CONSTRAINT table_columns_changed_by_fk_fkey FOREIGN KEY (changed_by_fk) REFERENCES public.ab_user(id);


--
-- Name: table_columns table_columns_created_by_fk_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.table_columns
    ADD CONSTRAINT table_columns_created_by_fk_fkey FOREIGN KEY (created_by_fk) REFERENCES public.ab_user(id);


--
-- Name: table_columns table_columns_table_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.table_columns
    ADD CONSTRAINT table_columns_table_id_fkey FOREIGN KEY (table_id) REFERENCES public.tables(id);


--
-- Name: tables tables_changed_by_fk_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.tables
    ADD CONSTRAINT tables_changed_by_fk_fkey FOREIGN KEY (changed_by_fk) REFERENCES public.ab_user(id);


--
-- Name: tables tables_created_by_fk_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.tables
    ADD CONSTRAINT tables_created_by_fk_fkey FOREIGN KEY (created_by_fk) REFERENCES public.ab_user(id);


--
-- Name: tables tables_database_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.tables
    ADD CONSTRAINT tables_database_id_fkey FOREIGN KEY (database_id) REFERENCES public.dbs(id);


--
-- Name: url url_changed_by_fk_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.url
    ADD CONSTRAINT url_changed_by_fk_fkey FOREIGN KEY (changed_by_fk) REFERENCES public.ab_user(id);


--
-- Name: url url_created_by_fk_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.url
    ADD CONSTRAINT url_created_by_fk_fkey FOREIGN KEY (created_by_fk) REFERENCES public.ab_user(id);


--
-- Name: user_attribute user_attribute_changed_by_fk_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.user_attribute
    ADD CONSTRAINT user_attribute_changed_by_fk_fkey FOREIGN KEY (changed_by_fk) REFERENCES public.ab_user(id);


--
-- Name: user_attribute user_attribute_created_by_fk_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.user_attribute
    ADD CONSTRAINT user_attribute_created_by_fk_fkey FOREIGN KEY (created_by_fk) REFERENCES public.ab_user(id);


--
-- Name: user_attribute user_attribute_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.user_attribute
    ADD CONSTRAINT user_attribute_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.ab_user(id);


--
-- Name: user_attribute user_attribute_welcome_dashboard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.user_attribute
    ADD CONSTRAINT user_attribute_welcome_dashboard_id_fkey FOREIGN KEY (welcome_dashboard_id) REFERENCES public.dashboards(id);


--
-- Name: tables user_id; Type: FK CONSTRAINT; Schema: public; Owner: superset
--

ALTER TABLE ONLY public.tables
    ADD CONSTRAINT user_id FOREIGN KEY (user_id) REFERENCES public.ab_user(id);


--
-- PostgreSQL database dump complete
--

\connect template1

SET default_transaction_read_only = off;

--
-- PostgreSQL database dump
--

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

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;

--
-- Name: DATABASE template1; Type: COMMENT; Schema: -; Owner: postgres
--

COMMENT ON DATABASE template1 IS 'default template for new databases';


--
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: 
--

CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;


--
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: 
--

COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';


--
-- PostgreSQL database dump complete
--

--
-- PostgreSQL database cluster dump complete
--


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux