CREATE TABLE wn_workspaces(
    wsid serial,
    wsname TEXT NOT NULL,
    nextNoteNum INT NOT NULL,
    time timestamp NOT NULL default now(),
    primary key(wsid)
);

CREATE TABLE wn_notes (
    nid serial,
    noteid TEXT NOT NULL,
    content TEXT NOT NULL,
    bgcolor TEXT NOT NULL,
    xposition INT NOT NULL,
    yposition INT NOT NULL,
    height INT NOT NULL,
    width INT NOT NULL,
    zindex INT NOT NULL,
    wsid INT NOT NULL references wn_workspaces(wsid),
    time timestamp NOT NULL default now(),
    primary key(nid)
);

create index wn_notes_wsid on wn_notes(wsid);

