2017-09-13 35 views
2

我为我的项目使用PostgreSQL,但是当我迁移过程时出现此错误。列“migrations.id”具有不受支持的类型“串行”

[email protected]:/var/www/html/CRMPixel$ php artisan migrate 

[Illuminate\Database\QueryException] 
SQLSTATE[0A000]: Feature not supported: 7 ERROR: Column "migrations.id" has unsupported type "serial". (SQL: create table "migrations" ("id" serial primary key not null, "migration" varchar(191) not null, "batch" integer not null)) 

[PDOException] 
SQLSTATE[0A000]: Feature not supported: 7 ERROR: Column "migrations.id" has unsupported type "serial". 
+0

您使用的是哪个版本的PostgreSQL? – user3158900

+0

向我们展示迁移。 –

+0

@ user3158900版本:i686-pc-linux-gnu上的PostgreSQL 8.0.2,由GCC gcc编译(GCC)3.4.2 20041017(Red Hat 3.4.2-6.fc3),Redshift 1.0.1430 – Frollo

回答

1

亚马逊红移PostgreSQL不支持serial类型:link

这些PostgreSQL的数据类型没有在亚马逊红移支持。

  • 阵列

  • BIT,BIT VARYING

  • BYTEA

  • 复合类型

  • 日期/时间类型

    • 间隔

    • TIME

  • 枚举类型

  • 几何类型

  • JSON

  • 网络地址类型

  • 数值类型

    • SERIAL,BIGSERIAL,SMALLSERIAL

    • MONEY

  • 对象标识符类型

  • 伪类型

  • 范围类型

  • 文本搜索类型

  • TXID_SNAPSHOT

  • UUID

  • XML

$table->increments('id')产生serial场。

代替这种使用即laravel-sequence

$table->unsignedInteger('id')->primary() 
+0

嗯,我不知道我不知道我在哪里使用串口,​​laravel中的串口是什么?我怎么解决这个问题 ? – Frollo

+0

@Frollo看到我的编辑。 –

+0

我很抱歉,但我仍然收到同样的错误。迁移屏幕快照:https://ibb.co/i4V8UQ – Frollo

相关问题