Left: | ||
Right: |
OLD | NEW |
---|---|
1 DROP TABLE IF EXISTS crawler_sites; | 1 DROP TABLE IF EXISTS crawler_sites; |
2 DROP TABLE IF EXISTS crawler_runs; | 2 DROP TABLE IF EXISTS crawler_runs; |
3 DROP TABLE IF EXISTS crawler_data; | 3 DROP TABLE IF EXISTS crawler_data; |
4 | 4 |
5 CREATE TABLE crawler_sites ( | 5 CREATE TABLE crawler_sites ( |
6 id INT NOT NULL AUTO_INCREMENT, | 6 id INT NOT NULL AUTO_INCREMENT, |
7 PRIMARY KEY (id), | 7 PRIMARY KEY (id), |
8 url VARCHAR(255) NOT NULL | 8 url VARCHAR(512) NOT NULL |
Wladimir Palant
2012/09/14 17:24:18
How about UNIQUE(url) constraint? This will make s
Felix Dahlke
2012/09/26 15:20:30
Done.
| |
9 ); | 9 ); |
10 | 10 |
11 CREATE TABLE crawler_runs ( | 11 CREATE TABLE crawler_runs ( |
12 id INT NOT NULL AUTO_INCREMENT, | 12 id INT NOT NULL AUTO_INCREMENT, |
13 PRIMARY KEY (id), | 13 PRIMARY KEY (id), |
14 timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP | 14 timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP |
15 ); | 15 ); |
16 | 16 |
17 CREATE TABLE crawler_data ( | 17 CREATE TABLE crawler_data ( |
18 id INT NOT NULL AUTO_INCREMENT, | 18 id INT NOT NULL AUTO_INCREMENT, |
19 PRIMARY KEY (id), | 19 PRIMARY KEY (id), |
20 run INT NOT NULL, | 20 run INT NOT NULL, |
21 FOREIGN KEY (run) REFERENCES crawler_runs (id), | 21 FOREIGN KEY (run) REFERENCES crawler_runs (id), |
22 site INT NOT NULL, | 22 site INT NOT NULL, |
23 FOREIGN KEY (site) REFERENCES crawler_sites (id), | 23 FOREIGN KEY (site) REFERENCES crawler_sites (id), |
24 request_url VARCHAR(255) NOT NULL, | 24 url VARCHAR(512) NOT NULL, |
25 document_url VARCHAR(255) NOT NULL | 25 filtered BOOLEAN NOT NULL |
26 ); | 26 ); |
OLD | NEW |