Home  >  Article  >  Backend Development  >  laravel(二)migration leverage ratio gearing ratio pe rati

laravel(二)migration leverage ratio gearing ratio pe rati

WBOY
WBOYOriginal
2016-07-29 08:50:461265browse

Migation in laravel is similar to a kind of data version control.
1. Create database
(1) Create a database based on the database php file

php artisan migrate

(2) If you find a creation error, you can undo

php artisan migrate:rollback

(3) Create in lar A php file used to create a database

php artisan make:migration create_articles_table --create=articles //where articles specifies the table name

(4) Add fields

php artisan make:migration add_intro_column_to_articles - -table=articles
//Need to write in the newly created php file,
In the up() function:
$table->string('xxx');
In the down() function:
$table->dropColumn('xxx')
Note: dropColumn requires import package: doctrine/dbal

2.Update after database change

php artisan migrate:refresh

3.apache2 startup

sudo /etc/init.d/apache2 restart

').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });

The above introduces laravel (2) migration, including laravel and ratio content. I hope it will be helpful to friends who are interested in PHP tutorials.

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