aboutsummaryrefslogtreecommitdiffstats
path: root/sql/abstractSchemaChanges/patch-drop-rev_page_id.json
blob: 0348193b9bc3efd0ada1a581383408705366f351 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
{
	"comment": "Drop rev_page_id index on revision (T163532)",
	"before": {
		"name": "revision",
		"comment": "Every edit of a page creates also a revision row. This stores metadata about the revision, and a reference to the text storage backend.",
		"columns": [
			{
				"name": "rev_id",
				"comment": "Unique ID to identify each revision",
				"type": "integer",
				"options": { "unsigned": true, "notnull": true, "autoincrement": true }
			},
			{
				"name": "rev_page",
				"comment": "Key to page_id. This should never be invalid",
				"type": "integer",
				"options": { "unsigned": true, "notnull": true }
			},
			{
				"name": "rev_comment_id",
				"comment": "Key to comment.comment_id. Comment summarizing the change",
				"type": "bigint",
				"options": { "unsigned": true, "notnull": true, "default": 0 }
			},
			{
				"name": "rev_actor",
				"comment": "Key to actor.actor_id of the user or IP who made this edit",
				"type": "bigint",
				"options": { "unsigned": true, "notnull": true, "default": 0 }
			},
			{
				"name": "rev_timestamp",
				"comment": "Timestamp of when revision was created",
				"type": "mwtimestamp",
				"options": { "notnull": true }
			},
			{
				"name": "rev_minor_edit",
				"comment": "Records whether the user marked the 'minor edit' checkbox. Many automated edits are marked as minor",
				"type": "mwtinyint",
				"options": { "notnull": true, "unsigned": true, "default": 0 }
			},
			{
				"name": "rev_deleted",
				"comment": "Restrictions on who can access this revision",
				"type": "mwtinyint",
				"options": { "notnull": true, "unsigned": true, "default": 0 }
			},
			{
				"name": "rev_len",
				"comment": "Length of this revision in bytes",
				"type": "integer",
				"options": { "unsigned": true, "notnull": false }
			},
			{
				"name": "rev_parent_id",
				"comment": "Key to revision.rev_id. This field is used to add support for a tree structure (The Adjacency List Model)",
				"type": "integer",
				"options": { "unsigned": true, "notnull": false }
			},
			{
				"name": "rev_sha1",
				"comment": "SHA-1 text content hash in base-36",
				"type": "binary",
				"options": { "length": 32, "notnull": true, "default": "" }
			}
		],
		"indexes": [
			{
				"name": "rev_page_id",
				"columns": [ "rev_page", "rev_id" ],
				"comment": "The index is proposed for removal, do not use it in new code: T163532. Used for ordering revisions within a page by rev_id, which is usually incorrect, since rev_timestamp is normally the correct order. It can also be used by dumpBackup.php, if a page and rev_id range is specified.",
				"unique": false
			},
			{
				"name": "rev_timestamp",
				"columns": [ "rev_timestamp" ],
				"comment": "Used by ApiQueryAllRevisions",
				"unique": false
			},
			{
				"name": "rev_page_timestamp",
				"columns": [ "rev_page", "rev_timestamp" ],
				"comment": "History index",
				"unique": false
			},
			{
				"name": "rev_actor_timestamp",
				"columns": [ "rev_actor", "rev_timestamp", "rev_id" ],
				"comment": "User contributions index",
				"unique": false
			},
			{
				"name": "rev_page_actor_timestamp",
				"columns": [ "rev_page", "rev_actor", "rev_timestamp" ],
				"comment": "Credits index. This is scanned in order to compile credits lists for pages, in ApiQueryContributors. Also for ApiQueryRevisions if rvuser is specified",
				"unique": false
			}
		],
		"pk": [ "rev_id" ]
	},
	"after": {
		"name": "revision",
		"comment": "Every edit of a page creates also a revision row. This stores metadata about the revision, and a reference to the text storage backend.",
		"columns": [
			{
				"name": "rev_id",
				"comment": "Unique ID to identify each revision",
				"type": "integer",
				"options": { "unsigned": true, "notnull": true, "autoincrement": true }
			},
			{
				"name": "rev_page",
				"comment": "Key to page_id. This should never be invalid",
				"type": "integer",
				"options": { "unsigned": true, "notnull": true }
			},
			{
				"name": "rev_comment_id",
				"comment": "Key to comment.comment_id. Comment summarizing the change",
				"type": "bigint",
				"options": { "unsigned": true, "notnull": true, "default": 0 }
			},
			{
				"name": "rev_actor",
				"comment": "Key to actor.actor_id of the user or IP who made this edit",
				"type": "bigint",
				"options": { "unsigned": true, "notnull": true, "default": 0 }
			},
			{
				"name": "rev_timestamp",
				"comment": "Timestamp of when revision was created",
				"type": "mwtimestamp",
				"options": { "notnull": true }
			},
			{
				"name": "rev_minor_edit",
				"comment": "Records whether the user marked the 'minor edit' checkbox. Many automated edits are marked as minor",
				"type": "mwtinyint",
				"options": { "notnull": true, "unsigned": true, "default": 0 }
			},
			{
				"name": "rev_deleted",
				"comment": "Restrictions on who can access this revision",
				"type": "mwtinyint",
				"options": { "notnull": true, "unsigned": true, "default": 0 }
			},
			{
				"name": "rev_len",
				"comment": "Length of this revision in bytes",
				"type": "integer",
				"options": { "unsigned": true, "notnull": false }
			},
			{
				"name": "rev_parent_id",
				"comment": "Key to revision.rev_id. This field is used to add support for a tree structure (The Adjacency List Model)",
				"type": "integer",
				"options": { "unsigned": true, "notnull": false }
			},
			{
				"name": "rev_sha1",
				"comment": "SHA-1 text content hash in base-36",
				"type": "binary",
				"options": { "length": 32, "notnull": true, "default": "" }
			}
		],
		"indexes": [
			{
				"name": "rev_timestamp",
				"columns": [ "rev_timestamp" ],
				"comment": "Used by ApiQueryAllRevisions",
				"unique": false
			},
			{
				"name": "rev_page_timestamp",
				"columns": [ "rev_page", "rev_timestamp" ],
				"comment": "History index",
				"unique": false
			},
			{
				"name": "rev_actor_timestamp",
				"columns": [ "rev_actor", "rev_timestamp", "rev_id" ],
				"comment": "User contributions index",
				"unique": false
			},
			{
				"name": "rev_page_actor_timestamp",
				"columns": [ "rev_page", "rev_actor", "rev_timestamp" ],
				"comment": "Credits index. This is scanned in order to compile credits lists for pages, in ApiQueryContributors. Also for ApiQueryRevisions if rvuser is specified",
				"unique": false
			}
		],
		"pk": [ "rev_id" ]
	}
}