-
Notifications
You must be signed in to change notification settings - Fork 4
Update create_db #68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update create_db #68
Changes from all commits
590586e
6317e13
2510bca
7ad0774
eabc60c
6061b9b
644cdbf
0e7cab3
babadff
f16d1cc
5cd0d4f
4a44423
397b290
36990d6
a8e0e8f
881981d
a3f7dc6
bc44010
a8c2113
8409982
786919e
7034cad
d9fa6c9
4084d5c
a49336f
c3f960b
6e0c3b2
f1a4cc2
4dc1e0d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,39 +4,32 @@ PRAGMA foreign_keys = ON; | |
| CREATE TABLE agency ( | ||
| year int NOT NULL, | ||
| agency_num varchar(9) NOT NULL, | ||
| authority_num varchar(6) CHECK(year < 2024 | ||
| OR authority_num IS NOT NULL) , | ||
|
jeancochrane marked this conversation as resolved.
|
||
| home_rule_ind boolean NOT NULL, | ||
| agg_ext_base_year int CHECK(agg_ext_base_year >= 2003) , | ||
| lim_numerator bigint CHECK(lim_numerator >= 0) , | ||
| lim_denominator bigint CHECK(lim_denominator >= 0) , | ||
| lim_rate double CHECK(lim_rate >= 0) , | ||
| prior_eav bigint CHECK(prior_eav >= 0) NOT NULL, | ||
| curr_new_prop bigint CHECK(curr_new_prop >= 0) NOT NULL, | ||
| prior_eav bigint CHECK((prior_eav >= 0) | ||
| AND (year >= 2024 OR prior_eav IS NOT NULL)), | ||
| curr_new_prop bigint NOT NULL, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Thought, non-blocking] Clarifying this change for posterity: We learned that |
||
| cty_cook_eav bigint CHECK(cty_cook_eav >= 0) NOT NULL, | ||
| cty_dupage_eav bigint CHECK(cty_dupage_eav >= 0) NOT NULL, | ||
| cty_lake_eav bigint CHECK(cty_lake_eav >= 0) NOT NULL, | ||
| cty_will_eav bigint CHECK(cty_will_eav >= 0) NOT NULL, | ||
| cty_kane_eav bigint CHECK(cty_kane_eav >= 0) NOT NULL, | ||
| cty_mchenry_eav bigint CHECK(cty_mchenry_eav >= 0) NOT NULL, | ||
| cty_dekalb_eav bigint CHECK(cty_dekalb_eav >= 0) NOT NULL, | ||
| cty_grundy_eav bigint CHECK(cty_grundy_eav >= 0) NOT NULL, | ||
| cty_kankakee_eav bigint CHECK(cty_kankakee_eav >= 0) NOT NULL, | ||
| cty_kendall_eav bigint CHECK(cty_kendall_eav >= 0) NOT NULL, | ||
| cty_lasalle_eav bigint CHECK(cty_lasalle_eav >= 0) NOT NULL, | ||
| cty_livingston_eav bigint CHECK(cty_livingston_eav >= 0) NOT NULL, | ||
| cty_overlap_eav bigint CHECK(cty_overlap_eav >= 0) NOT NULL, | ||
| cty_total_eav bigint CHECK(cty_total_eav >= 0) NOT NULL, | ||
| pct_burden double CHECK(pct_burden >= 0 | ||
| AND pct_burden <= 1) NOT NULL, | ||
| pct_burden double CHECK((pct_burden >= 0 | ||
| AND pct_burden <= 1) | ||
| AND (year >= 2024 OR pct_burden IS NOT NULL)), | ||
| total_levy bigint CHECK(total_levy >= 0) NOT NULL, | ||
| total_max_levy bigint CHECK(total_max_levy >= 0) NOT NULL, | ||
| total_prelim_rate double CHECK(total_prelim_rate >= 0) NOT NULL, | ||
| total_reduced_levy bigint CHECK(total_reduced_levy >= 0) , | ||
| total_final_levy bigint CHECK(total_final_levy >= 0) NOT NULL, | ||
| total_final_rate double CHECK(total_final_rate >= 0) NOT NULL, | ||
| reduction_type varchar , | ||
| reduction_pct double CHECK(reduction_pct >= 0 | ||
| AND reduction_pct <= 1) , | ||
| total_non_cap_ext double CHECK(total_non_cap_ext >= 0) , | ||
| total_ext double CHECK(total_ext >= 0) NOT NULL, | ||
|
|
||
| PRIMARY KEY (year, agency_num) | ||
| ) WITHOUT ROWID; | ||
|
|
||
|
|
@@ -53,6 +46,9 @@ CREATE TABLE agency_info ( | |
| agency_name_original varchar NOT NULL, | ||
| major_type varchar(21) NOT NULL, | ||
| minor_type varchar(10) NOT NULL, | ||
| agency_num_24 varchar(9) , | ||
| agency_name_24 varchar , | ||
| agency_change_24 boolean NOT NULL, | ||
| PRIMARY KEY (agency_num) | ||
| ) WITHOUT ROWID; | ||
|
|
||
|
|
@@ -66,14 +62,13 @@ CREATE TABLE agency_fund ( | |
| agency_num varchar(9) NOT NULL, | ||
| fund_num varchar(3) NOT NULL, | ||
| levy bigint CHECK(levy >= 0) NOT NULL, | ||
| loss_pct double CHECK(loss_pct >= 0 | ||
| loss_pct double CHECK(loss_pct >= 0 | ||
| AND loss_pct <= 1) NOT NULL, | ||
| levy_plus_loss bigint CHECK(levy_plus_loss >= 0) NOT NULL, | ||
| rate_ceiling double CHECK(rate_ceiling >= 0) NOT NULL, | ||
| rate_ceiling double CHECK(rate_ceiling >= 0) NOT NULL, | ||
| max_levy bigint CHECK(max_levy >= 0) NOT NULL, | ||
| prelim_rate double CHECK(prelim_rate >= 0) NOT NULL, | ||
| ptell_reduced_levy bigint CHECK(ptell_reduced_levy >= 0) , | ||
| ptell_reduced_ind boolean NOT NULL, | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This field is no longer present in the 2024 reports and was removed from the |
||
| final_levy bigint CHECK(final_levy >= 0) NOT NULL, | ||
| final_rate double CHECK(final_rate >= 0) NOT NULL, | ||
| PRIMARY KEY (year, agency_num, fund_num), | ||
|
|
@@ -87,14 +82,17 @@ CREATE INDEX ix_agency_fund_fund_num ON agency_fund(fund_num); | |
|
|
||
| /** agency_fund_info **/ | ||
| CREATE TABLE agency_fund_info ( | ||
| fund_num varchar(3) NOT NULL, | ||
| agency_num varchar(9) NOT NULL, | ||
| fund_type_num varchar(3) NOT NULL, | ||
| fund_type_name varchar NOT NULL, | ||
| fund_num varchar(6) NOT NULL, | ||
| fund_name varchar NOT NULL, | ||
| capped_ind boolean NOT NULL, | ||
| PRIMARY KEY (fund_num) | ||
| PRIMARY KEY (agency_num, fund_type_num, fund_num) | ||
| ) WITHOUT ROWID; | ||
|
|
||
| CREATE INDEX ix_agency_fund_info_capped_ind ON agency_fund_info(capped_ind); | ||
|
|
||
|
|
||
| /** cpi **/ | ||
| CREATE TABLE cpi ( | ||
|
|
@@ -155,6 +153,7 @@ CREATE TABLE pin ( | |
| exe_vet_dis_lt50 int CHECK(exe_vet_dis_lt50 >= 0) NOT NULL, | ||
| exe_vet_dis_50_69 int CHECK(exe_vet_dis_50_69 >= 0) NOT NULL, | ||
| exe_vet_dis_ge70 int CHECK(exe_vet_dis_ge70 >= 0) NOT NULL, | ||
| exe_vet_dis_100 int CHECK(exe_vet_dis_100 >= 0) NOT NULL, | ||
| exe_abate int CHECK(exe_abate >= 0) NOT NULL, | ||
| PRIMARY KEY (year, pin) | ||
| ) WITHOUT ROWID; | ||
|
|
@@ -224,7 +223,10 @@ CREATE TABLE tif_distribution ( | |
| tax_code_eav bigint CHECK(tax_code_eav >= 0) NOT NULL, | ||
| tax_code_frozen_eav bigint CHECK(tax_code_frozen_eav >= 0) NOT NULL, | ||
| tax_code_revenue bigint CHECK(tax_code_revenue >= 0) NOT NULL, | ||
| tax_code_distribution_pct double CHECK(tax_code_distribution_pct >= 0) NOT NULL, | ||
| tax_code_distribution_pct double CHECK((tax_code_distribution_pct >= 0) | ||
| AND (year >= 2024 | ||
| OR tax_code_distribution_pct IS NOT NULL)), | ||
|
|
||
| PRIMARY KEY (year, agency_num, tax_code_num) | ||
| FOREIGN KEY (year, agency_num) REFERENCES tif_crosswalk(year, agency_num_dist) | ||
| ) WITHOUT ROWID; | ||
|
|
@@ -236,3 +238,31 @@ CREATE INDEX ix_tif_distribution_year_agency_num | |
| ON tif_distribution(year, agency_num); | ||
| CREATE INDEX ix_tif_distribution_year_tax_code_num | ||
| ON tif_distribution(year, tax_code_num); | ||
|
|
||
| /** pin_tif_distribution **/ | ||
| CREATE TABLE pin_tif_distribution ( | ||
| year int NOT NULL, | ||
| pin varchar(14) NOT NULL, | ||
| agency_num varchar(9) NOT NULL, | ||
| tax_code_num varchar(5) NOT NULL, | ||
| tax_code_rate double CHECK(tax_code_rate >= 0) NOT NULL, | ||
| pin_eav int CHECK(pin_eav >= 0) NOT NULL, | ||
| pin_frozen_eav int CHECK(pin_frozen_eav >= 0) NOT NULL, | ||
| pin_revenue double CHECK(pin_revenue >= 0) NOT NULL, | ||
| pin_increment_eav int CHECK(pin_increment_eav >= 0) NOT NULL, | ||
| pin_distribution_pct double CHECK(pin_distribution_pct >= 0) NOT NULL, | ||
| transit_tif_to_cps double CHECK(transit_tif_to_cps >= 0) , | ||
| transit_tif_to_tif double CHECK(transit_tif_to_tif >= 0) , | ||
| transit_tif_to_dist double CHECK(transit_tif_to_dist >= 0) , | ||
| is_transit_tif boolean NOT NULL, | ||
| PRIMARY KEY (year, pin, agency_num) | ||
| FOREIGN KEY (year, agency_num) REFERENCES tif_crosswalk(year, agency_num_dist) | ||
| ) WITHOUT ROWID; | ||
|
|
||
| CREATE INDEX ix_pin_tif_distribution_year ON pin_tif_distribution(year); | ||
| CREATE INDEX ix_pin_tif_distribution_agency_num ON pin_tif_distribution(agency_num); | ||
| CREATE INDEX ix_pin_tif_distribution_tax_code_num ON pin_tif_distribution(tax_code_num); | ||
| CREATE INDEX ix_pin_tif_distribution_year_agency_num | ||
| ON pin_tif_distribution(year, agency_num); | ||
| CREATE INDEX ix_pin_tif_distribution_year_tax_code_num | ||
| ON pin_tif_distribution(year, tax_code_num); | ||
Uh oh!
There was an error while loading. Please reload this page.