{"html_url": "https://github.com/simonw/datasette/issues/1098#issuecomment-735444698", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1098", "id": 735444698, "node_id": "MDEyOklzc3VlQ29tbWVudDczNTQ0NDY5OA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-11-29T19:50:14Z", "updated_at": "2020-11-29T19:50:14Z", "author_association": "OWNER", "body": "Demo of the fix: https://latest.datasette.io/fixtures/foreign_key_references (the compound foreign key columns do not link to anything)", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 743370900, "label": "Foreign key links break for compound foreign keys"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1098#issuecomment-735443654", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1098", "id": 735443654, "node_id": "MDEyOklzc3VlQ29tbWVudDczNTQ0MzY1NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-11-29T19:41:01Z", "updated_at": "2020-11-29T19:41:01Z", "author_association": "OWNER", "body": "Fix is out in 0.52.1: https://docs.datasette.io/en/latest/changelog.html#v0-52-1", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 743370900, "label": "Foreign key links break for compound foreign keys"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1098#issuecomment-735442226", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1098", "id": 735442226, "node_id": "MDEyOklzc3VlQ29tbWVudDczNTQ0MjIyNg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-11-29T19:28:04Z", "updated_at": "2020-11-29T19:28:04Z", "author_association": "OWNER", "body": "For the moment I'm going to solve this by teaching Datasette's internal introspection methods - in particular these ones - to ignore compound foreign keys entirely:\r\n\r\nhttps://github.com/simonw/datasette/blob/e800ffcf7cc6a915eb554b369c654f87162575e5/datasette/utils/__init__.py#L470-L505", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 743370900, "label": "Foreign key links break for compound foreign keys"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1098#issuecomment-727656208", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1098", "id": 727656208, "node_id": "MDEyOklzc3VlQ29tbWVudDcyNzY1NjIwOA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-11-15T23:26:14Z", "updated_at": "2020-11-15T23:26:14Z", "author_association": "OWNER", "body": "Schema for that broken example:\r\n```sql\r\nCREATE TABLE generators_eia860 (\r\n\tid INTEGER NOT NULL, \r\n\tplant_id_eia INTEGER, \r\n\tgenerator_id TEXT, \r\n\treport_date DATE, \r\n\toperational_status_code TEXT, \r\n\toperational_status TEXT, \r\n\townership_code TEXT, \r\n\tutility_id_eia INTEGER, \r\n\tcapacity_mw FLOAT, \r\n\tsummer_capacity_mw FLOAT, \r\n\twinter_capacity_mw FLOAT, \r\n\tenergy_source_code_1 TEXT, \r\n\tenergy_source_code_2 TEXT, \r\n\tenergy_source_code_3 TEXT, \r\n\tenergy_source_code_4 TEXT, \r\n\tenergy_source_code_5 TEXT, \r\n\tenergy_source_code_6 TEXT, \r\n\tfuel_type_code_pudl TEXT, \r\n\tmultiple_fuels BOOLEAN, \r\n\tdeliver_power_transgrid BOOLEAN, \r\n\tsyncronized_transmission_grid BOOLEAN, \r\n\tturbines_num INTEGER, \r\n\tplanned_modifications BOOLEAN, \r\n\tplanned_net_summer_capacity_uprate_mw FLOAT, \r\n\tplanned_net_winter_capacity_uprate_mw FLOAT, \r\n\tplanned_uprate_date DATE, \r\n\tplanned_net_summer_capacity_derate_mw FLOAT, \r\n\tplanned_net_winter_capacity_derate_mw FLOAT, \r\n\tplanned_derate_date DATE, \r\n\tplanned_new_prime_mover_code TEXT, \r\n\tplanned_energy_source_code_1 TEXT, \r\n\tplanned_repower_date DATE, \r\n\tother_planned_modifications BOOLEAN, \r\n\tother_modifications_date DATE, \r\n\tplanned_retirement_date DATE, \r\n\tcarbon_capture BOOLEAN, \r\n\tstartup_source_code_1 TEXT, \r\n\tstartup_source_code_2 TEXT, \r\n\tstartup_source_code_3 TEXT, \r\n\tstartup_source_code_4 TEXT, \r\n\ttechnology_description TEXT, \r\n\tturbines_inverters_hydrokinetics TEXT, \r\n\ttime_cold_shutdown_full_load_code TEXT, \r\n\tplanned_new_capacity_mw FLOAT, \r\n\tcofire_fuels BOOLEAN, \r\n\tswitch_oil_gas BOOLEAN, \r\n\tnameplate_power_factor FLOAT, \r\n\tminimum_load_mw FLOAT, \r\n\tuprate_derate_during_year BOOLEAN, \r\n\tuprate_derate_completed_date DATE, \r\n\tcurrent_planned_operating_date DATE, \r\n\tsummer_estimated_capability_mw FLOAT, \r\n\twinter_estimated_capability_mw FLOAT, \r\n\tretirement_date DATE, \r\n\tPRIMARY KEY (id), \r\n\tFOREIGN KEY(plant_id_eia, generator_id) REFERENCES generators_entity_eia (plant_id_eia, generator_id), \r\n\tFOREIGN KEY(utility_id_eia) REFERENCES utilities_entity_eia (utility_id_eia), \r\n\tCHECK (multiple_fuels IN (0, 1)), \r\n\tCHECK (deliver_power_transgrid IN (0, 1)), \r\n\tCHECK (syncronized_transmission_grid IN (0, 1)), \r\n\tCHECK (planned_modifications IN (0, 1)), \r\n\tCHECK (other_planned_modifications IN (0, 1)), \r\n\tCHECK (carbon_capture IN (0, 1)), \r\n\tCHECK (cofire_fuels IN (0, 1)), \r\n\tCHECK (switch_oil_gas IN (0, 1)), \r\n\tCHECK (uprate_derate_during_year IN (0, 1))\r\n);\r\n```\r\nhttps://pudl-datasette-xl7xwcpe2a-uc.a.run.app/pudl/generators_entity_eia is:\r\n```sql\r\nCREATE TABLE generators_entity_eia (\r\n\tplant_id_eia INTEGER NOT NULL, \r\n\tgenerator_id TEXT NOT NULL, \r\n\tprime_mover_code TEXT, \r\n\tduct_burners BOOLEAN, \r\n\toperating_date DATE, \r\n\ttopping_bottoming_code TEXT, \r\n\tsolid_fuel_gasification BOOLEAN, \r\n\tpulverized_coal_tech BOOLEAN, \r\n\tfluidized_bed_tech BOOLEAN, \r\n\tsubcritical_tech BOOLEAN, \r\n\tsupercritical_tech BOOLEAN, \r\n\tultrasupercritical_tech BOOLEAN, \r\n\tstoker_tech BOOLEAN, \r\n\tother_combustion_tech BOOLEAN, \r\n\tbypass_heat_recovery BOOLEAN, \r\n\trto_iso_lmp_node_id TEXT, \r\n\trto_iso_location_wholesale_reporting_id TEXT, \r\n\tassociated_combined_heat_power BOOLEAN, \r\n\toriginal_planned_operating_date DATE, \r\n\toperating_switch TEXT, \r\n\tpreviously_canceled BOOLEAN, \r\n\tPRIMARY KEY (plant_id_eia, generator_id), \r\n\tFOREIGN KEY(plant_id_eia) REFERENCES plants_entity_eia (plant_id_eia), \r\n\tCHECK (duct_burners IN (0, 1)), \r\n\tCHECK (solid_fuel_gasification IN (0, 1)), \r\n\tCHECK (pulverized_coal_tech IN (0, 1)), \r\n\tCHECK (fluidized_bed_tech IN (0, 1)), \r\n\tCHECK (subcritical_tech IN (0, 1)), \r\n\tCHECK (supercritical_tech IN (0, 1)), \r\n\tCHECK (ultrasupercritical_tech IN (0, 1)), \r\n\tCHECK (stoker_tech IN (0, 1)), \r\n\tCHECK (other_combustion_tech IN (0, 1)), \r\n\tCHECK (bypass_heat_recovery IN (0, 1)), \r\n\tCHECK (associated_combined_heat_power IN (0, 1)), \r\n\tCHECK (previously_canceled IN (0, 1))\r\n);\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 743370900, "label": "Foreign key links break for compound foreign keys"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1098#issuecomment-727655636", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1098", "id": 727655636, "node_id": "MDEyOklzc3VlQ29tbWVudDcyNzY1NTYzNg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-11-15T23:22:27Z", "updated_at": "2020-11-15T23:22:27Z", "author_association": "OWNER", "body": "Need to replicate this in the fixtures, then fix it.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 743370900, "label": "Foreign key links break for compound foreign keys"}, "performed_via_github_app": null}