aboutsummaryrefslogblamecommitdiffstats
path: root/init.sql
blob: d050359605f39a29321ac490866b4cd489fc9782 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

















                                                                               
                                         





                                                              
CREATE TABLE feed (
  id INT NOT NULL AUTO_INCREMENT,
  url VARCHAR(100) NOT NULL,
  web_url VARCHAR(100) NOT NULL DEFAULT "",
  title VARCHAR(100) NOT NULL DEFAULT "",
  last_updated TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  UNIQUE KEY (url),
  PRIMARY KEY (id)
);

CREATE TABLE item (
  id INT NOT NULL AUTO_INCREMENT,
  feed_id INT NOT NULL,
  title TEXT,
  url VARCHAR(100) NOT NULL,
  description TEXT,
  publish_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
  read_state BOOLEAN DEFAULT FALSE NOT NULL,
  starred BOOLEAN DEFAULT FALSE NOT NULL,
  FOREIGN KEY (feed_id) REFERENCES feed(id) ON DELETE CASCADE,
  UNIQUE KEY (url),
  INDEX (publish_date),
  PRIMARY KEY (id)
);