Blame view

backend/components/noam148/imagemanager/migrations/m160622_085710_create_ImageManager_table.php 712 Bytes
a8aa0f7d   alex   Add new noam148 m...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
  <?php
  
  use yii\db\Migration;
  
  /**
   * Handles the creation for table `ImageManager`.
   */
  class m160622_085710_create_ImageManager_table extends Migration
  {
  	/**
  	 * @inheritdoc
  	 */
  	public function up()
  	{
  		//ImageManager: create table
  		$this->createTable('ImageManager', [
  			'id' => $this->primaryKey(),
  			'fileName' => $this->string(128)->notNull(),
  			'fileHash' => $this->string(32)->notNull(),
  			'created' => $this->datetime()->notNull(),
  			'modified' => $this->datetime(),
  		]);
  
  		//ImageManager: alter id column
  		$this->alterColumn('ImageManager', 'id', 'INT(10) UNSIGNED NOT NULL AUTO_INCREMENT');
  
  	}
  
  	/**
  	 * @inheritdoc
  	 */
  	public function down()
  	{
  		$this->dropTable('ImageManager');
  	}
  }