You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
			
				
					34 lines
				
				661 B
			
		
		
			
		
	
	
					34 lines
				
				661 B
			| 
											7 years ago
										 | <?php
 | ||
|  | 
 | ||
|  | use yii\db\Migration;
 | ||
|  | 
 | ||
|  | /**
 | ||
|  |  * Handles the creation of table `menu`.
 | ||
|  |  */
 | ||
|  | class m180709_202649_create_menu_table extends Migration
 | ||
|  | {
 | ||
|  |     /**
 | ||
|  |      * {@inheritdoc}
 | ||
|  |      */
 | ||
|  |     public function safeUp()
 | ||
|  |     {
 | ||
|  | 	    $tableOptions = null;
 | ||
|  | 	    if ($this->db->driverName === 'mysql') {
 | ||
|  | 		    $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB';
 | ||
|  | 	    }
 | ||
|  | 
 | ||
|  |         $this->createTable('{{%menu}}', [
 | ||
|  |             'id' => $this->primaryKey(),
 | ||
|  | 	        'name' => $this->string(255)->notNull(),
 | ||
|  |         ], $tableOptions);
 | ||
|  |     }
 | ||
|  | 
 | ||
|  |     /**
 | ||
|  |      * {@inheritdoc}
 | ||
|  |      */
 | ||
|  |     public function safeDown()
 | ||
|  |     {
 | ||
|  |         $this->dropTable('{{%menu}}');
 | ||
|  |     }
 | ||
|  | }
 |