3 use Phinx\Db\Adapter\MysqlAdapter;
4 use Phinx\Migration\AbstractMigration;
29 $table = $this->table(
'access_collections');
30 $prefix = $this->getAdapter()->getOption(
'table_prefix');
32 if (!
$table->hasColumn(
'subtype')) {
33 $table->addColumn(
'subtype',
'string', [
35 'limit' => MysqlAdapter::TEXT_SMALL,
44 UPDATE {$prefix}{$table->getName()} acl
45 INNER JOIN {$prefix}entities e ON acl.owner_guid = e.guid
46 SET acl.subtype = 'friends_collection'
52 UPDATE {$prefix}{$table->getName()} acl
53 INNER JOIN {$prefix}metadata md ON acl.owner_guid = md.entity_guid
54 INNER JOIN {$prefix}entities e ON md.entity_guid = e.guid
55 SET acl.subtype = 'group_acl'
56 WHERE md.name = 'group_acl'
63 DELETE md FROM {$prefix}metadata md
64 INNER JOIN {$prefix}entities e ON md.entity_guid = e.guid
65 INNER JOIN {$prefix}{$table->getName()} acl ON md.value = acl.id
66 WHERE md.name = 'group_acl'