Elgg  Version master
20170728074959_create_objects_entity_table.php
Go to the documentation of this file.
1 <?php
2 
5 
6 class CreateObjectsEntityTable extends AbstractMigration {
15  public function change() {
16 
17  if ($this->hasTable("objects_entity")) {
18  return;
19  }
20 
21  $table = $this->table("objects_entity", [
22  'id' => false,
23  'primary_key' => ["guid"],
24  'engine' => "InnoDB",
25  'encoding' => "utf8mb4",
26  'collation' => "utf8mb4_general_ci",
27  ]);
28 
29  $table->addColumn('guid', 'integer', [
30  'null' => false,
31  'limit' => MysqlAdapter::INT_BIG,
32  'precision' => 20,
33  ]);
34 
35  $table->addColumn('title', 'text', [
36  'null' => false,
37  ]);
38 
39  $table->addColumn('description', 'text', [
40  'null' => false,
41  'limit' => MysqlAdapter::TEXT_LONG,
42  ]);
43 
44  $table->save();
45 
46  }
47 }
$table
Definition: user.php:37
change()
CREATE TABLE prefix_objects_entity ( guid bigint(20) unsigned NOT NULL, title text NOT NULL...