AmmarCodes / Laravel-Countries-Cities

[NOT READY] A Laravel package for using world's popular countries and cities.
10 stars 24 forks source link

Migrate error #4

Closed dikutandi closed 7 years ago

dikutandi commented 8 years ago

i try to migrating city and country, but i got this error

[Illuminate\Database\QueryException] SQLSTATE[42000]: Syntax error or access violation: 1075 Incorrect table definition; there can be only one auto column and it must be defined as a key (SQL: create table cities (id int unsigned not null auto_increment primary key, name varchar(35) not null, country_code varchar(3) not null, district varchar(20) not null, population int unsigned not null auto_increment primary key) default character set utf8 collate utf8_unicode_ci engine = InnoDB)

can you help me how to fix it?

durimrexhaj commented 8 years ago

use this line:

$table->integer('capital')->length(11)->unsigned();