{"Customer_Master_Index": {"columns": [[0, "master_customer_id", "INTEGER", 1, null, 1], [1, "cmi_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["master_customer_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "CMI_Cross_References": {"columns": [[0, "cmi_cross_ref_id", "INTEGER", 1, null, 1], [1, "master_customer_id", "INTEGER", 1, null, 0], [2, "source_system_code", "CHAR(15)", 1, null, 0]], "primary_keys": ["cmi_cross_ref_id"], "foreign_keys": [[0, 0, "Customer_Master_Index", "master_customer_id", "master_customer_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Council_Tax": {"columns": [[0, "council_tax_id", "INTEGER", 1, null, 1], [1, "cmi_cross_ref_id", "INTEGER", 1, null, 0]], "primary_keys": ["council_tax_id"], "foreign_keys": [[0, 0, "CMI_Cross_References", "cmi_cross_ref_id", "cmi_cross_ref_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Business_Rates": {"columns": [[0, "business_rates_id", "INTEGER", 1, null, 1], [1, "cmi_cross_ref_id", "INTEGER", 1, null, 0]], "primary_keys": ["business_rates_id"], "foreign_keys": [[0, 0, "CMI_Cross_References", "cmi_cross_ref_id", "cmi_cross_ref_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Benefits_Overpayments": {"columns": [[0, "council_tax_id", "INTEGER", 1, null, 1], [1, "cmi_cross_ref_id", "INTEGER", 1, null, 0]], "primary_keys": ["council_tax_id"], "foreign_keys": [[0, 0, "CMI_Cross_References", "cmi_cross_ref_id", "cmi_cross_ref_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Parking_Fines": {"columns": [[0, "council_tax_id", "INTEGER", 1, null, 1], [1, "cmi_cross_ref_id", "INTEGER", 1, null, 0]], "primary_keys": ["council_tax_id"], "foreign_keys": [[0, 0, "CMI_Cross_References", "cmi_cross_ref_id", "cmi_cross_ref_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Rent_Arrears": {"columns": [[0, "council_tax_id", "INTEGER", 1, null, 1], [1, "cmi_cross_ref_id", "INTEGER", 1, null, 0]], "primary_keys": ["council_tax_id"], "foreign_keys": [[0, 0, "CMI_Cross_References", "cmi_cross_ref_id", "cmi_cross_ref_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Electoral_Register": {"columns": [[0, "electoral_register_id", "INTEGER", 1, null, 1], [1, "cmi_cross_ref_id", "INTEGER", 1, null, 0]], "primary_keys": ["electoral_register_id"], "foreign_keys": [[0, 0, "CMI_Cross_References", "cmi_cross_ref_id", "cmi_cross_ref_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE Customer_Master_Index (
    master_customer_id INTEGER NOT NULL  PRIMARY KEY,
    cmi_details VARCHAR(255)
);

CREATE TABLE CMI_Cross_References (
    cmi_cross_ref_id INTEGER NOT NULL  PRIMARY KEY,
    master_customer_id INTEGER NOT NULL,
    source_system_code CHAR(15) NOT NULL,
    FOREIGN KEY (master_customer_id) REFERENCES Customer_Master_Index(master_customer_id)
);

CREATE TABLE Council_Tax (
    council_tax_id INTEGER NOT NULL  PRIMARY KEY,
    cmi_cross_ref_id INTEGER NOT NULL,
    FOREIGN KEY (cmi_cross_ref_id) REFERENCES CMI_Cross_References(cmi_cross_ref_id)
);

CREATE TABLE Business_Rates (
    business_rates_id INTEGER NOT NULL  PRIMARY KEY,
    cmi_cross_ref_id INTEGER NOT NULL,
    FOREIGN KEY (cmi_cross_ref_id) REFERENCES CMI_Cross_References(cmi_cross_ref_id)
);

CREATE TABLE Benefits_Overpayments (
    council_tax_id INTEGER NOT NULL  PRIMARY KEY,
    cmi_cross_ref_id INTEGER NOT NULL,
    FOREIGN KEY (cmi_cross_ref_id) REFERENCES CMI_Cross_References(cmi_cross_ref_id)
);

CREATE TABLE Parking_Fines (
    council_tax_id INTEGER NOT NULL  PRIMARY KEY,
    cmi_cross_ref_id INTEGER NOT NULL,
    FOREIGN KEY (cmi_cross_ref_id) REFERENCES CMI_Cross_References(cmi_cross_ref_id)
);

CREATE TABLE Rent_Arrears (
    council_tax_id INTEGER NOT NULL  PRIMARY KEY,
    cmi_cross_ref_id INTEGER NOT NULL,
    FOREIGN KEY (cmi_cross_ref_id) REFERENCES CMI_Cross_References(cmi_cross_ref_id)
);

CREATE TABLE Electoral_Register (
    electoral_register_id INTEGER NOT NULL  PRIMARY KEY,
    cmi_cross_ref_id INTEGER NOT NULL,
    FOREIGN KEY (cmi_cross_ref_id) REFERENCES CMI_Cross_References(cmi_cross_ref_id)
);