| 1 | { |
| 2 | "comment": "Changing the primary key as part of normalizing templatelinks (T306674)", |
| 3 | "before": { |
| 4 | "name": "templatelinks", |
| 5 | "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.", |
| 6 | "columns": [ |
| 7 | { |
| 8 | "name": "tl_from", |
| 9 | "comment": "Key to the page_id of the page containing the link.", |
| 10 | "type": "integer", |
| 11 | "options": { "notnull": true, "unsigned": true, "default": 0 } |
| 12 | }, |
| 13 | { |
| 14 | "name": "tl_from_namespace", |
| 15 | "type": "integer", |
| 16 | "comment": "Namespace for this page", |
| 17 | "options": { "notnull": true, "default": 0 } |
| 18 | }, |
| 19 | { |
| 20 | "name": "tl_namespace", |
| 21 | "type": "integer", |
| 22 | "options": { "notnull": true, "default": 0 } |
| 23 | }, |
| 24 | { |
| 25 | "name": "tl_title", |
| 26 | "type": "binary", |
| 27 | "options": { "notnull": true, "length": 255, "default": "" } |
| 28 | }, |
| 29 | { |
| 30 | "name": "tl_target_id", |
| 31 | "type": "bigint", |
| 32 | "comment": "Foreign key to linktarget.lt_id", |
| 33 | "options": { "notnull": false, "unsigned": true, "default": null } |
| 34 | } |
| 35 | ], |
| 36 | "indexes": [ |
| 37 | { |
| 38 | "name": "tl_namespace", |
| 39 | "columns": [ "tl_namespace", "tl_title", "tl_from" ], |
| 40 | "comment": "Reverse index, for Special:Whatlinkshere", |
| 41 | "unique": false |
| 42 | }, |
| 43 | { |
| 44 | "name": "tl_backlinks_namespace", |
| 45 | "columns": [ "tl_from_namespace", "tl_namespace", "tl_title", "tl_from" ], |
| 46 | "comment": "Index for Special:Whatlinkshere with namespace filter", |
| 47 | "unique": false |
| 48 | }, |
| 49 | { |
| 50 | "name": "tl_target_id", |
| 51 | "columns": [ "tl_target_id", "tl_from" ], |
| 52 | "comment": "Reverse index, for Special:Whatlinkshere", |
| 53 | "unique": false |
| 54 | }, |
| 55 | { |
| 56 | "name": "tl_backlinks_namespace_target_id", |
| 57 | "columns": [ "tl_from_namespace", "tl_target_id", "tl_from" ], |
| 58 | "comment": "Index for Special:Whatlinkshere with namespace filter", |
| 59 | "unique": false |
| 60 | } |
| 61 | ], |
| 62 | "pk": [ "tl_from", "tl_namespace", "tl_title" ] |
| 63 | }, |
| 64 | "after": { |
| 65 | "name": "templatelinks", |
| 66 | "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.", |
| 67 | "columns": [ |
| 68 | { |
| 69 | "name": "tl_from", |
| 70 | "comment": "Key to the page_id of the page containing the link.", |
| 71 | "type": "integer", |
| 72 | "options": { "notnull": true, "unsigned": true, "default": 0 } |
| 73 | }, |
| 74 | { |
| 75 | "name": "tl_from_namespace", |
| 76 | "type": "integer", |
| 77 | "comment": "Namespace for this page", |
| 78 | "options": { "notnull": true, "default": 0 } |
| 79 | }, |
| 80 | { |
| 81 | "name": "tl_namespace", |
| 82 | "type": "integer", |
| 83 | "options": { "default": 0 } |
| 84 | }, |
| 85 | { |
| 86 | "name": "tl_title", |
| 87 | "type": "binary", |
| 88 | "options": { "length": 255, "default": "" } |
| 89 | }, |
| 90 | { |
| 91 | "name": "tl_target_id", |
| 92 | "type": "bigint", |
| 93 | "comment": "Foreign key to linktarget.lt_id", |
| 94 | "options": { "notnull": true, "unsigned": true } |
| 95 | } |
| 96 | ], |
| 97 | "indexes": [ |
| 98 | { |
| 99 | "name": "tl_namespace", |
| 100 | "columns": [ "tl_namespace", "tl_title", "tl_from" ], |
| 101 | "comment": "Reverse index, for Special:Whatlinkshere", |
| 102 | "unique": false |
| 103 | }, |
| 104 | { |
| 105 | "name": "tl_backlinks_namespace", |
| 106 | "columns": [ "tl_from_namespace", "tl_namespace", "tl_title", "tl_from" ], |
| 107 | "comment": "Index for Special:Whatlinkshere with namespace filter", |
| 108 | "unique": false |
| 109 | }, |
| 110 | { |
| 111 | "name": "tl_target_id", |
| 112 | "columns": [ "tl_target_id", "tl_from" ], |
| 113 | "comment": "Reverse index, for Special:Whatlinkshere", |
| 114 | "unique": false |
| 115 | }, |
| 116 | { |
| 117 | "name": "tl_backlinks_namespace_target_id", |
| 118 | "columns": [ "tl_from_namespace", "tl_target_id", "tl_from" ], |
| 119 | "comment": "Index for Special:Whatlinkshere with namespace filter", |
| 120 | "unique": false |
| 121 | } |
| 122 | ], |
| 123 | "pk": [ "tl_from", "tl_target_id" ] |
| 124 | } |
| 125 | } |