inferred_schema

Schema inferred from ChatGPT based on db.py contents.
mail@pastecode.io avatar
unknown
sql
a year ago
1.8 kB
10
Indexable
Never
CREATE DATABASE chips;

USE chips;

-- cc_packs
CREATE TABLE cc_packs (
    id INT AUTO_INCREMENT PRIMARY KEY,
    short_desc VARCHAR(255),
    game_id INT,
    slug VARCHAR(255) NOT NULL
    -- ... other columns ...
);

-- cc_game (Guessing based on mentioned columns)
CREATE TABLE cc_game (
    id INT AUTO_INCREMENT PRIMARY KEY,
    slug VARCHAR(255) NOT NULL
    -- ... other columns ...
);

-- cc_levels
CREATE TABLE cc_levels (
    id INT AUTO_INCREMENT PRIMARY KEY,
    name VARCHAR(255) NOT NULL,
    pack_id INT,
    FOREIGN KEY (pack_id) REFERENCES cc_packs(id),
    level INT NOT NULL
    -- ... other columns ...
);

-- players
CREATE TABLE players (
    id INT AUTO_INCREMENT PRIMARY KEY,
    player VARCHAR(255),
    designer VARCHAR(255)
    -- ... other columns ...
);

-- cc_levels_designers
CREATE TABLE cc_levels_designers (
    level_id INT,
    designer_id INT,
    FOREIGN KEY (level_id) REFERENCES cc_levels(id),
    FOREIGN KEY (designer_id) REFERENCES players(id)
    -- ... other columns ...
);

-- cc_rule_types
CREATE TABLE cc_rule_types (
    id INT AUTO_INCREMENT PRIMARY KEY,
    short_desc VARCHAR(255) NOT NULL
    -- ... other columns ...
);

-- cc_metrics
CREATE TABLE cc_metrics (
    id INT AUTO_INCREMENT PRIMARY KEY,
    short_desc VARCHAR(255) NOT NULL
    -- ... other columns ...
);

-- cc_level_attributes
CREATE TABLE cc_level_attributes (
    level_id INT,
    rule_type_id INT,
    metric_id INT,
    highest_reported INT,
    highest_public INT,
    FOREIGN KEY (level_id) REFERENCES cc_levels(id),
    FOREIGN KEY (rule_type_id) REFERENCES cc_rule_types(id),
    FOREIGN KEY (metric_id) REFERENCES cc_metrics(id)
    -- ... other columns ...
);

-- other tables...