Elgg
Version 6.2
engine
schema
migrations
20171016113827_update_metadata_columns.php
Go to the documentation of this file.
1
<?php
2
3
use Phinx\Migration\AbstractMigration;
4
5
class
UpdateMetadataColumns
extends
AbstractMigration {
10
public
function
up
() {
11
12
if
($this->hasTable(
'metadata'
)) {
13
$table
= $this->table(
'metadata'
);
14
15
if
(
$table
->hasIndexByName(
'owner_guid'
)) {
16
$table
->removeIndexByName(
'owner_guid'
)->save();
17
}
18
if
(
$table
->hasIndexByName(
'access_id'
)) {
19
$table
->removeIndexByName(
'access_id'
)->save();
20
}
21
22
if
(
$table
->hasColumn(
'owner_guid'
)) {
23
$table
->changeColumn(
'owner_guid'
,
'integer'
, [
'null'
=>
true
]);
24
}
25
if
(
$table
->hasColumn(
'access_id'
)) {
26
$table
->changeColumn(
'access_id'
,
'integer'
, [
'null'
=>
true
]);
27
}
28
29
$table
->save();
30
}
31
}
32
}
$table
$table
Definition:
user.php:37
UpdateMetadataColumns
Definition:
20171016113827_update_metadata_columns.php:5
UpdateMetadataColumns\up
up()
Changes metadata owner_guid, access_id and enabled column usage to allow null values Also removes own...
Definition:
20171016113827_update_metadata_columns.php:10
Generated on Fri Aug 22 2025 00:00:20 for Elgg by
1.9.1