We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 783e2dd commit b5ceb58Copy full SHA for b5ceb58
migrations/m160406_120743_onmotion_yii2_gallery.php
@@ -0,0 +1,29 @@
1
+<?php
2
+
3
+use yii\db\Migration;
4
+use yii\db\Schema;
5
6
+class m160406_120743_onmotion_yii2_gallery extends Migration
7
+{
8
+ public function up()
9
+ {
10
+ $this->createTable('g_gallery', [
11
+ 'gallery_id' => Schema::TYPE_PK,
12
+ 'name' => Schema::TYPE_STRING . '(50) NOT NULL',
13
+ 'descr' => Schema::TYPE_TEXT,
14
+ 'date' => Schema::TYPE_DATETIME,
15
+ ]);
16
+ $this->createTable('g_photo', [
17
+ 'photo_id' => Schema::TYPE_PK,
18
+ 'gallery_id' => Schema::TYPE_INTEGER . ' NOT NULL',
19
+ 'name' => Schema::TYPE_STRING . '(255) NOT NULL',
20
21
+ }
22
23
+ public function down()
24
25
+ $this->dropTable('g_gallery');
26
+ $this->dropTable('g_photo');
27
28
29
+}
0 commit comments