Home >Backend Development >PHP Tutorial >How to use the migrate command to execute sql statements in Yii, yiimigrate_PHP tutorial

How to use the migrate command to execute sql statements in Yii, yiimigrate_PHP tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-07-12 08:57:131242browse

Yii uses the migrate command to execute sql statements, yiimigrate

This article describes the example of Yii using the migrate command to execute sql statements. Share it with everyone for your reference, the details are as follows:

Yii2 comes with a powerful command line management tool. Open the cmd command window under Windows, switch to the directory where the Yii project is located (including Yii.bat), and you can run the Yii command in cmd.

Use Yii migrate command to execute sql statement:

For example, the file with the path /console/migrations/m130524_201442_init.php defines the SQL of a User table. If we want to execute this SQL to generate a data table, run:

yii migrate console/migrations/m130524_201442_init.php

migrate is Yii’s command for data migration, and this is just one of its uses.

Reprinted from: Xiaotan Blog http://www.tantengvip.com/2015/05/yii-migrate-sql/

Readers who are interested in more Yii-related content can check out the special topics on this site: "Introduction to Yii Framework and Summary of Common Techniques", "Summary of Excellent PHP Development Framework", "Basic Tutorial for Getting Started with Smarty Templates", "php Date and Time" Usage Summary", "php object-oriented programming introductory tutorial", "php string (string) usage summary", "php mysql database operation introductory tutorial" and "php common database operation skills summary"

I hope this article will be helpful to everyone’s PHP program design based on the Yii framework.

Articles you may be interested in:

  • Detailed explanation of usage examples of Trait in Laravel
  • Detailed explanation of the steps to register Facades in Laravel
  • Laravel implements automatic constructor Method of Dependency Injection
  • How Laravel uses Caching to cache data to reduce database query pressure
  • Making APP interface (API) based on laravel
  • Experience of learning PHP framework Laravel
  • Get the previous and next data in Laravel
  • Share the configuration file of running PHP framework Laravel in Nginx
  • YII Framework framework uses YIIC to quickly create YII applications. Detailed explanation of migrate usage examples
  • Laravel executes the migrate command prompt: No such file or directory solution

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1110076.htmlTechArticleYii uses the migrate command to execute sql statements, yiimigrate This article describes the example of Yii using the migrate command to execute sql statements . Share it with everyone for your reference, the details are as follows: Y...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn