{"follows": {"columns": [[0, "f1", "int(11)", 1, null, 1], [1, "f2", "int(11)", 1, null, 2]], "primary_keys": ["f1", "f2"], "foreign_keys": [[0, 0, "user_profiles", "f2", "uid", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "user_profiles", "f1", "uid", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "f1"], [1, 1, "f2"]]], "check_constraints": []}, "tweets": {"columns": [[0, "id", "bigint(20)", 1, null, 1], [1, "uid", "int(11)", 1, null, 0], [2, "text", "char(140)", 1, null, 0], [3, "createdate", "datetime", 0, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["id"], "foreign_keys": [[0, 0, "user_profiles", "uid", "uid", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "id"]]], "check_constraints": []}, "user_profiles": {"columns": [[0, "uid", "int(11)", 1, null, 1], [1, "name", "varchar(255)", 0, "NULL", 0], [2, "email", "varchar(255)", 0, "NULL", 0], [3, "partitionid", "int(11)", 0, "NULL", 0], [4, "followers", "int(11)", 0, "NULL", 0]], "primary_keys": ["uid"], "foreign_keys": [], "unique_constraints": [[[0, 0, "uid"]]], "check_constraints": []}}
CREATE TABLE follows (
    f1 int(11) NOT NULL  PRIMARY KEY,
    f2 int(11) NOT NULL  PRIMARY KEY,
    PRIMARY KEY (f1, f2),
    UNIQUE (f1, f2),
    FOREIGN KEY (f2) REFERENCES user_profiles(uid),
    FOREIGN KEY (f1) REFERENCES user_profiles(uid)
);

CREATE TABLE tweets (
    id bigint(20) NOT NULL  PRIMARY KEY,
    uid int(11) NOT NULL,
    text char(140) NOT NULL,
    createdate datetime  DEFAULT CURRENT_TIMESTAMP,
    UNIQUE (id),
    FOREIGN KEY (uid) REFERENCES user_profiles(uid)
);

CREATE TABLE user_profiles (
    uid int(11) NOT NULL  PRIMARY KEY,
    name varchar(255)  DEFAULT NULL,
    email varchar(255)  DEFAULT NULL,
    partitionid int(11)  DEFAULT NULL,
    followers int(11)  DEFAULT NULL,
    UNIQUE (uid)
);