CREATE TABLE job (
    id MEDIUMINT PRIMARY KEY AUTO_INCREMENT,
    title VARCHAR(100),
    description VARCHAR(100),
    created datetime,
    modified datetime,
    travel_percent VARCHAR(100),
    on_site VARCHAR(100),
    time_percent VARCHAR(100)
);

CREATE TABLE skill (
    id MEDIUMINT PRIMARY KEY AUTO_INCREMENT,
    ident VARCHAR(100),
    description VARCHAR(100),
    created datetime,
    modified datetime
);

INSERT INTO skill ( ident, description )
    VALUES ( 'drive', 'Valid driver license and clean record' );

INSERT INTO skill ( ident, description )
    VALUES ( 'coffee', 'Ability to brew excellent coffee from bad grounds' );

INSERT INTO skill ( ident, description )
    VALUES ( 'bigtop_exp', '5+ years bigtop experience' );

INSERT INTO skill ( ident, description )
    VALUES ( 'bigtop', 'Experience with bigtop' );

CREATE TABLE position (
    id MEDIUMINT PRIMARY KEY AUTO_INCREMENT,
    n_openings MEDIUMINT,
    location VARCHAR(100),
    created datetime,
    modified datetime,
    job MEDIUMINT,
    closes date,
    boss VARCHAR(100),
    pay VARCHAR(100)
);

CREATE TABLE job_skill (
    id MEDIUMINT PRIMARY KEY AUTO_INCREMENT,
    job MEDIUMINT,
    skill MEDIUMINT
);
CREATE TABLE user (
    id MEDIUMINT PRIMARY KEY AUTO_INCREMENT,
    ident VARCHAR(100),
    password VARCHAR(100),
    created datetime,
    modified datetime,
    first_name VARCHAR(100),
    last_name VARCHAR(100),
    email VARCHAR(100)
);

INSERT INTO user ( ident, first_name, last_name, password )
    VALUES ( 'pcrow', 'Phil', 'Crow', 'test' );

INSERT INTO user ( ident, first_name, last_name, password )
    VALUES ( 'lcrow', 'Lisa', 'Crow', 'test' );

CREATE TABLE grouping (
    id MEDIUMINT PRIMARY KEY AUTO_INCREMENT,
    ident VARCHAR(100),
    description VARCHAR(100),
    created datetime,
    modified datetime
);

INSERT INTO grouping ( ident, description )
    VALUES ( 'HR', 'Human Resources Staff' );

CREATE TABLE user_grouping (
    id MEDIUMINT PRIMARY KEY AUTO_INCREMENT,
    user MEDIUMINT,
    grouping MEDIUMINT
);

INSERT INTO user_grouping ( user, grouping )
    VALUES ( 1, 1 );

CREATE TABLE change_log (
    id MEDIUMINT PRIMARY KEY AUTO_INCREMENT,
    ident VARCHAR(100),
    description VARCHAR(100),
    created datetime,
    modified datetime,
    user MEDIUMINT
);

