Conditions | 2 |
Paths | 2 |
Total Lines | 34 |
Code Lines | 21 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
28 | public function change() { |
||
29 | |||
30 | if ($this->hasTable("access_collections")) { |
||
31 | return; |
||
32 | } |
||
33 | |||
34 | $table = $this->table("access_collections", [ |
||
35 | 'engine' => "InnoDB", |
||
36 | 'encoding' => "utf8mb4", |
||
37 | 'collation' => "utf8mb4_general_ci", |
||
38 | ]); |
||
39 | |||
40 | $table->addColumn('name', 'text', [ |
||
41 | 'null' => false, |
||
42 | 'limit' => 65535, |
||
43 | ]); |
||
44 | |||
45 | $table->addColumn('owner_guid', 'integer', [ |
||
46 | 'null' => false, |
||
47 | 'limit' => MysqlAdapter::INT_BIG, |
||
48 | 'precision' => 20, |
||
49 | 'signed' => false, |
||
50 | ]); |
||
51 | |||
52 | $table->addIndex(['owner_guid'], [ |
||
53 | 'name' => "owner_guid", |
||
54 | 'unique' => false |
||
55 | ]); |
||
56 | |||
57 | $table->save(); |
||
58 | |||
59 | $prefix = $this->getAdapter()->getOption('table_prefix'); |
||
60 | $this->query("ALTER TABLE {$prefix}access_collections AUTO_INCREMENT=3"); |
||
61 | } |
||
62 | } |
||
63 |