2017-09-13 33 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

相關問題