首頁  >  文章  >  後端開發  >  laravel(二)遷移槓桿率 gearingratio per rati

laravel(二)遷移槓桿率 gearingratio per rati

WBOY
WBOY原創
2016-07-29 08:50:461211瀏覽

laravel中的migation類似一種資料可的版本控制.
1. 建立資料庫
(1)根據資料庫php檔案建立資料庫

php artisan migratephp artisan migrate

(2)如果发现创建错误,可以撤销

php artisan migrate:rollback

(3)在lar中创建一个用于创建数据库的php文件

php artisan make:migration create_articles_table --create=articles //其中articles指明表名

(4)添加字段

php artisan make:migration add_intro_column_to_articles --table=articles

(2)如果發現建立錯誤,可以撤銷
$table->string('xxx');
php artisan migrate:rollback
$table->dropColumn('xxx')
(3)在lar中建立一個用於建立資料庫的php檔案

php artisan make:migration create_articles_table --create=articles //其中articles指示表名

php artisan migrate:refresh 4)新增欄位

php artisan make:migration add_intro_column_to_articles --table=articles

//需要寫入新建成的php檔案,
up()函數中:

down()函數中: 注意:dropColumn需要導入套件:doctrine/dbal

2.資料庫變更後的更新

🎜🎜🎜🎜🎜🎜3.apache2的啟動🎜🎜 .addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i 🎜').text(i)); }; $numbering.fadeIn(1700); }); }); 🎜 🎜 以上就介紹了laravel(二)migration,包括了laravel,ratio方面的內容,希望對PHP教程有興趣的朋友有所幫助。 🎜 🎜 🎜
陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn