aboutsummaryrefslogtreecommitdiffstats
path: root/sql/abstractSchemaChanges/patch-templatelinks-tl_title-nullable.json
diff options
context:
space:
mode:
Diffstat (limited to 'sql/abstractSchemaChanges/patch-templatelinks-tl_title-nullable.json')
-rw-r--r--sql/abstractSchemaChanges/patch-templatelinks-tl_title-nullable.json125
1 files changed, 125 insertions, 0 deletions
diff --git a/sql/abstractSchemaChanges/patch-templatelinks-tl_title-nullable.json b/sql/abstractSchemaChanges/patch-templatelinks-tl_title-nullable.json
new file mode 100644
index 000000000000..bfbbe7c2aca1
--- /dev/null
+++ b/sql/abstractSchemaChanges/patch-templatelinks-tl_title-nullable.json
@@ -0,0 +1,125 @@
+{
+ "comment": "Changing the primary key as part of normalizing templatelinks (T306674)",
+ "before": {
+ "name": "templatelinks",
+ "comment": "Track template inclusions. The target page may or may not exist, and due to renames and deletions may refer to different page records as time goes by.",
+ "columns": [
+ {
+ "name": "tl_from",
+ "comment": "Key to the page_id of the page containing the link.",
+ "type": "integer",
+ "options": { "notnull": true, "unsigned": true, "default": 0 }
+ },
+ {
+ "name": "tl_from_namespace",
+ "type": "integer",
+ "comment": "Namespace for this page",
+ "options": { "notnull": true, "default": 0 }
+ },
+ {
+ "name": "tl_namespace",
+ "type": "integer",
+ "options": { "notnull": true, "default": 0 }
+ },
+ {
+ "name": "tl_title",
+ "type": "binary",
+ "options": { "notnull": true, "length": 255, "default": "" }
+ },
+ {
+ "name": "tl_target_id",
+ "type": "bigint",
+ "comment": "Foreign key to linktarget.lt_id",
+ "options": { "notnull": false, "unsigned": true, "default": null }
+ }
+ ],
+ "indexes": [
+ {
+ "name": "tl_namespace",
+ "columns": [ "tl_namespace", "tl_title", "tl_from" ],
+ "comment": "Reverse index, for Special:Whatlinkshere",
+ "unique": false
+ },
+ {
+ "name": "tl_backlinks_namespace",
+ "columns": [ "tl_from_namespace", "tl_namespace", "tl_title", "tl_from" ],
+ "comment": "Index for Special:Whatlinkshere with namespace filter",
+ "unique": false
+ },
+ {
+ "name": "tl_target_id",
+ "columns": [ "tl_target_id", "tl_from" ],
+ "comment": "Reverse index, for Special:Whatlinkshere",
+ "unique": false
+ },
+ {
+ "name": "tl_backlinks_namespace_target_id",
+ "columns": [ "tl_from_namespace", "tl_target_id", "tl_from" ],
+ "comment": "Index for Special:Whatlinkshere with namespace filter",
+ "unique": false
+ }
+ ],
+ "pk": [ "tl_from", "tl_namespace", "tl_title" ]
+ },
+ "after": {
+ "name": "templatelinks",
+ "comment": "Track template inclusions. The target page may or may not exist, and due to renames and deletions may refer to different page records as time goes by.",
+ "columns": [
+ {
+ "name": "tl_from",
+ "comment": "Key to the page_id of the page containing the link.",
+ "type": "integer",
+ "options": { "notnull": true, "unsigned": true, "default": 0 }
+ },
+ {
+ "name": "tl_from_namespace",
+ "type": "integer",
+ "comment": "Namespace for this page",
+ "options": { "notnull": true, "default": 0 }
+ },
+ {
+ "name": "tl_namespace",
+ "type": "integer",
+ "options": { "default": 0 }
+ },
+ {
+ "name": "tl_title",
+ "type": "binary",
+ "options": { "length": 255, "default": "" }
+ },
+ {
+ "name": "tl_target_id",
+ "type": "bigint",
+ "comment": "Foreign key to linktarget.lt_id",
+ "options": { "notnull": true, "unsigned": true }
+ }
+ ],
+ "indexes": [
+ {
+ "name": "tl_namespace",
+ "columns": [ "tl_namespace", "tl_title", "tl_from" ],
+ "comment": "Reverse index, for Special:Whatlinkshere",
+ "unique": false
+ },
+ {
+ "name": "tl_backlinks_namespace",
+ "columns": [ "tl_from_namespace", "tl_namespace", "tl_title", "tl_from" ],
+ "comment": "Index for Special:Whatlinkshere with namespace filter",
+ "unique": false
+ },
+ {
+ "name": "tl_target_id",
+ "columns": [ "tl_target_id", "tl_from" ],
+ "comment": "Reverse index, for Special:Whatlinkshere",
+ "unique": false
+ },
+ {
+ "name": "tl_backlinks_namespace_target_id",
+ "columns": [ "tl_from_namespace", "tl_target_id", "tl_from" ],
+ "comment": "Index for Special:Whatlinkshere with namespace filter",
+ "unique": false
+ }
+ ],
+ "pk": [ "tl_from", "tl_target_id" ]
+ }
+}