You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to add a column to a table, but it seems to want to make the column a primary key which is why it fails. The commands I ran are:
php artisan generate:migration add_account_id_to_transactions_table --fields="account_id:integer(11)"
php artisan migrate
The errors displayed are the following
[Illuminate\Database\QueryException]
SQLSTATE[42000]: Syntax error or access violation: 1075 Incorrect table def
inition; there can be only one auto column and it must be defined as a key
(SQL: alter table transactions add account_id int not null auto_increme
nt primary key)
[PDOException]
SQLSTATE[42000]: Syntax error or access violation: 1075 Incorrect table def
inition; there can be only one auto column and it must be defined as a key
The text was updated successfully, but these errors were encountered:
I tried to add a column to a table, but it seems to want to make the column a primary key which is why it fails. The commands I ran are:
php artisan generate:migration add_account_id_to_transactions_table --fields="account_id:integer(11)"
php artisan migrate
The errors displayed are the following
[Illuminate\Database\QueryException]
SQLSTATE[42000]: Syntax error or access violation: 1075 Incorrect table def
inition; there can be only one auto column and it must be defined as a key
(SQL: alter table
transactions
addaccount_id
int not null auto_increment primary key)
[PDOException]
SQLSTATE[42000]: Syntax error or access violation: 1075 Incorrect table def
inition; there can be only one auto column and it must be defined as a key
The text was updated successfully, but these errors were encountered: