@@ 8-31 (lines=24) @@ | ||
5 | /** |
|
6 | * Handles the creation of table `owners_mediafiles`. |
|
7 | */ |
|
8 | class m180220_082806_create_owners_mediafiles_table extends Migration |
|
9 | { |
|
10 | /** |
|
11 | * {@inheritdoc} |
|
12 | */ |
|
13 | public function safeUp() |
|
14 | { |
|
15 | $this->createTable('owners_mediafiles', [ |
|
16 | 'mediafileId' => $this->integer()->notNull(), |
|
17 | 'ownerId' => $this->integer()->notNull(), |
|
18 | 'owner' => $this->string(64)->notNull(), |
|
19 | 'ownerAttribute' => $this->string(64)->notNull(), |
|
20 | 'PRIMARY KEY (`mediafileId`, `ownerId`, `owner`, `ownerAttribute`)', |
|
21 | ]); |
|
22 | } |
|
23 | ||
24 | /** |
|
25 | * {@inheritdoc} |
|
26 | */ |
|
27 | public function safeDown() |
|
28 | { |
|
29 | $this->dropTable('owners_mediafiles'); |
|
30 | } |
|
31 | } |
|
32 |
@@ 8-31 (lines=24) @@ | ||
5 | /** |
|
6 | * Handles the creation of table `owners_albums`. |
|
7 | */ |
|
8 | class m180220_082911_create_owners_albums_table extends Migration |
|
9 | { |
|
10 | /** |
|
11 | * {@inheritdoc} |
|
12 | */ |
|
13 | public function safeUp() |
|
14 | { |
|
15 | $this->createTable('owners_albums', [ |
|
16 | 'albumId' => $this->integer()->notNull(), |
|
17 | 'ownerId' => $this->integer()->notNull(), |
|
18 | 'owner' => $this->string(64)->notNull(), |
|
19 | 'ownerAttribute' => $this->string(64)->notNull(), |
|
20 | 'PRIMARY KEY (`albumId`, `ownerId`, `owner`, `ownerAttribute`)', |
|
21 | ]); |
|
22 | } |
|
23 | ||
24 | /** |
|
25 | * {@inheritdoc} |
|
26 | */ |
|
27 | public function safeDown() |
|
28 | { |
|
29 | $this->dropTable('owners_albums'); |
|
30 | } |
|
31 | } |
|
32 |
@@ 8-32 (lines=25) @@ | ||
5 | /** |
|
6 | * Handles the creation of table `albums`. |
|
7 | */ |
|
8 | class m180220_083639_create_albums_table extends Migration |
|
9 | { |
|
10 | /** |
|
11 | * {@inheritdoc} |
|
12 | */ |
|
13 | public function safeUp() |
|
14 | { |
|
15 | $this->createTable('albums', [ |
|
16 | 'id' => $this->primaryKey(), |
|
17 | 'title' => $this->string(64)->notNull(), |
|
18 | 'description' => $this->text(), |
|
19 | 'type' => $this->string(64)->notNull(), |
|
20 | 'created_at' => $this->integer()->notNull(), |
|
21 | 'updated_at' => $this->integer(), |
|
22 | ]); |
|
23 | } |
|
24 | ||
25 | /** |
|
26 | * {@inheritdoc} |
|
27 | */ |
|
28 | public function safeDown() |
|
29 | { |
|
30 | $this->dropTable('albums'); |
|
31 | } |
|
32 | } |
|
33 |