所以,我創建了在vendor/vendorname/package
包遷移(沒有錯誤)
網站我已經添加了新的軟件包我app/config/app.php
文件的供應商陣列一個新的包:
'Seriousjelly\Portfolio\PortfolioServiceProvider'
我的包作曲家以.json文件似乎是合法的:
"autoload": {
"classmap": [
"src/migrations",
"src/controllers",
"src/models",
"src/repositories"
],
"psr-0": {
"Seriousjelly\\Portfolio\\": "src/"
}
而在seriousjelly/porfolio/src/migrations
我有2個遷移:
2014_06_25_060429_create_portfolio_categories_table.php:
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreatePortfolioCategoriesTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('portfolio_categories', function(Blueprint $table){
$table->increments('id');
$table->string('title', 255);
$table->string('subtitle', 255);
$table->string('short_description', 500);
$table->string('description');
$table->string('slug', 60);
$table->timestamp();
});
Schema::create('portfolio_item_categories', function(Blueprint $table) {
$table->integer('category_id')->unsigned();
$table->foreign('category_id')->references('id')->on('portfolio_categories');
$table->integer('item_id')->unsigned();
$table->foreign('item_id')->references('id')->on('portfolio_items');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('portfolio_categories');
Schema::drop('portfolio_item_categories');
}
}
和2014_06_25_060414_create_portfolio_items_table.php:
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreatePortfolioItemsTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('portfolio_items', function(Blueprint $table) {
$table->increments('id');
$table->string('title', 255);
$table->string('subtitle', 255)->nullable;
$table->string('short_description', 500)->nullable;
$table->string('description', 500);
$table->string('slug', 60);
$table->timestamp();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('portfolio_items');
}
}
現在,當我運行php artisan migrate --package=seriousjelly/portfolio
它配備了說,移民成功運行,但是,如果我只檢查數據庫的遷移表已填充。
如果我再次運行該命令,沒有任何反應,沒有錯誤,沒有消息,什麼都沒有。
任何想法?
p.s其他軟件包遷移是相同的,似乎運行良好,我試圖作曲家更新和作曲家轉儲自動加載,但這不起作用。