CREATE TABLE mgw_notes (
  id INTEGER NOT NULL default '0',
  title CHARACTER VARYING(255) NOT NULL default '',
  content TEXT NOT NULL,
  ispublic INTEGER NOT NULL default '0',
  owner INTEGER NOT NULL default '0',
  catid INTEGER NOT NULL default '0',
  lu_user INTEGER NOT NULL default '0',
  lu_update TIMESTAMP NOT NULL,
  PRIMARY KEY  (id)
);

CREATE TABLE mgw_notes_categories (
  id INTEGER NOT NULL default '0',
  name CHARACTER VARYING(100) NOT NULL default '',
  description CHARACTER VARYING(255) NOT NULL default '',
  lu_update TIMESTAMP NOT NULL,
  lu_user INTEGER NOT NULL default '0',
  PRIMARY KEY  (id),
  UNIQUE(name)
);

INSERT INTO mgw_configtags VALUES ('overview_notes','notes','numer of notes to show in overview',0,0,'int',1,'2002-01-01');
INSERT INTO mgw_configtags VALUES ('notes_orderby','notes','default order of notes',0,0,'str',1,'2002-01-01');
INSERT INTO mgw_configtags VALUES ('notes_order_dir','notes','order asc or desc',0,0,'str',1,'2002-01-01');

INSERT INTO mgw_config VALUES (0,'overview_notes',1,'5',0,'',1,'2002-01-01');
