Elgg
Version 6.1
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
engine
schema
migrations
20170728072548_create_access_collections_table.php
Go to the documentation of this file.
1
<?php
2
3
use
Phinx\Migration\AbstractMigration
;
4
use
Phinx\Db\Adapter\MysqlAdapter
;
5
6
class
CreateAccessCollectionsTable
extends
AbstractMigration {
16
public
function
change
() {
17
18
if
($this->hasTable(
"access_collections"
)) {
19
return
;
20
}
21
22
$table
= $this->table(
"access_collections"
, [
23
'engine'
=>
"InnoDB"
,
24
'encoding'
=>
"utf8mb4"
,
25
'collation'
=>
"utf8mb4_general_ci"
,
26
]);
27
28
$table
->addColumn(
'name'
,
'text'
, [
29
'null'
=>
false
,
30
]);
31
32
$table
->addColumn(
'owner_guid'
,
'integer'
, [
33
'null'
=>
false
,
34
'limit'
=> MysqlAdapter::INT_BIG,
35
'precision'
=> 20,
36
'signed'
=>
false
,
37
]);
38
39
$table
->addIndex([
'owner_guid'
], [
40
'name'
=>
"owner_guid"
,
41
'unique'
=>
false
42
]);
43
44
$table
->save();
45
46
$prefix = $this->getAdapter()->getOption(
'table_prefix'
);
47
$this->query(
"ALTER TABLE {$prefix}access_collections AUTO_INCREMENT=3"
);
48
}
49
}
MysqlAdapter
CreateAccessCollectionsTable
Definition:
20170728072548_create_access_collections_table.php:6
$table
$table
Definition:
user.php:37
AbstractMigration
CreateAccessCollectionsTable\change
change()
CREATE TABLE prefix_access_collections ( id int(11) NOT NULL AUTO_INCREMENT, name text NOT NULL...
Definition:
20170728072548_create_access_collections_table.php:16
Generated on Wed Dec 4 2024 00:00:22 for Elgg by
1.8.11