for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
use Ffcms\Core\Migrations\MigrationInterface;
use Ffcms\Core\Migrations\Migration;
/**
* Class install_commentpost_table.
*/
class install_commentpost_table extends Migration implements MigrationInterface
You can fix this by adding a namespace to your class:
namespace YourVendor; class YourClass { }
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.
{
* Execute actions when migration is up
* @return void
public function up()
$this->getSchema()->create('comment_posts', function($table) {
$table->increments('id');
$table->string('app_name');
$table->integer('app_relation_id')->unsigned();
$table->integer('user_id')->unsigned();
$table->string('guest_name', 100);
$table->text('message');
$table->string('lang', 32)->default('en');
$table->string('ip', 64)->default('127.0.0.1'); // ipv4 and ipv6 (32 chars + 7 digits is max)
$table->boolean('moderate')->default(false);
$table->timestamps();
});
parent::up();
}
* Seed created table via up() method with some data
public function seed() {}
* Execute actions when migration is down
public function down()
$this->getSchema()->dropIfExists('comment_posts');
parent::down();
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.