Elgg
Version master
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
engine
schema
migrations
20200331083912_add_entity_guid_name_index_to_annotations.php
Go to the documentation of this file.
1
<?php
2
3
use
Phinx\Db\Adapter\MysqlAdapter
;
4
use
Phinx\Migration\AbstractMigration
;
5
6
class
AddEntityGuidNameIndexToAnnotations
extends
AbstractMigration {
7
11
public
function
change
() {
12
if
(!$this->hasTable(
'annotations'
)) {
13
return
;
14
}
15
16
$table
= $this->table(
'annotations'
);
17
if
(
$table
->hasIndexByName(
'entity_guid_name'
)) {
18
return
;
19
}
20
21
$table
->addIndex([
'entity_guid'
,
'name'
], [
22
'name'
=>
'entity_guid_name'
,
23
'unique'
=>
false
,
24
'limit'
=> [
25
'name'
=> MysqlAdapter::INT_TINY,
26
],
27
]);
28
29
$table
->save();
30
}
31
}
MysqlAdapter
AddEntityGuidNameIndexToAnnotations
Definition:
20200331083912_add_entity_guid_name_index_to_annotations.php:6
AddEntityGuidNameIndexToAnnotations\change
change()
Add an index to the annotations table for the columns entity_guid and name.
Definition:
20200331083912_add_entity_guid_name_index_to_annotations.php:11
$table
$table
Definition:
user.php:37
AbstractMigration
Generated on Thu Dec 12 2024 00:02:51 for Elgg by
1.8.11