Elgg  Version 6.1
20170728075716_create_config_table.php
Go to the documentation of this file.
1 <?php
2 
5 
6 class CreateConfigTable extends AbstractMigration {
14  public function change() {
15 
16  if ($this->hasTable("config")) {
17  return;
18  }
19 
20  $table = $this->table("config", [
21  'id' => false,
22  'primary_key' => ["name"],
23  'engine' => "InnoDB",
24  'encoding' => "utf8mb4",
25  'collation' => "utf8mb4_general_ci",
26  ]);
27 
28  $table->addColumn('name', 'string', [
29  'null' => false,
30  'limit' => MysqlAdapter::TEXT_SMALL,
31  'encoding' => "utf8",
32  'collation' => "utf8_general_ci",
33  ]);
34 
35  $table->addColumn('value', 'text', [
36  'null' => false,
37  'limit' => MysqlAdapter::TEXT_LONG,
38  ]);
39 
40  $table->save();
41  }
42 }
change()
CREATE TABLE prefix_config ( name varchar(255) CHARACTER SET utf8 NOT NULL, value LONGTEXT NOT NULL...
$table
Definition: user.php:37