laravel(二)migration leverage ratio gearing ratio pe rati

WBOY
Release: 2016-07-29 08:50:46
Original
1208 people have browsed it

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.

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!