2

我正在按照本教程创建一个简单的 OctoberCMS 插件。所以我按顺序执行以下命令:

php artisan create:plugin Acme.Demo  
php artisan create:model Acme.Demo Task  
php artisan plugin:refresh Acme.Demo  

输出:

Rolled back: Acme.Demo  
Reinstalling plugin...  
Acme.Demo  
 - v1.0.1:  First version of Demo  
 - v1.0.2:  Create the TODO Tasks table  

以下是create_task_table.php更新文件夹中的内容:

<?php namespace Acme\Demo\Updates;

use Schema;
use October\Rain\Database\Updates\Migration;

class CreateTasksTable extends Migration
{

    public function up()
    {
        Schema::create('acme_demo_tasks', function($table)
        {
            $table->engine = 'InnoDB';
            $table->increments('id');
            $table->string('title')->nullable();
            $table->timestamps();
        });
    }

    public function down()
    {
        Schema::dropIfExists('acme_demo_tasks');
    }

}

根据教程,在这一步之后我应该可以看到acme_demo_tasks数据库中的表,但是我看不到它,而且似乎还没有创建表。有什么我做错了吗?

4

1 回答 1

2

检查你的数据库迁移文件的名称version.yaml,它应该是create_tasks_table.php.

于 2015-11-24T20:52:51.027 回答