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)
);

INSERT INTO job ( title, description, travel_percent, on_site, time_percent )
    VALUES ( 'Jr. Meeting Attender', 'Attend meetings and work on projects', '5%', 'onsite', 'fulltime' );

INSERT INTO job ( title, description, travel_percent, on_site, time_percent )
    VALUES ( 'Sr. Meeting Attender', 'Attend meetings and lead projects', '5%', 'onsite', 'fulltime' );

INSERT INTO job ( title, description, travel_percent, on_site, time_percent )
    VALUES ( 'Chief Financial Obfuscator', 'Top level financial manager', '5%', 'onsite', 'fulltime' );

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 ( 'mtg_convene', 'Convene and run meetings' );

INSERT INTO skill ( ident, description )
    VALUES ( 'mtg_attend', 'Attend meetings' );

INSERT INTO skill ( ident, description )
    VALUES ( 'good_drive', 'Hold valid driver license and have clean driving record' );

INSERT INTO skill ( ident, description )
    VALUES ( 'cook_book_max', 'Have 15+ years practical experience cooking books.' );

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

CREATE TABLE job_skill (
    id MEDIUMINT PRIMARY KEY AUTO_INCREMENT,
    job MEDIUMINT,
    skill MEDIUMINT
);
CREATE TABLE auth_users (
    id MEDIUMINT NOT NULL DEFAULT NEXTVAL( 'auth_users_seq'::text ),
    user_id MEDIUMINT PRIMARY KEY DEFAULT CURRVAL( 'auth_users_seq'::text ),
    active boolean,
    user_name VARCHAR(100),
    passwd VARCHAR(100),
    crypt VARCHAR(100),
    first_name VARCHAR(100),
    last_name VARCHAR(100),
    email VARCHAR(100)
);

INSERT INTO auth_users ( active, user_name, passwd, crypt, first_name, last_name, email )
    VALUES ( 't', 'pcrow', 'for_test', 'fo5XAdfKx4dwQ', 'Phil', 'Crow', 'philcrow2000@yahoo.com' );

CREATE TABLE auth_groups (
    id MEDIUMINT PRIMARY KEY AUTO_INCREMENT,
    ident VARCHAR(100),
    description VARCHAR(100),
    name VARCHAR(100)
);

INSERT INTO auth_groups ( ident, name, description )
    VALUES ( 'HR', 'HR', 'Full admin access' );

CREATE TABLE auth_group_members (
    id MEDIUMINT PRIMARY KEY AUTO_INCREMENT,
    user_id MEDIUMINT,
    group_id MEDIUMINT
);

INSERT INTO auth_group_members ( user_id, group_id )
    VALUES ( 1, 1 );

CREATE TABLE auth_pages (
    id MEDIUMINT PRIMARY KEY AUTO_INCREMENT,
    user_perm VARCHAR(100),
    group_perm MEDIUMINT,
    world_perm MEDIUMINT,
    owner_id MEDIUMINT,
    group_id MEDIUMINT,
    url VARCHAR(100),
    title VARCHAR(100)
);

