1 | <?php |
||
6 | class Category extends AbstractMigration |
||
7 | { |
||
8 | public function up() |
||
9 | { |
||
10 | $this->table('category', ['id' => false, 'primary_key' => 'category_uuid']) |
||
11 | ->addColumn('category_uuid', 'binary', ['limit' => 16]) |
||
12 | ->addColumn('category_id', 'text') |
||
13 | ->addColumn('name', 'text') |
||
14 | ->addColumn('slug', 'text') |
||
15 | ->addColumn('type', 'integer') // see Article\Entity\ArticleType |
||
16 | ->addColumn('title', 'text', ['null' => true]) |
||
17 | ->addColumn('description', 'text', ['null' => true]) |
||
18 | ->addColumn('main_img', 'text', ['null' => true]) |
||
19 | ->addColumn('is_in_homepage', 'boolean', ['default' => false]) |
||
20 | ->addColumn('is_in_category_list', 'boolean', ['default' => true]) |
||
21 | ->create(); |
||
22 | } |
||
23 | |||
24 | public function down() |
||
25 | { |
||
26 | $this->dropTable('category'); |
||
27 | } |
||
28 | } |
||
29 |