Prevent selection of Foreign Keys for collection sort (#11444)

This commit is contained in:
ian
2022-02-16 22:40:01 +08:00
committed by GitHub
parent 2652fe2fbf
commit 4fd26f2b60
2 changed files with 7 additions and 0 deletions

View File

@@ -56,6 +56,10 @@ export default defineComponent({
type: Boolean,
default: false,
},
allowForeignKeys: {
type: Boolean,
default: true,
},
},
emits: ['input'],
setup(props, { emit }) {
@@ -84,6 +88,7 @@ export default defineComponent({
let disabled = false;
if (props.allowPrimaryKey === false && field?.schema?.is_primary_key === true) disabled = true;
if (props.allowForeignKeys === false && field?.schema?.foreign_key_table) disabled = true;
if (props.typeAllowList.length > 0 && props.typeAllowList.includes(field.type) === false) disabled = true;
return {