Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: sitescripts/urlfixer/schema.sql

Issue 8483155: Added typo data collection (/submitData) (Closed)
Left Patch Set: Created Oct. 9, 2012, 10:58 a.m.
Right Patch Set: Created Oct. 9, 2012, 2:27 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « sitescripts/urlfixer/__init__.py ('k') | sitescripts/urlfixer/web/__init__.py » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 DROP TABLE IF EXISTS domains; 1 DROP TABLE IF EXISTS domains;
2 DROP TABLE IF EXISTS corrections; 2 DROP TABLE IF EXISTS corrections;
3 3
4 CREATE TABLE domains( 4 CREATE TABLE domains(
5 id INT NOT NULL AUTO_INCREMENT, 5 id INT NOT NULL AUTO_INCREMENT,
6 domain VARCHAR(50) NOT NULL, 6 domain VARCHAR(50) NOT NULL,
7 domain_correct FLOAT(10,10), 7 PRIMARY KEY(id),
8 correction_correct FLOAT(10,10), 8 UNIQUE(domain)
Wladimir Palant 2012/10/09 11:51:14 Aren't these two fields just derivatives of the da
9 PRIMARY KEY(id)
10 ); 9 );
11 10
12 CREATE TABLE corrections( 11 CREATE TABLE corrections(
13 id INT NOT NULL AUTO_INCREMENT, 12 id INT NOT NULL AUTO_INCREMENT,
14 domain INT NOT NULL, 13 domain INT NOT NULL,
15 status INT NOT NULL, 14 status INT NOT NULL,
16 curr_month INT NOT NULL, 15 curr_month INT NOT NULL,
17 prev_month INT NOT NULL, 16 prev_month INT NOT NULL,
18 curr_year INT NOT NULL, 17 curr_year INT NOT NULL,
19 prev_year INT NOT NULL, 18 prev_year INT NOT NULL,
20 PRIMARY KEY(id), 19 PRIMARY KEY(id),
21 FOREIGN KEY(domain) REFERENCES domains(id) 20 FOREIGN KEY(domain) REFERENCES domains(id),
21 UNIQUE(domain, status)
22 ); 22 );
23
24 CREATE UNIQUE INDEX idx_domain ON domains(domain);
25 CREATE UNIQUE INDEX idx_domain_status ON corrections(domain, status);
Wladimir Palant 2012/10/09 11:51:14 Use UNIQUE constraint instead of these two indexes
Thomas Greiner 2012/10/09 13:47:02 I prefer having indexes because SELECTs on this ta
Wladimir Palant 2012/10/09 14:17:08 A UNIQUE constraint will always create an index im
LEFTRIGHT

Powered by Google App Engine
This is Rietveld