mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 20:26:23 +00:00
import simplify/fix
This commit is contained in:
parent
51bd5c228b
commit
9e25a45090
@ -123,6 +123,11 @@ function getFlagsFroAction(action) {
|
||||
createIfNotExists: true,
|
||||
truncate: true,
|
||||
};
|
||||
case 'appendData':
|
||||
return {
|
||||
createIfNotExists: false,
|
||||
truncate: false,
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
@ -237,32 +242,23 @@ export default async function createImpExpScript(extensions, values, addEditorIn
|
||||
|
||||
export function getActionOptions(extensions, source, values, targetDbinfo) {
|
||||
const res = [];
|
||||
const targetName = getTargetName(extensions, source, values);
|
||||
if (values.targetStorageType == 'database') {
|
||||
let existing = findObjectLike(
|
||||
{ schemaName: values.targetSchemaName, pureName: targetName },
|
||||
targetDbinfo,
|
||||
'tables'
|
||||
);
|
||||
if (existing) {
|
||||
res.push({
|
||||
label: 'Append data',
|
||||
value: 'appendData',
|
||||
});
|
||||
res.push({
|
||||
label: 'Truncate and import',
|
||||
value: 'truncate',
|
||||
});
|
||||
res.push({
|
||||
label: 'Drop and create table',
|
||||
value: 'dropCreateTable',
|
||||
});
|
||||
} else {
|
||||
res.push({
|
||||
label: 'Create table',
|
||||
value: 'createTable',
|
||||
});
|
||||
}
|
||||
res.push({
|
||||
label: 'Create table/append',
|
||||
value: 'createTable',
|
||||
});
|
||||
res.push({
|
||||
label: 'Append data',
|
||||
value: 'appendData',
|
||||
});
|
||||
res.push({
|
||||
label: 'Truncate and import',
|
||||
value: 'truncate',
|
||||
});
|
||||
res.push({
|
||||
label: 'Drop and create table',
|
||||
value: 'dropCreateTable',
|
||||
});
|
||||
} else {
|
||||
res.push({
|
||||
label: 'Create file',
|
||||
|
Loading…
Reference in New Issue
Block a user