Синтаксическая ошибка или нарушение доступа: 1075 Неверное определение таблицы;может быть только один автоматический столбец, и он должен быть определен как ключ - PullRequest
0 голосов
/ 22 февраля 2019

Я прочитал все связанные вопросы, но не смог найти причину, по которой мой файл миграции не работает.Возможно, кто-то более одаренный, чем я, сразу найдет причину:

    public function up()
{
    Schema::create('orders_detail', function (Blueprint $table) {
        $table->increments('id');
        $table->integer('orderID', 11)->nullable()->unsigned();
        $table->integer('userID', 11)->unsigned();
        $table->integer('roleID', 11)->unsigned();
        $table->integer('ownership', 11)->nullable()->unsigned();
        $table->integer('ownerID', 11)->nullable()->unsigned();
        $table->integer('ownerroleID', 11)->nullable()->unsigned();
        $table->integer('customerID', 11)->nullable()->unsigned();
        $table->integer('statusorderID', 11)->unsigned();
        $table->integer('statuslaboID', 11)->unsigned();
        $table->date('delivery_date');
        $table->integer('producttypeID', 11)->unsigned();
        $table->integer('productname', 11);
        $table->string('laboratory', 100);
        $table->integer('dessertservingID', 11)->nullable()->unsigned();
        $table->integer('dessertsizeID', 11)->nullable()->unsigned();
        $table->string('desserttextmessage', 200)->nullable();
        $table->string('dessertdecorchocolateID', 200)->nullable();
        $table->string('dessertdecorflowerID', 200)->nullable();
        $table->integer('partyloaftypeID')->nullable()->unsigned();
        $table->integer('partyloafportionID', 11)->nullable()->unsigned();
        $table->integer('partyloafweightID', 11)->nullable()->unsigned();
        $table->integer('partyloafsandwich1ID', 11)->nullable()->unsigned();
        $table->integer('partyloafsandwich2ID', 11)->nullable()->unsigned();
        $table->integer('partyloafsandwich3ID', 11)->nullable()->unsigned();
        $table->integer('partyloafsandwich4ID', 11)->nullable()->unsigned();
        $table->integer('partyloafribbonID', 11)->nullable()->unsigned();
        $table->double('productprice', 10, 2)->default('0.00');
        $table->double('productaddfee', 10, 2)->default('0.00');
        $table->double('subtotal', 10, 2)->default('0.00');
        $table->double('total', 10, 2)->default('0.00');
        $table->timestamps();
        $table->SoftDeletes();
    });
}

Приветствия, Марк

1 Ответ

0 голосов
/ 23 февраля 2019

Могли это решить:

    public function up()
{
    Schema::create('orders_detail', function (Blueprint $table) {
        $table->increments('id');
        $table->integer('orderID')->unsigned()->nullable();
        $table->integer('userID')->unsigned();
        $table->integer('roleID')->unsigned();
        $table->integer('ownership')->unsigned()->nullable();
        $table->integer('ownerID')->unsigned()->nullable();
        $table->integer('ownerroleID')->unsigned()->nullable();
        $table->integer('customerID')->unsigned()->nullable();
        $table->integer('statusorderID')->unsigned();
        $table->integer('statuslaboID')->unsigned();
        $table->date('delivery_date');
        $table->integer('producttypeID')->unsigned();
        $table->integer('productname');
        $table->string('laboratory', 100);
        $table->integer('dessertservingID')->unsigned()->nullable();
        $table->integer('dessertsizeID')->unsigned()->nullable();
        $table->string('desserttextmessage', 200)->nullable();
        $table->string('dessertdecorchocolateID', 200)->nullable();
        $table->string('dessertdecorflowerID', 200)->nullable();
        $table->integer('partyloaftypeID')->unsigned()->nullable();
        $table->integer('partyloafportionID')->unsigned()->nullable();
        $table->integer('partyloafweightID')->unsigned()->nullable();
        $table->integer('partyloafsandwich1ID')->unsigned()->nullable();
        $table->integer('partyloafsandwich2ID')->unsigned()->nullable();
        $table->integer('partyloafsandwich3ID')->unsigned()->nullable();
        $table->integer('partyloafsandwich4ID')->unsigned()->nullable();
        $table->integer('partyloafribbonID')->unsigned()->nullable();
        $table->double('productprice', 10, 2)->default('0.00');
        $table->double('productaddfee', 10, 2)->default('0.00');
        $table->double('subtotal', 10, 2)->default('0.00');
        $table->double('total', 10, 2)->default('0.00');
        $table->timestamps();
        $table->SoftDeletes();
    });
}
...