小编Jon*_* xx的帖子

Laravel放弃了外国移民的关键

我想创建一个将删除表的迁移.我创建了这样的迁移:

Schema::table('devices', function (Blueprint $table) {
    $table->increments('id');
    $table->unsignedInteger('client_id')->nullable();
    $table->foreign('client_id')->references('id')->on('clients')->onDelete('cascade');
});
Run Code Online (Sandbox Code Playgroud)

现在我试着像这样放弃它:

    Schema::table('devices', function (Blueprint $table) {
        $table->dropForeign('devices_client_id_foreign');
        $table->drop('devices');
    });
Run Code Online (Sandbox Code Playgroud)

但我得到以下错误:

In Connection.php line 664:

  SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP 'devices_client_id_foreign'; check that column/key exists (SQL:
Run Code Online (Sandbox Code Playgroud)

alter table devicesdrop foreign key devices_client_id_foreign)

In PDOStatement.php line 144:

  SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP 'devices_client_id_foreign'; check that column/key exists


In PDOStatement.php line 142:

  SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP 'devices_client_id_foreign'; check …
Run Code Online (Sandbox Code Playgroud)

php mysql laravel laravel-5.6

6
推荐指数
3
解决办法
3715
查看次数

另一个组件的Vue调用方法

我有两个组件,一个卡片组件和一个模态组件,模态组件包含模态元素,在我的卡片组件中,我想要一个按钮来打开我的模态组件的模态窗口。我该如何管理,到目前为止我已经做到了:

我的卡片组件:

<template>
    <v-layout v-if="visible">
        <v-flex xs12 sm6 offset-sm3>
            <v-card>
                <v-card-title primary-title>
                    <div>
                        <h3 class="headline mb-0">test</h3>
                        <div>test</div>
                    </div>
                </v-card-title>

                <v-divider light></v-divider>

                <v-card-actions>
                <v-btn
                    color="primary"
                    dark
                    @click="dialog = true"
                >
                Open Dialog
                </v-btn> <!-- open modal dialog of modal component? -->

                    <tenant-number-modal></tenant-number-modal>
                </v-card-actions>

                <input type="hidden" id="tenant-id" :value=tenantId>
            </v-card>
        </v-flex>
    </v-layout>
</template>

<script>
    export default {
        data () {
            return {
                visible: true,
                dialog: false,
                uniqueTenantNumber: ''
            }
        },
    }
</script>
Run Code Online (Sandbox Code Playgroud)

我的模态组件:

<template>
    <v-layout row justify-center>
        <v-btn
            color="primary"
            dark
            @click="dialog = true" …
Run Code Online (Sandbox Code Playgroud)

javascript vue.js vuejs2

6
推荐指数
2
解决办法
2万
查看次数

带有登录凭据的 Bitbucket repo 克隆

我有一个到 bitbucket 的基本 git clone 命令,我必须在其中添加登录凭据,是否可以将登录凭据添加到 bitbucket git clone 命令?

https://myacc@bitbucket.org/myacc/app.git
Run Code Online (Sandbox Code Playgroud)

像这样的东西?

https://myacc@bitbucket.org/myacc/app.git -Password "123"
Run Code Online (Sandbox Code Playgroud)

git bitbucket git-clone

5
推荐指数
1
解决办法
2万
查看次数

标签 统计

bitbucket ×1

git ×1

git-clone ×1

javascript ×1

laravel ×1

laravel-5.6 ×1

mysql ×1

php ×1

vue.js ×1

vuejs2 ×1