-- $Id: create_tables.orasql,v 1.2 2001/04/13 10:00:31 lkneschke Exp $

CREATE TABLE news_site (
  con		number NOT NULL,
  display	varchar2(255),
  base_url	varchar2(255),
  newsfile	varchar2(255),
  lastread	number(11),
  newstype	varchar2(15),
  cachetime	number(11),
  listings	number(11),
  PRIMARY KEY (con)
);

create unique index news_site_con 
  on news_site (con);

create sequence news_site_seq
  increment by 1
  start with 0
  maxvalue 999999999
  minvalue 0
  nocycle
  nocache;

create trigger news_site_bri
before insert on news_site
for each row
begin
  select news_site_seq.nextval into :new.con from dual;
end;
/

insert into news_site (display,base_url,newsfile,lastread,newstype,cachetime,listings) values ('Slashdot','http://slashdot.org','/slashdot.rdf',0,'rdf',60,20);
insert into news_site (display,base_url,newsfile,lastread,newstype,cachetime,listings) values ('Freshmeat','http://freshmeat.net','/backend/fm.rdf',0,'fm',60,20);
insert into news_site (display,base_url,newsfile,lastread,newstype,cachetime,listings) values ('Linux&nbsp;Today','http://linuxtoday.com','/backend/linuxtoday.xml',0,'lt',60,20);
insert into news_site (display,base_url,newsfile,lastread,newstype,cachetime,listings) values ('Linux&nbsp;Game&nbsp;Tome','http://happypenguin.org','/html/news.rdf',0,'rdf',60,20);
insert into news_site (display,base_url,newsfile,lastread,newstype,cachetime,listings) values ('linux-at-work.de','http://linux-at-work.de','/backend.php',0,'rdf',60,20);
insert into news_site (display,base_url,newsfile,lastread,newstype,cachetime,listings) values ('Segfault','http://segfault.org','/stories.xml',0,'sf',60,20);
insert into news_site (display,base_url,newsfile,lastread,newstype,cachetime,listings) values ('KDE&nbsp;News','http://www.kde.org','/news/kdenews.rdf',0,'rdf',60,20);
insert into news_site (display,base_url,newsfile,lastread,newstype,cachetime,listings) values ('Gnome&nbsp;News','http://news.gnome.org','/gnome-news/rdf',0,'rdf',60,20);
insert into news_site (display,base_url,newsfile,lastread,newstype,cachetime,listings) values ('Gimp&nbsp;News','http://www.xach.com','/gimp/news/channel.rdf',0,'rdf-chan',60,20);
insert into news_site (display,base_url,newsfile,lastread,newstype,cachetime,listings) values ('Mozilla','http://www.mozilla.org','/news.rdf',0,'rdf-chan',60,20);
insert into news_site (display,base_url,newsfile,lastread,newstype,cachetime,listings) values ('MozillaZine','http://www.mozillazine.org','/contents.rdf',0,'rdf',60,20);

CREATE TABLE news_headlines (
  site		number NOT NULL,
  title		varchar2(255),
  link		varchar2(255)
);

CREATE TABLE users_headlines (
  owner		varchar2(25) DEFAULT '' NOT NULL,
  site		number NOT NULL
);
