Laravel Migrate修改表和创建表

php artisan make:migration create_table_test –table=test_a 修改表

Schema::table(‘test’, function (Blueprint $table) {
$table->dropColumn([‘data’]);
$table->renameColumn(‘tttt’,’test’);
$table->addColumn(‘string’,’t_id’, [‘length’ => 200]);
});

php artisan make:migration create_table_test –create=test_a 创建表
Schema::create(‘users’, function (Blueprint $table) {
$table->increments(‘id’);
$table->string(‘name’);
$table->string(’email’, 150)->unique();
$table->string(‘password’);
$table->rememberToken();
$table->timestamps();
});

 

需要添加:

{"require": {"doctrine/dbal": "v2.5.5"}}


Bookmark the permalink.

Comments are closed.