scr-migration.V1.000__setup.sql Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of scr Show documentation
Show all versions of scr Show documentation
SQL Model for Scottish Charity Register data
create schema scr;
create table scr.charity (
charity_number varchar not null,
charity_name varchar not null,
registered_date date not null,
known_as varchar,
charity_status varchar,
notes varchar,
postcode varchar,
constitutional_form varchar,
previous_constitutional_form varchar,
geographical_spread varchar,
main_operating_location varchar,
purposes varchar,
beneficiaries varchar,
activities varchar,
objectives varchar,
principal_office varchar,
website varchar,
most_recent_year_income bigint,
most_recent_year_expenditure bigint,
mailing_cycle varchar,
year_end date,
date_annual_return_received date,
next_year_end_date date,
donations_and_legacies_income bigint,
charitable_activities_income bigint,
other_trading_activities_income bigint,
investments_income bigint,
other_income bigint,
raising_funds_spending bigint,
charitable_activities_spending bigint,
other_spending bigint,
parent_charity_name varchar,
parent_charity_number varchar,
parent_charity_country varchar,
designated_religious_body boolean,
regulatory_type varchar
);
create index ix_charity_number_year_end on scr.charity (charity_number, year_end);