Загрузка данных


CREATE TABLE ourpension.ops_pension_assignment_application (
    id int4 NOT NULL,
    sharer_id int4 NULL,
    "number" text NULL,
    "date" date NULL,
    agent_id int4 NULL,
    accepted timestamp NULL,
    rejected timestamp NULL,
    canceled timestamp NULL,
    "version" timestamp NULL,
    retirement_pension numeric(24, 2) NULL,
    bank_detail_id int4 NULL,
    "comment" varchar(250) NULL,
    pension_type_code bpchar(2) NULL,
    ops_payment_type_code bpchar(2) NULL,
    payout_period int4 NULL,
    retirement_date date NULL,
    individual_document_id int4 NULL,
    previously_appointed_payment bool NULL,
    appeal_date date NULL,
    pension_date date NULL,
    dismiss_date date NULL,
    pfr_certificate_id int4 NULL,
    by_representative bool DEFAULT false NOT NULL,
    representative_individual_id int4 NULL,
    representative_certificate_name text NULL,
    representative_certificate_date date NULL,
    representative_certificate_number varchar(50) NULL,
    representative_certificate_issuer text NULL,
    decision_payment_type_code varchar(2) NULL,
    address_id int4 NULL,
    payment_way bpchar(2) DEFAULT '01'::bpchar NOT NULL,
    bank_account_id varchar(64) NULL,
    ops_application_payment_id varchar(64) NULL,
    ops_pfr_reference_id varchar(64) NULL,
    representative_certificate_doc_type_enums_id int4 NULL,
    representative_certificate_series varchar(50) NULL,
    representative_certificate_expire_date date NULL,
    client_personal_data_id int4 NULL,
    representative_personal_data_id int4 NULL,
    card_link_id varchar(50) NULL,
    other_enclosured_doc_name varchar(250) NULL,
    outgoing_card_link_id varchar(50) NULL,
    information_source_id int4 DEFAULT 1 NULL,
    registration timestamp NULL,
    accepted_agent_id int4 NULL,
    rejected_agent_id int4 NULL,
    canceled_agent_id int4 NULL,
    registration_agent_id int4 NULL,
    CONSTRAINT ops_pension_assignment_application_pkey PRIMARY KEY (id),
    CONSTRAINT ops_pension_assignment_application__client_personal_data_id_fk FOREIGN KEY (client_personal_data_id) REFERENCES ourpension.application_personal_data_individual(id),
    CONSTRAINT ops_pension_assignment_application__information_source_id_fk FOREIGN KEY (information_source_id) REFERENCES ourpension.information_source(id),
    CONSTRAINT ops_pension_assignment_application__repres_personal_data_id_fk FOREIGN KEY (representative_personal_data_id) REFERENCES ourpension.application_personal_data_individual(id),
    CONSTRAINT ops_pension_assignment_application__representative_certificate_ FOREIGN KEY (representative_certificate_doc_type_enums_id) REFERENCES ourpension.enums(id),
    CONSTRAINT ops_pension_assignment_application_agent_accepted_fk FOREIGN KEY (accepted_agent_id) REFERENCES ourpension.agent(id),
    CONSTRAINT ops_pension_assignment_application_agent_canceled_fk FOREIGN KEY (canceled_agent_id) REFERENCES ourpension.agent(id),
    CONSTRAINT ops_pension_assignment_application_agent_id_fk FOREIGN KEY (agent_id) REFERENCES ourpension.agent(id),
    CONSTRAINT ops_pension_assignment_application_agent_registration_fk FOREIGN KEY (registration_agent_id) REFERENCES ourpension.agent(id),
    CONSTRAINT ops_pension_assignment_application_agent_rejected_fk FOREIGN KEY (rejected_agent_id) REFERENCES ourpension.agent(id),
    CONSTRAINT ops_pension_assignment_application_decision_payment_type_code_f FOREIGN KEY (decision_payment_type_code) REFERENCES ourpension.decision_payment_type(code),
    CONSTRAINT ops_pension_assignment_application_individual_document_id_fkey FOREIGN KEY (individual_document_id) REFERENCES "data".individual_document(id),
    CONSTRAINT ops_pension_assignment_application_individual_id_fk FOREIGN KEY (representative_individual_id) REFERENCES ourpension.individual(id),
    CONSTRAINT ops_pension_assignment_application_ops_payment_type_code_fk FOREIGN KEY (ops_payment_type_code) REFERENCES ourpension.ops_payment_type(code),
    CONSTRAINT ops_pension_assignment_application_payment_way_fk FOREIGN KEY (payment_way) REFERENCES ourpension.payment_type(code),
    CONSTRAINT ops_pension_assignment_application_pension_type_code_fk FOREIGN KEY (pension_type_code) REFERENCES ourpension.pension_type(code),
    CONSTRAINT ops_pension_assignment_application_pfr_certificate_id_fk FOREIGN KEY (pfr_certificate_id) REFERENCES ourpension.pfr_certificate(id),
    CONSTRAINT ops_pension_assignment_application_sharer_id_fk FOREIGN KEY (sharer_id) REFERENCES ourpension.sharer(id)
);