Elgg
Version 6.0
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
engine
schema
migrations
20170728075306_create_users_api_sessions_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
CreateUsersApiSessionsTable
extends
AbstractMigration {
18
public
function
change
() {
19
20
if
($this->hasTable(
"users_apisessions"
)) {
21
return
;
22
}
23
24
$table
= $this->table(
"users_apisessions"
, [
25
'engine'
=>
"MEMORY"
,
26
'encoding'
=>
"utf8mb4"
,
27
'collation'
=>
"utf8mb4_general_ci"
,
28
]);
29
30
$table
->addColumn(
'user_guid'
,
'integer'
, [
31
'null'
=>
false
,
32
'limit'
=> MysqlAdapter::INT_BIG,
33
'precision'
=> 20,
34
'signed'
=>
false
,
35
]);
36
37
$table
->addColumn(
'token'
,
'string'
, [
38
'null'
=>
true
,
39
'limit'
=> 40,
40
]);
41
42
$table
->addColumn(
'expires'
,
'integer'
, [
43
'null'
=>
false
,
44
'limit'
=> MysqlAdapter::INT_REGULAR,
45
'precision'
=> 11,
46
'after'
=>
'token'
47
]);
48
49
$table
->addIndex([
'user_guid'
], [
50
'name'
=>
"user_guid"
,
51
'unique'
=>
false
,
52
]);
53
54
$table
->addIndex([
'token'
], [
55
'name'
=>
"token"
,
56
'unique'
=>
false
,
57
]);
58
59
$table
->save();
60
}
61
}
MysqlAdapter
CreateUsersApiSessionsTable
Definition:
20170728075306_create_users_api_sessions_table.php:6
$table
$table
Definition:
user.php:37
AbstractMigration
CreateUsersApiSessionsTable\change
change()
CREATE TABLE prefix_users_apisessions ( id int(11) NOT NULL AUTO_INCREMENT, user_guid bigint(20) unsi...
Definition:
20170728075306_create_users_api_sessions_table.php:18
Generated on Sun Oct 13 2024 00:00:24 for Elgg by
1.8.11