【发布时间】:2021-09-20 09:12:25
【问题描述】:
SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near "AUTO_INCREMENT" LINE 1: ALTER TABLE orders AUTO_INCREMENT = 1000; ^ (SQL: ALTER TABLE orders AUTO_INCREMENT = 1000
我希望我的 id 专栏从 1000 和 AUTO INCREMENT 开始。下面给出了迁移页面。迁移时出现上述错误。我正在使用 Laravel-8 和 Pgsql-13 。非常感谢任何解决此问题的帮助。
Schema::create('orders', function (Blueprint $table) {
$table->increments('id');
$table->integer('order_userId')->unsigned();
$table->foreign('order_userId')->references('id')->on('users');
$table->float('orderTotal');
$table->integer('createdBy')->unsigned();
$table->timestamps();
});
DB::update("ALTER TABLE orders AUTO_INCREMENT = 1000;");
【问题讨论】:
标签: laravel postgresql laravel-8 auto-increment