मैं अपने उपयोगकर्ताओं तालिका के लिए एक नया माइग्रेशन बनाने के लिए कोशिश कर रहा हूँ, मैं निम्न स्कीमा है:Laravel 4 - कारीगर त्रुटि SQLSTATE [42000]
Schema::create('users', function($t) {
$t->increments('id');
$t->string('username', 16);
$t->string('password', 64);
$t->integer('role', 64);
$t->timestamps();
});
जब मैं php कारीगर टर्मिनल से विस्थापित चलाने का प्रयास, मैं निम्नलिखित त्रुटि मिलती है:
[Exception]
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 tableusers
(id
int unsigne d not null auto_increment primary key,username
varchar(16) not null,password
varchar(64) no t null,role
int not null auto_increment primary key,created_at
timestamp default 0 not null ,updated_at
timestamp default 0 not null)) (Bindings: array (
))
त्रुटि के रूप में जब इस निकाल दिया जाता है यह ठीक से चलाने के लिए लगता है, 'भूमिका' फ़ील्ड के साथ क्या करने के लिए कुछ नहीं है।
कोई मदद या जानकारी के लिए अग्रिम धन्यवाद।
क्यों उत्पन्न एसक्यूएल सेट '' auto_increment प्राथमिक key' को role' करता है? 'Id' केवल 'auto_increment प्राथमिक कुंजी' कॉलम होने के साथ क्या गलत है? –