Elgg
Version master
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
engine
schema
migrations
20170728074504_create_api_users_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
CreateApiUsersTable
extends
AbstractMigration {
17
public
function
change
() {
18
19
if
($this->hasTable(
"api_users"
)) {
20
return
;
21
}
22
23
$table
= $this->table(
"api_users"
, [
24
'engine'
=>
"InnoDB"
,
25
'encoding'
=>
"utf8mb4"
,
26
'collation'
=>
"utf8mb4_general_ci"
,
27
]);
28
29
$table
->addColumn(
'api_key'
,
'string'
, [
30
'null'
=>
true
,
31
'limit'
=> 40,
32
]);
33
34
$table
->addColumn(
'secret'
,
'string'
, [
35
'null'
=>
false
,
36
'limit'
=> 40,
37
]);
38
39
$table
->addColumn(
'active'
,
'integer'
, [
40
'null'
=>
true
,
41
'default'
=>
'1'
,
42
'limit'
=> MysqlAdapter::INT_REGULAR,
43
'precision'
=> 11,
44
]);
45
46
$table
->addIndex([
'api_key'
], [
47
'name'
=>
"api_key"
,
48
'unique'
=>
true
,
49
]);
50
51
$table
->save();
52
}
53
}
CreateApiUsersTable
Definition:
20170728074504_create_api_users_table.php:6
MysqlAdapter
CreateApiUsersTable\change
change()
CREATE TABLE prefix_api_users ( id int(11) NOT NULL AUTO_INCREMENT, api_key varchar(40) DEFAULT NULL...
Definition:
20170728074504_create_api_users_table.php:17
$table
$table
Definition:
user.php:37
AbstractMigration
Generated on Sat Dec 21 2024 00:02:53 for Elgg by
1.8.11