<commit_before>CREATE TABLE Vehicle (
    vin varchar(64) NOT NULL, -- SRV-VIN-2 A VIN shall be identified by an 1-64 byte string

    PRIMARY KEY (vin)
);

CREATE TABLE Package (
    -- Natural key is name + version
    name varchar(200) NOT NULL,
    version varchar(200) NOT NULL,
    uri varchar(4096) NOT NULL,
    file_size int NOT NULL,
    check_sum varchar(4096) NOT NULL,
    -- Free form description
    description text,
    -- Free form information about the vendor
    vendor text,

    PRIMARY KEY (name, version)
);

CREATE TABLE UpdateRequests (
    update_request_id BINARY(36) NOT NULL,
    package_name VARCHAR(200) NOT NULL,
    package_version VARCHAR(200) NOT NULL,
    creation_time DATETIME NOT NULL,
    start_after DATETIME NOT NULL,
    finish_before DATETIME NOT NULL,
    priority INT NOT NULL,

    PRIMARY KEY (update_request_id),
    FOREIGN KEY fk_update_request_package_id (package_name, package_version) REFERENCES Package(name, version)
);

CREATE TABLE UpdateSpecs (
    update_request_id BINARY(36) NOT NULL,
    vin varchar(64) NOT NULL,
    status VARCHAR(200),

    PRIMARY KEY (update_request_id, vin),
    FOREIGN KEY fk_update_specs_request (update_request_id) REFERENCES UpdateRequests(update_request_id),
    FOREIGN KEY fk_update_specs_vehicle (vin) REFERENCES Vehicle(vin)
);

CREATE TABLE RequiredPackages (
  update_request_id BINARY(36) NOT NULL,
  vin varchar(64) NOT NULL,
  package_name VARCHAR(200) NOT NULL,
  package_version VARCHAR(200) NOT NULL,

  PRIMARY KEY (update_request_id, vin, package_name, package_version),
  FOREIGN KEY fk_downloads_update_specs (update_request_id, vin) REFERENCES UpdateSpecs(update_request_id, vin),
  FOREIGN KEY fk_downloads_package (package_name, package_version) REFERENCES Package(name, version)<commit_msg>store UUIDs in CHAR instead of BINARY<commit_after>CREATE TABLE Vehicle (
    vin varchar(64) NOT NULL, -- SRV-VIN-2 A VIN shall be identified by an 1-64 byte string

    PRIMARY KEY (vin)
);

CREATE TABLE Package (
    -- Natural key is name + version
    name varchar(200) NOT NULL,
    version varchar(200) NOT NULL,
    uri varchar(4096) NOT NULL,
    file_size int NOT NULL,
    check_sum varchar(4096) NOT NULL,
    -- Free form description
    description text,
    -- Free form information about the vendor
    vendor text,

    PRIMARY KEY (name, version)
);

CREATE TABLE UpdateRequests (
    update_request_id CHAR(36) NOT NULL,
    package_name VARCHAR(200) NOT NULL,
    package_version VARCHAR(200) NOT NULL,
    creation_time DATETIME NOT NULL,
    start_after DATETIME NOT NULL,
    finish_before DATETIME NOT NULL,
    priority INT NOT NULL,

    PRIMARY KEY (update_request_id),
    FOREIGN KEY fk_update_request_package_id (package_name, package_version) REFERENCES Package(name, version)
);

CREATE TABLE UpdateSpecs (
    update_request_id CHAR(36) NOT NULL,
    vin varchar(64) NOT NULL,
    status VARCHAR(200),

    PRIMARY KEY (update_request_id, vin),
    FOREIGN KEY fk_update_specs_request (update_request_id) REFERENCES UpdateRequests(update_request_id),
    FOREIGN KEY fk_update_specs_vehicle (vin) REFERENCES Vehicle(vin)
);

CREATE TABLE RequiredPackages (
  update_request_id CHAR(36) NOT NULL,
  vin varchar(64) NOT NULL,
  package_name VARCHAR(200) NOT NULL,
  package_version VARCHAR(200) NOT NULL,

  PRIMARY KEY (update_request_id, vin, package_name, package_version),
  FOREIGN KEY fk_downloads_update_specs (update_request_id, vin) REFERENCES UpdateSpecs(update_request_id, vin),
  FOREIGN KEY fk_downloads_package (package_name, package_version) REFERENCES Package(name, version)
{'fraction_non_alphanumeric': 0.0695364238410596, 'fraction_numerical': 0.024834437086092714, 'mean_word_length': 4.323054331864904, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4890445', 'n_tokens_mistral': 1247, 'n_tokens_neox': 1127, 'n_words': 361}