Elgg  Version 3.0
20170728073540_create_access_collection_membership_table.php
Go to the documentation of this file.
1 <?php
2 
5 
6 class CreateAccessCollectionMembershipTable extends AbstractMigration {
14  public function change() {
15 
16  if ($this->hasTable("access_collection_membership")) {
17  return;
18  }
19 
20  $table = $this->table("access_collection_membership", [
21  'id' => false,
22  'primary_key' => [
23  "user_guid",
24  "access_collection_id"
25  ],
26  'engine' => "InnoDB",
27  'encoding' => "utf8mb4",
28  'collation' => "utf8mb4_general_ci",
29  ]);
30 
31  $table->addColumn('user_guid', 'integer', [
32  'null' => false,
33  'limit' => MysqlAdapter::INT_BIG,
34  'precision' => 20,
35  'signed' => false,
36  ]);
37 
38  $table->addColumn('access_collection_id', 'integer', [
39  'null' => false,
40  'limit' => MysqlAdapter::INT_REGULAR,
41  'precision' => 11,
42  ]);
43 
44  $table->save();
45 
46  }
47 }
change()
CREATE TABLE prefix_access_collection_membership ( user_guid bigint(20) unsigned NOT NULL...
$table
Definition: cron.php:57