DROP FOREIGN KEY

时间:2017-02-09 17:51:15

标签: mysql

我没有在MYSQL中为我的外键提供任何名称。但现在我需要放弃它。任何人都可以帮助我吗?

2 个答案:

答案 0 :(得分:0)

使用以下内容查找约束名称:

select 
    table_name,
    column_name,
    constraint_name,
    referenced_table_name,
    referenced_column_name
from information_schema.key_column_usage
where table_name = 'Your_table';

然后使用下面的语句删除它:

alter table your_table drop foreign key <foreign_key_constraint_name>;

答案 1 :(得分:0)

import React from 'react';
import { Router } from 'react-router';
import { Provider, connect } from 'react-redux';
import en_US from 'antd/lib/locale-provider/en_US';
import sv_SE from 'antd/lib/locale-provider/sv_SE';
import { LocaleProvidern } from 'antd';

class AntDesignPlusRouter extends React.Component {
    state = {
        antd_locale: en_US
    }

    componentWillUpdate( next ) {
        let { locale } = next
        if( !locale || locale === this.props.locale ) return;

        switch( locale ) {
            case 'sv':
                this.setState( { antd_locale: sv_SE } );
                break;
            default:
            case 'en':
                this.setState( { antd_locale: en_US } );
                break;
        }
    }

    render() {
        return (
            <LocaleProvider locale={this.state.antd_locale}>
                <Router {...this.props} />
            </LocaleProvider>
        )
    }
}

const WrappedAntDesignPlusRouter = connect(
        function mapStateToProps( state ) {
            return {
                locale: state.locale
            }
        },
        function mapDispatchToProps( dispatch ) {
            return {}
        }
)( AntDesignPlusRouter );



class App extends React.Component {
    render() {
        return (
                <Provider ...>
                    <LanguageProvider ...>
                        <WrappedAntDesignPlusRouter/>
                    </LanguageProvider >
                </Provider>
        );
    }
}