-- $AFresh1: DB_Format.sql,v 1.1 2010/03/09 20:18:35 andrew Exp $
BEGIN TRANSACTION;
    CREATE TABLE __WebKitDatabaseInfoTable__ (
        key TEXT NOT NULL ON CONFLICT FAIL UNIQUE ON CONFLICT REPLACE,
        value TEXT NOT NULL ON CONFLICT FAIL
    );
    INSERT INTO __WebKitDatabaseInfoTable__ VALUES('WebKitDatabaseVersionKey','');

    CREATE TABLE categories (
        cat_id INTEGER PRIMARY KEY,
        category TEXT, 
        templ_id INTEGER DEFAULT 0,
        color INTEGER DEFAULT 0,
        passwd INTEGER DEFAULT 0
    );
    -- INSERT INTO categories VALUES(0,'undefined',0,0,0);

    CREATE TABLE keywords (
        kw_id INTEGER PRIMARY KEY,
        color INTEGER,
        keyword TEXT
    );

    CREATE TABLE memos (
        memo_id INTEGER PRIMARY KEY,
        cat_id INTEGER,
        head TEXT,
        memo TEXT,
        pos INTEGER DEFAULT 0,
        level INTEGER DEFAULT 0,
        keyword INTEGER DEFAULT 0,
        privat INTEGER DEFAULT 0,
        created TIMESTAMP,
        changed TIMESTAMP
    );

    CREATE TABLE version (dbver INTEGER PRIMARY KEY);
    INSERT INTO version VALUES(1);
    INSERT INTO version VALUES(2);
COMMIT;
