feat: implementation diff processor
This commit is contained in:
parent
64df3d028c
commit
2fd588c7b8
|
@ -2,4 +2,6 @@ dependencies {
|
||||||
testImplementation 'mysql:mysql-connector-java:8.0.27'
|
testImplementation 'mysql:mysql-connector-java:8.0.27'
|
||||||
implementation 'org.commonmark:commonmark:0.18.1'
|
implementation 'org.commonmark:commonmark:0.18.1'
|
||||||
implementation 'org.freemarker:freemarker:2.3.31'
|
implementation 'org.freemarker:freemarker:2.3.31'
|
||||||
|
testImplementation "com.fasterxml.jackson.core:jackson-core:${jacksonVersion}"
|
||||||
|
testImplementation "com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}"
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
package com.databasir.core.diff;
|
||||||
|
|
||||||
|
import com.databasir.core.diff.data.RootDiff;
|
||||||
|
import com.databasir.core.diff.processor.DatabaseDiffProcessor;
|
||||||
|
import com.databasir.core.meta.data.DatabaseMeta;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
public class Diffs {
|
||||||
|
|
||||||
|
private static final DatabaseDiffProcessor databaseDiffProcessor = new DatabaseDiffProcessor();
|
||||||
|
|
||||||
|
public static RootDiff diff(DatabaseMeta original, DatabaseMeta current) {
|
||||||
|
return databaseDiffProcessor.process(original, current);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
package com.databasir.core.diff.data;
|
||||||
|
|
||||||
|
public interface Diff {
|
||||||
|
|
||||||
|
DiffType getDiffType();
|
||||||
|
|
||||||
|
Object getOriginal();
|
||||||
|
|
||||||
|
Object getCurrent();
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
package com.databasir.core.diff.data;
|
||||||
|
|
||||||
|
public enum DiffType {
|
||||||
|
NONE, ADDED, REMOVED, MODIFIED;
|
||||||
|
|
||||||
|
public static boolean isModified(DiffType type) {
|
||||||
|
return type != null && type != NONE;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.databasir.core.diff.data;
|
||||||
|
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
public class FieldDiff implements Diff {
|
||||||
|
|
||||||
|
private String fieldName;
|
||||||
|
|
||||||
|
private DiffType diffType;
|
||||||
|
|
||||||
|
private Object original;
|
||||||
|
|
||||||
|
private Object current;
|
||||||
|
|
||||||
|
@Builder.Default
|
||||||
|
private List<FieldDiff> fields = new ArrayList<>();
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
package com.databasir.core.diff.data;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class RootDiff {
|
||||||
|
|
||||||
|
private DiffType diffType;
|
||||||
|
|
||||||
|
private List<FieldDiff> fields = new ArrayList<>();
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,14 @@
|
||||||
|
package com.databasir.core.diff.processor;
|
||||||
|
|
||||||
|
import com.databasir.core.diff.data.FieldDiff;
|
||||||
|
import com.databasir.core.meta.data.ColumnMeta;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class ColumnDiffProcessor implements DiffProcessor<ColumnMeta> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FieldDiff process(String fieldName, List<ColumnMeta> original, List<ColumnMeta> current) {
|
||||||
|
return diffTableField(original, current, fieldName, ColumnMeta::getName);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,81 @@
|
||||||
|
package com.databasir.core.diff.processor;
|
||||||
|
|
||||||
|
import com.databasir.core.diff.data.DiffType;
|
||||||
|
import com.databasir.core.diff.data.FieldDiff;
|
||||||
|
import com.databasir.core.diff.data.RootDiff;
|
||||||
|
import com.databasir.core.meta.data.DatabaseMeta;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
public class DatabaseDiffProcessor {
|
||||||
|
|
||||||
|
private final TableDiffProcessor tableDiffProcessor = new TableDiffProcessor();
|
||||||
|
|
||||||
|
private static final DatabaseMeta EMPTY = DatabaseMeta.builder().build();
|
||||||
|
|
||||||
|
public RootDiff process(DatabaseMeta original, DatabaseMeta current) {
|
||||||
|
DiffType diffType = null;
|
||||||
|
if (original == null && current != null) {
|
||||||
|
diffType = DiffType.ADDED;
|
||||||
|
}
|
||||||
|
if (original != null && current == null) {
|
||||||
|
diffType = DiffType.REMOVED;
|
||||||
|
}
|
||||||
|
List<FieldDiff> fields = diffDatabaseFields(
|
||||||
|
Objects.requireNonNullElse(original, EMPTY),
|
||||||
|
Objects.requireNonNullElse(current, EMPTY)
|
||||||
|
);
|
||||||
|
boolean isModified = fields.stream().anyMatch(f -> DiffType.isModified(f.getDiffType()));
|
||||||
|
if (diffType == null) {
|
||||||
|
diffType = isModified ? DiffType.MODIFIED : DiffType.NONE;
|
||||||
|
}
|
||||||
|
RootDiff diff = new RootDiff();
|
||||||
|
diff.setFields(fields);
|
||||||
|
diff.setDiffType(diffType);
|
||||||
|
return diff;
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<FieldDiff> diffDatabaseFields(DatabaseMeta original, DatabaseMeta current) {
|
||||||
|
Class<DatabaseMeta> clazz = DatabaseMeta.class;
|
||||||
|
Field[] fields = clazz.getDeclaredFields();
|
||||||
|
List<FieldDiff> diffs = new ArrayList<>(32);
|
||||||
|
// ignore tables diff
|
||||||
|
Arrays.stream(fields)
|
||||||
|
.filter(field -> !Objects.equals(field.getName(), "tables"))
|
||||||
|
.forEach(field -> {
|
||||||
|
try {
|
||||||
|
field.setAccessible(true);
|
||||||
|
Object originalValue = original == null ? null : field.get(original);
|
||||||
|
Object currentValue = current == null ? null : field.get(current);
|
||||||
|
if (!Objects.equals(originalValue, currentValue)) {
|
||||||
|
DiffType diffType;
|
||||||
|
if (originalValue == null) {
|
||||||
|
diffType = DiffType.ADDED;
|
||||||
|
} else if (currentValue == null) {
|
||||||
|
diffType = DiffType.REMOVED;
|
||||||
|
} else {
|
||||||
|
diffType = DiffType.MODIFIED;
|
||||||
|
}
|
||||||
|
diffs.add(FieldDiff.builder()
|
||||||
|
.diffType(diffType)
|
||||||
|
.fieldName(field.getName())
|
||||||
|
.original(originalValue)
|
||||||
|
.current(currentValue)
|
||||||
|
.build());
|
||||||
|
}
|
||||||
|
} catch (IllegalAccessException e) {
|
||||||
|
log.error("diff field failed", e);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
FieldDiff tablesField = tableDiffProcessor.process("tables", original.getTables(), current.getTables());
|
||||||
|
diffs.add(tablesField);
|
||||||
|
return diffs;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,94 @@
|
||||||
|
package com.databasir.core.diff.processor;
|
||||||
|
|
||||||
|
import com.databasir.core.diff.data.DiffType;
|
||||||
|
import com.databasir.core.diff.data.FieldDiff;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
public interface DiffProcessor<T> {
|
||||||
|
|
||||||
|
FieldDiff process(String fieldName, List<T> original, List<T> current);
|
||||||
|
|
||||||
|
default FieldDiff diffTableField(List<T> original,
|
||||||
|
List<T> current,
|
||||||
|
String fieldName,
|
||||||
|
Function<T, String> identity) {
|
||||||
|
Map<String, T> originalMap = toMap(original, identity);
|
||||||
|
Map<String, T> currentMap = toMap(current, identity);
|
||||||
|
List<FieldDiff> columnFieldDiffs = new ArrayList<>(32);
|
||||||
|
// removed
|
||||||
|
List<FieldDiff> removedFields = originalRemovedField(originalMap, currentMap);
|
||||||
|
columnFieldDiffs.addAll(removedFields);
|
||||||
|
// added
|
||||||
|
List<FieldDiff> addedFields = currentAddedField(originalMap, currentMap);
|
||||||
|
columnFieldDiffs.addAll(addedFields);
|
||||||
|
// modified
|
||||||
|
List<FieldDiff> modifiedFields = modifiedField(originalMap, currentMap);
|
||||||
|
columnFieldDiffs.addAll(modifiedFields);
|
||||||
|
return FieldDiff.builder()
|
||||||
|
.fieldName(fieldName)
|
||||||
|
.diffType(columnFieldDiffs.isEmpty() ? DiffType.NONE : DiffType.MODIFIED)
|
||||||
|
.fields(columnFieldDiffs)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
default Map<String, T> toMap(List<T> content, Function<T, String> idMapping) {
|
||||||
|
return content
|
||||||
|
.stream()
|
||||||
|
.collect(Collectors.toMap(idMapping, Function.identity()));
|
||||||
|
}
|
||||||
|
|
||||||
|
default List<FieldDiff> originalRemovedField(Map<String, T> originalMapById,
|
||||||
|
Map<String, T> currentMapById) {
|
||||||
|
return originalMapById.entrySet()
|
||||||
|
.stream()
|
||||||
|
.filter(entry -> !currentMapById.containsKey(entry.getKey()))
|
||||||
|
.map(entry -> FieldDiff.builder()
|
||||||
|
.fieldName(entry.getKey())
|
||||||
|
.original(entry.getValue())
|
||||||
|
.diffType(DiffType.REMOVED)
|
||||||
|
.build())
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
default List<FieldDiff> currentAddedField(Map<String, T> originalMapById,
|
||||||
|
Map<String, T> currentMapById) {
|
||||||
|
return currentMapById.entrySet()
|
||||||
|
.stream()
|
||||||
|
.filter(entry -> !originalMapById.containsKey(entry.getKey()))
|
||||||
|
.map(entry -> FieldDiff.builder()
|
||||||
|
.fieldName(entry.getKey())
|
||||||
|
.current(entry.getValue())
|
||||||
|
.diffType(DiffType.ADDED)
|
||||||
|
.build())
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
default List<FieldDiff> modifiedField(Map<String, T> original,
|
||||||
|
Map<String, T> current) {
|
||||||
|
List<FieldDiff> diff = new ArrayList<>();
|
||||||
|
original.entrySet()
|
||||||
|
.stream()
|
||||||
|
.filter(entry -> current.containsKey(entry.getKey()))
|
||||||
|
.forEach(entry -> {
|
||||||
|
T originalValue = entry.getValue();
|
||||||
|
T currentValue = current.get(entry.getKey());
|
||||||
|
if (!Objects.equals(originalValue, currentValue)) {
|
||||||
|
FieldDiff fieldDiff = FieldDiff.builder()
|
||||||
|
.fieldName(entry.getKey())
|
||||||
|
.original(originalValue)
|
||||||
|
.current(currentValue)
|
||||||
|
.diffType(DiffType.MODIFIED)
|
||||||
|
.build();
|
||||||
|
diff.add(fieldDiff);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return diff;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.databasir.core.diff.processor;
|
||||||
|
|
||||||
|
import com.databasir.core.diff.data.FieldDiff;
|
||||||
|
import com.databasir.core.meta.data.ForeignKeyMeta;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class ForeignKeyDiffProcessor implements DiffProcessor<ForeignKeyMeta> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FieldDiff process(String fieldName, List<ForeignKeyMeta> original, List<ForeignKeyMeta> current) {
|
||||||
|
return diffTableField(
|
||||||
|
original,
|
||||||
|
current,
|
||||||
|
"foreignKeys",
|
||||||
|
fk -> {
|
||||||
|
if (fk.getFkName() == null) {
|
||||||
|
return fk.getFkTableName() + "." + fk.getFkColumnName() + "." + fk.getKeySql();
|
||||||
|
} else {
|
||||||
|
return fk.getFkName();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,14 @@
|
||||||
|
package com.databasir.core.diff.processor;
|
||||||
|
|
||||||
|
import com.databasir.core.diff.data.FieldDiff;
|
||||||
|
import com.databasir.core.meta.data.IndexMeta;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class IndexDiffProcessor implements DiffProcessor<IndexMeta> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FieldDiff process(String fieldName, List<IndexMeta> original, List<IndexMeta> current) {
|
||||||
|
return diffTableField(original, current, fieldName, IndexMeta::getName);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,122 @@
|
||||||
|
package com.databasir.core.diff.processor;
|
||||||
|
|
||||||
|
import com.databasir.core.diff.data.DiffType;
|
||||||
|
import com.databasir.core.diff.data.FieldDiff;
|
||||||
|
import com.databasir.core.meta.data.TableMeta;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
public class TableDiffProcessor implements DiffProcessor<TableMeta> {
|
||||||
|
|
||||||
|
private final IndexDiffProcessor indexDiffProcessor = new IndexDiffProcessor();
|
||||||
|
|
||||||
|
private final ColumnDiffProcessor columnDiffProcessor = new ColumnDiffProcessor();
|
||||||
|
|
||||||
|
private final TriggerDiffProcessor triggerDiffProcessor = new TriggerDiffProcessor();
|
||||||
|
|
||||||
|
private final ForeignKeyDiffProcessor foreignKeyDiffProcessor = new ForeignKeyDiffProcessor();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FieldDiff process(String fieldName, List<TableMeta> original, List<TableMeta> current) {
|
||||||
|
// diff tables field
|
||||||
|
Map<String, TableMeta> originalMap = toMap(original, TableMeta::getName);
|
||||||
|
Map<String, TableMeta> currentMap = toMap(current, TableMeta::getName);
|
||||||
|
List<FieldDiff> tables = new ArrayList<>(32);
|
||||||
|
// removed
|
||||||
|
List<FieldDiff> removedFields = originalRemovedField(originalMap, currentMap);
|
||||||
|
tables.addAll(removedFields);
|
||||||
|
// added
|
||||||
|
List<FieldDiff> addedFields = currentAddedField(originalMap, currentMap);
|
||||||
|
tables.addAll(addedFields);
|
||||||
|
// modified
|
||||||
|
List<FieldDiff> modified = originalMap.entrySet()
|
||||||
|
.stream()
|
||||||
|
.filter(entry -> currentMap.containsKey(entry.getKey()))
|
||||||
|
.filter(entry -> !Objects.equals(entry.getValue(), currentMap.get(entry.getKey())))
|
||||||
|
.map(entry -> {
|
||||||
|
TableMeta originalValue = entry.getValue();
|
||||||
|
TableMeta currentValue = currentMap.get(entry.getKey());
|
||||||
|
return diffTableField(originalValue, currentValue);
|
||||||
|
})
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
tables.addAll(modified);
|
||||||
|
DiffType tablesDiffType;
|
||||||
|
if (!modified.isEmpty()) {
|
||||||
|
tablesDiffType = DiffType.MODIFIED;
|
||||||
|
} else if (!addedFields.isEmpty()) {
|
||||||
|
tablesDiffType = DiffType.ADDED;
|
||||||
|
} else if (!removedFields.isEmpty()) {
|
||||||
|
tablesDiffType = DiffType.REMOVED;
|
||||||
|
} else {
|
||||||
|
tablesDiffType = DiffType.NONE;
|
||||||
|
}
|
||||||
|
FieldDiff tablesField = FieldDiff.builder()
|
||||||
|
.diffType(tablesDiffType)
|
||||||
|
.fieldName(fieldName)
|
||||||
|
.fields(tables)
|
||||||
|
.build();
|
||||||
|
return tablesField;
|
||||||
|
}
|
||||||
|
|
||||||
|
private FieldDiff diffTableField(TableMeta original, TableMeta current) {
|
||||||
|
FieldDiff columns =
|
||||||
|
columnDiffProcessor.process("columns", original.getColumns(), current.getColumns());
|
||||||
|
FieldDiff indexes =
|
||||||
|
indexDiffProcessor.process("indexes", original.getIndexes(), current.getIndexes());
|
||||||
|
FieldDiff triggers =
|
||||||
|
triggerDiffProcessor.process("triggers", original.getTriggers(), current.getTriggers());
|
||||||
|
FieldDiff foreignKeys =
|
||||||
|
foreignKeyDiffProcessor.process("foreignKeys", original.getForeignKeys(), current.getForeignKeys());
|
||||||
|
List<FieldDiff> otherFields = fields(original, current);
|
||||||
|
|
||||||
|
List<FieldDiff> fields = new ArrayList<>();
|
||||||
|
fields.add(columns);
|
||||||
|
fields.add(indexes);
|
||||||
|
fields.add(foreignKeys);
|
||||||
|
fields.add(triggers);
|
||||||
|
fields.addAll(otherFields);
|
||||||
|
return FieldDiff.builder()
|
||||||
|
.diffType(DiffType.MODIFIED)
|
||||||
|
.fieldName(original.getName())
|
||||||
|
.fields(fields)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<FieldDiff> fields(TableMeta original, TableMeta current) {
|
||||||
|
List<FieldDiff> fields = new ArrayList<>();
|
||||||
|
// ignore tables diff
|
||||||
|
Class<TableMeta> clazz = TableMeta.class;
|
||||||
|
List<String> ignoredFields = List.of("columns", "indexes", "triggers", "foreignKeys");
|
||||||
|
Arrays.stream(clazz.getDeclaredFields())
|
||||||
|
.filter(field -> !ignoredFields.contains(field.getName()))
|
||||||
|
.forEach(field -> {
|
||||||
|
try {
|
||||||
|
field.setAccessible(true);
|
||||||
|
Object originalValue = original == null ? null : field.get(original);
|
||||||
|
Object currentValue = current == null ? null : field.get(current);
|
||||||
|
if (!Objects.equals(originalValue, currentValue)) {
|
||||||
|
DiffType diffType;
|
||||||
|
if (originalValue == null) {
|
||||||
|
diffType = DiffType.ADDED;
|
||||||
|
} else if (currentValue == null) {
|
||||||
|
diffType = DiffType.REMOVED;
|
||||||
|
} else {
|
||||||
|
diffType = DiffType.MODIFIED;
|
||||||
|
}
|
||||||
|
fields.add(FieldDiff.builder()
|
||||||
|
.diffType(diffType)
|
||||||
|
.fieldName(field.getName())
|
||||||
|
.original(originalValue)
|
||||||
|
.current(currentValue)
|
||||||
|
.build());
|
||||||
|
}
|
||||||
|
} catch (IllegalAccessException e) {
|
||||||
|
log.error("diff field failed", e);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return fields;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,14 @@
|
||||||
|
package com.databasir.core.diff.processor;
|
||||||
|
|
||||||
|
import com.databasir.core.diff.data.FieldDiff;
|
||||||
|
import com.databasir.core.meta.data.TriggerMeta;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class TriggerDiffProcessor implements DiffProcessor<TriggerMeta> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FieldDiff process(String fieldName, List<TriggerMeta> original, List<TriggerMeta> current) {
|
||||||
|
return diffTableField(original, current, fieldName, TriggerMeta::getName);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,10 +1,14 @@
|
||||||
package com.databasir.core.meta.data;
|
package com.databasir.core.meta.data;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
@Data
|
|
||||||
@Builder
|
@Builder
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
public class ColumnMeta {
|
public class ColumnMeta {
|
||||||
|
|
||||||
private String name;
|
private String name;
|
||||||
|
|
|
@ -1,12 +1,16 @@
|
||||||
package com.databasir.core.meta.data;
|
package com.databasir.core.meta.data;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
@Builder
|
@Builder
|
||||||
public class DatabaseMeta {
|
public class DatabaseMeta {
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,18 @@
|
||||||
package com.databasir.core.meta.data;
|
package com.databasir.core.meta.data;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
@Data
|
|
||||||
@Builder
|
@Builder
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
public class ForeignKeyMeta {
|
public class ForeignKeyMeta {
|
||||||
|
|
||||||
|
private Integer keySql;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* may null
|
* may null
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,13 +1,17 @@
|
||||||
package com.databasir.core.meta.data;
|
package com.databasir.core.meta.data;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Data
|
|
||||||
@Builder
|
@Builder
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
public class IndexMeta {
|
public class IndexMeta {
|
||||||
|
|
||||||
private String name;
|
private String name;
|
||||||
|
|
|
@ -1,13 +1,17 @@
|
||||||
package com.databasir.core.meta.data;
|
package com.databasir.core.meta.data;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Data
|
|
||||||
@Builder
|
@Builder
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
public class TableMeta {
|
public class TableMeta {
|
||||||
|
|
||||||
private String name;
|
private String name;
|
||||||
|
@ -27,6 +31,4 @@ public class TableMeta {
|
||||||
|
|
||||||
@Builder.Default
|
@Builder.Default
|
||||||
private List<ForeignKeyMeta> foreignKeys = Collections.emptyList();
|
private List<ForeignKeyMeta> foreignKeys = Collections.emptyList();
|
||||||
|
|
||||||
private String remark;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +1,17 @@
|
||||||
package com.databasir.core.meta.data;
|
package com.databasir.core.meta.data;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* now: only support mysql, postgresql.
|
* now: only support mysql, postgresql.
|
||||||
*/
|
*/
|
||||||
@Data
|
|
||||||
@Builder
|
@Builder
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
public class TriggerMeta {
|
public class TriggerMeta {
|
||||||
|
|
||||||
private String name;
|
private String name;
|
||||||
|
|
|
@ -41,8 +41,10 @@ public class JdbcForeignKeyMetaRepository implements ForeignKeyMetaRepository {
|
||||||
String pkColumnName = keyResult.getString("PKCOLUMN_NAME");
|
String pkColumnName = keyResult.getString("PKCOLUMN_NAME");
|
||||||
String pkName = keyResult.getString("PK_NAME");
|
String pkName = keyResult.getString("PK_NAME");
|
||||||
int updateRule = keyResult.getInt("UPDATE_RULE");
|
int updateRule = keyResult.getInt("UPDATE_RULE");
|
||||||
|
int keySql = keyResult.getInt("KEY_SEQ");
|
||||||
int deleteRule = keyResult.getInt("DELETE_RULE");
|
int deleteRule = keyResult.getInt("DELETE_RULE");
|
||||||
ForeignKeyMeta meta = ForeignKeyMeta.builder()
|
ForeignKeyMeta meta = ForeignKeyMeta.builder()
|
||||||
|
.keySql(keySql)
|
||||||
.fkTableName(fkTableName)
|
.fkTableName(fkTableName)
|
||||||
.fkColumnName(fkColumnName)
|
.fkColumnName(fkColumnName)
|
||||||
.fkName(fkName)
|
.fkName(fkName)
|
||||||
|
|
|
@ -1,9 +1,3 @@
|
||||||
import com.databasir.core.Databasir;
|
|
||||||
import com.databasir.core.meta.data.DatabaseMeta;
|
|
||||||
import org.junit.jupiter.api.Test;
|
|
||||||
|
|
||||||
import java.io.FileOutputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.sql.DriverManager;
|
import java.sql.DriverManager;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
|
@ -11,17 +5,17 @@ import java.util.Properties;
|
||||||
|
|
||||||
public class App {
|
public class App {
|
||||||
|
|
||||||
@Test
|
// @Test
|
||||||
public void testRenderAsMarkdown() throws SQLException, ClassNotFoundException {
|
// public void testRenderAsMarkdown() throws SQLException, ClassNotFoundException {
|
||||||
try (FileOutputStream out = new FileOutputStream("demo.md")) {
|
// try (FileOutputStream out = new FileOutputStream("demo.md")) {
|
||||||
Connection connection = getJdbcConnection();
|
// Connection connection = getJdbcConnection();
|
||||||
Databasir databasir = Databasir.of();
|
// Databasir databasir = Databasir.of();
|
||||||
DatabaseMeta doc = databasir.get(connection, "demo").orElseThrow();
|
// DatabaseMeta doc = databasir.get(connection, "demo").orElseThrow();
|
||||||
databasir.renderAsMarkdown(doc, out);
|
// databasir.renderAsMarkdown(doc, out);
|
||||||
} catch (IOException e) {
|
// } catch (IOException e) {
|
||||||
throw new IllegalStateException(e);
|
// throw new IllegalStateException(e);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
private static Connection getJdbcConnection() throws SQLException, ClassNotFoundException {
|
private static Connection getJdbcConnection() throws SQLException, ClassNotFoundException {
|
||||||
// get database connection
|
// get database connection
|
||||||
|
|
|
@ -0,0 +1,606 @@
|
||||||
|
package com.databasir.core.diff.service;
|
||||||
|
|
||||||
|
import com.databasir.core.diff.Diffs;
|
||||||
|
import com.databasir.core.diff.data.DiffType;
|
||||||
|
import com.databasir.core.diff.data.FieldDiff;
|
||||||
|
import com.databasir.core.diff.data.RootDiff;
|
||||||
|
import com.databasir.core.meta.data.*;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import com.fasterxml.jackson.databind.SerializationFeature;
|
||||||
|
import org.junit.jupiter.api.BeforeAll;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.net.URL;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.TimeZone;
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
|
|
||||||
|
class DiffsTest {
|
||||||
|
|
||||||
|
private static ObjectMapper objectMapper;
|
||||||
|
|
||||||
|
@BeforeAll
|
||||||
|
static void init() {
|
||||||
|
objectMapper = new ObjectMapper();
|
||||||
|
objectMapper.setSerializationInclusion(JsonInclude.Include.NON_ABSENT)
|
||||||
|
.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS)
|
||||||
|
.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
|
||||||
|
.disable(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS)
|
||||||
|
.disable(SerializationFeature.WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS)
|
||||||
|
.setTimeZone(TimeZone.getDefault());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void diffEmptyDatabaseSame() {
|
||||||
|
DatabaseMeta original = DatabaseMeta.builder().build();
|
||||||
|
DatabaseMeta current = DatabaseMeta.builder().build();
|
||||||
|
RootDiff diff = Diffs.diff(original, current);
|
||||||
|
assertEquals(DiffType.NONE, diff.getDiffType());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void diffDatabaseSame() {
|
||||||
|
DatabaseMeta original = load("ut/diffsTest/diffDatabaseSame/original.json");
|
||||||
|
DatabaseMeta current = load("ut/diffsTest/diffDatabaseSame/current.json");
|
||||||
|
|
||||||
|
RootDiff diff = Diffs.diff(original, current);
|
||||||
|
assertEquals(DiffType.NONE, diff.getDiffType());
|
||||||
|
assertSame(1, diff.getFields().size());
|
||||||
|
FieldDiff tableField = diff.getFields().iterator().next();
|
||||||
|
assertEquals("tables", tableField.getFieldName());
|
||||||
|
assertEquals(DiffType.NONE, tableField.getDiffType());
|
||||||
|
assertTrue(tableField.getFields().isEmpty());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void diffDatabaseAdded() {
|
||||||
|
DatabaseMeta current = load("ut/diffsTest/diffDatabaseAdded/current.json");
|
||||||
|
RootDiff diff = Diffs.diff(null, current);
|
||||||
|
assertEquals(DiffType.ADDED, diff.getDiffType());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void diffDatabaseRemoved() {
|
||||||
|
DatabaseMeta original = load("ut/diffsTest/diffDatabaseRemoved/original.json");
|
||||||
|
RootDiff diff = Diffs.diff(original, null);
|
||||||
|
assertEquals(DiffType.REMOVED, diff.getDiffType());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void diffDatabaseModified() {
|
||||||
|
DatabaseMeta original = load("ut/diffsTest/diffDatabaseModified/original.json");
|
||||||
|
DatabaseMeta current = load("ut/diffsTest/diffDatabaseModified/current.json");
|
||||||
|
|
||||||
|
// database
|
||||||
|
RootDiff diff = Diffs.diff(original, current);
|
||||||
|
assertEquals(DiffType.MODIFIED, diff.getDiffType());
|
||||||
|
assertSame(2, diff.getFields().size());
|
||||||
|
Map<String, FieldDiff> diffMap = diff.getFields()
|
||||||
|
.stream()
|
||||||
|
.collect(Collectors.toMap(d -> d.getFieldName(), Function.identity()));
|
||||||
|
|
||||||
|
// productVersion
|
||||||
|
assertTrue(diffMap.containsKey("productVersion"));
|
||||||
|
assertIsModified(diffMap.get("productVersion"));
|
||||||
|
assertEquals(original.getProductVersion(), diffMap.get("productVersion").getOriginal());
|
||||||
|
assertEquals(current.getProductVersion(), diffMap.get("productVersion").getCurrent());
|
||||||
|
|
||||||
|
// tables
|
||||||
|
assertTrue(diffMap.containsKey("tables"));
|
||||||
|
assertIsNone(diffMap.get("tables"));
|
||||||
|
assertTrue(diffMap.get("tables").getFields().isEmpty());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void diffTableAdded() {
|
||||||
|
DatabaseMeta original = load("ut/diffsTest/diffTableAdded/original.json");
|
||||||
|
DatabaseMeta current = load("ut/diffsTest/diffTableAdded/current.json");
|
||||||
|
|
||||||
|
// database
|
||||||
|
RootDiff diff = Diffs.diff(original, current);
|
||||||
|
assertEquals(DiffType.MODIFIED, diff.getDiffType());
|
||||||
|
|
||||||
|
// add table: departments, dept_emp
|
||||||
|
assertSame(1, diff.getFields().size());
|
||||||
|
FieldDiff tableField = diff.getFields().iterator().next();
|
||||||
|
assertEquals("tables", tableField.getFieldName());
|
||||||
|
assertEquals(DiffType.ADDED, tableField.getDiffType());
|
||||||
|
|
||||||
|
// tables without original & current value
|
||||||
|
assertNull(tableField.getOriginal());
|
||||||
|
assertNull(tableField.getCurrent());
|
||||||
|
|
||||||
|
// add two tables
|
||||||
|
assertSame(2, tableField.getFields().size());
|
||||||
|
Map<String, FieldDiff> tableFieldMap = tableField.getFields()
|
||||||
|
.stream()
|
||||||
|
.collect(Collectors.toMap(FieldDiff::getFieldName, Function.identity()));
|
||||||
|
Map<String, TableMeta> currentTablesMap = current.getTables()
|
||||||
|
.stream()
|
||||||
|
.collect(Collectors.toMap(TableMeta::getName, Function.identity()));
|
||||||
|
|
||||||
|
List.of("departments", "dept_emp").forEach(tableName -> {
|
||||||
|
assertTrue(tableFieldMap.containsKey(tableName));
|
||||||
|
FieldDiff departments = tableFieldMap.get(tableName);
|
||||||
|
assertIsAdded(departments);
|
||||||
|
assertNull(departments.getOriginal());
|
||||||
|
assertNotNull(departments.getCurrent());
|
||||||
|
assertEquals(currentTablesMap.get(tableName), departments.getCurrent());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void diffTableRemoved() {
|
||||||
|
DatabaseMeta original = load("ut/diffsTest/diffTableRemoved/original.json");
|
||||||
|
DatabaseMeta current = load("ut/diffsTest/diffTableRemoved/current.json");
|
||||||
|
|
||||||
|
// database
|
||||||
|
RootDiff diff = Diffs.diff(original, current);
|
||||||
|
assertEquals(DiffType.MODIFIED, diff.getDiffType());
|
||||||
|
|
||||||
|
// remove table: departments, dept_emp
|
||||||
|
assertSame(1, diff.getFields().size());
|
||||||
|
FieldDiff tableField = diff.getFields().iterator().next();
|
||||||
|
assertEquals("tables", tableField.getFieldName());
|
||||||
|
assertEquals(DiffType.REMOVED, tableField.getDiffType());
|
||||||
|
|
||||||
|
// tables without original & current value
|
||||||
|
assertNull(tableField.getOriginal());
|
||||||
|
assertNull(tableField.getCurrent());
|
||||||
|
|
||||||
|
// remove two tables
|
||||||
|
assertSame(2, tableField.getFields().size());
|
||||||
|
Map<String, FieldDiff> tableFieldMap = tableField.getFields()
|
||||||
|
.stream()
|
||||||
|
.collect(Collectors.toMap(FieldDiff::getFieldName, Function.identity()));
|
||||||
|
Map<String, TableMeta> originalTablesMap = original.getTables()
|
||||||
|
.stream()
|
||||||
|
.collect(Collectors.toMap(TableMeta::getName, Function.identity()));
|
||||||
|
|
||||||
|
List.of("departments", "dept_emp").forEach(tableName -> {
|
||||||
|
assertTrue(tableFieldMap.containsKey(tableName));
|
||||||
|
FieldDiff field = tableFieldMap.get(tableName);
|
||||||
|
assertIsRemoved(field);
|
||||||
|
assertNull(field.getCurrent());
|
||||||
|
assertNotNull(field.getOriginal());
|
||||||
|
assertEquals(originalTablesMap.get(tableName), field.getOriginal());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void diffTableModified() {
|
||||||
|
DatabaseMeta original = load("ut/diffsTest/diffTableModified/original.json");
|
||||||
|
DatabaseMeta current = load("ut/diffsTest/diffTableModified/current.json");
|
||||||
|
|
||||||
|
// database
|
||||||
|
RootDiff diff = Diffs.diff(original, current);
|
||||||
|
assertEquals(DiffType.MODIFIED, diff.getDiffType());
|
||||||
|
|
||||||
|
/**
|
||||||
|
* modify three table: departments, dept_emp
|
||||||
|
* - dept_manager: add comment, change table type
|
||||||
|
* - departments: add comment
|
||||||
|
* - dept_emp: add comment
|
||||||
|
*/
|
||||||
|
assertSame(1, diff.getFields().size());
|
||||||
|
FieldDiff tableField = diff.getFields().iterator().next();
|
||||||
|
assertEquals("tables", tableField.getFieldName());
|
||||||
|
assertEquals(DiffType.MODIFIED, tableField.getDiffType());
|
||||||
|
|
||||||
|
// tables without original & current value
|
||||||
|
assertNull(tableField.getOriginal());
|
||||||
|
assertNull(tableField.getCurrent());
|
||||||
|
|
||||||
|
// modify 3 tables
|
||||||
|
assertSame(3, tableField.getFields().size());
|
||||||
|
Map<String, FieldDiff> tableFieldMap = tableField.getFields()
|
||||||
|
.stream()
|
||||||
|
.collect(Collectors.toMap(FieldDiff::getFieldName, Function.identity()));
|
||||||
|
Map<String, TableMeta> originalTableMap = original.getTables()
|
||||||
|
.stream()
|
||||||
|
.collect(Collectors.toMap(TableMeta::getName, Function.identity()));
|
||||||
|
Map<String, TableMeta> currentTableMap = current.getTables()
|
||||||
|
.stream()
|
||||||
|
.collect(Collectors.toMap(TableMeta::getName, Function.identity()));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* - departments: add comment
|
||||||
|
* - dept_emp: add comment
|
||||||
|
* - dept_manager: add comment, change table type
|
||||||
|
*/
|
||||||
|
List.of("departments", "dept_emp", "dept_manager").forEach(tableName -> {
|
||||||
|
assertTrue(tableFieldMap.containsKey(tableName));
|
||||||
|
FieldDiff departments = tableFieldMap.get(tableName);
|
||||||
|
assertIsModified(departments);
|
||||||
|
assertNull(departments.getCurrent());
|
||||||
|
assertNull(departments.getOriginal());
|
||||||
|
if ("dept_manager".equals(tableName)) {
|
||||||
|
// columns \ indexes \ triggers \ forgienKes \ comment
|
||||||
|
assertSame(6, departments.getFields().size());
|
||||||
|
FieldDiff departmentCommentField = departments.getFields().stream()
|
||||||
|
.filter(f -> f.getFieldName().equals("type"))
|
||||||
|
.findAny()
|
||||||
|
.orElseThrow();
|
||||||
|
assertEquals(originalTableMap.get(tableName).getType(), departmentCommentField.getOriginal());
|
||||||
|
assertEquals(currentTableMap.get(tableName).getType(), departmentCommentField.getCurrent());
|
||||||
|
} else {
|
||||||
|
// columns \ indexes \ triggers \ forgienKes \ comment
|
||||||
|
assertSame(5, departments.getFields().size());
|
||||||
|
}
|
||||||
|
|
||||||
|
FieldDiff departmentCommentField = departments.getFields().stream()
|
||||||
|
.filter(f -> f.getFieldName().equals("comment"))
|
||||||
|
.findAny()
|
||||||
|
.orElseThrow();
|
||||||
|
assertEquals(originalTableMap.get(tableName).getComment(), departmentCommentField.getOriginal());
|
||||||
|
assertEquals(currentTableMap.get(tableName).getComment(), departmentCommentField.getCurrent());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* add columns \ indexes \ triggers \ foreignKeys
|
||||||
|
* <p>
|
||||||
|
* department:
|
||||||
|
* - add column [deleted], [dept_code]
|
||||||
|
* - add index [dept_deleted]
|
||||||
|
* - add triggers [before_insert]
|
||||||
|
* - add foreignKeys [dept_emp_ibfk_1]
|
||||||
|
* </p>
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
void diffTableFieldsAdded() {
|
||||||
|
DatabaseMeta original = load("ut/diffsTest/diffTableFieldsAdded/original.json");
|
||||||
|
DatabaseMeta current = load("ut/diffsTest/diffTableFieldsAdded/current.json");
|
||||||
|
|
||||||
|
// database
|
||||||
|
RootDiff diff = Diffs.diff(original, current);
|
||||||
|
assertEquals(DiffType.MODIFIED, diff.getDiffType());
|
||||||
|
|
||||||
|
// modified table: departments
|
||||||
|
assertSame(1, diff.getFields().size());
|
||||||
|
FieldDiff tableField = diff.getFields().iterator().next();
|
||||||
|
assertEquals("tables", tableField.getFieldName());
|
||||||
|
assertEquals(DiffType.MODIFIED, tableField.getDiffType());
|
||||||
|
|
||||||
|
// tables without original & current value
|
||||||
|
assertNull(tableField.getOriginal());
|
||||||
|
assertNull(tableField.getCurrent());
|
||||||
|
|
||||||
|
// modified 1 tables
|
||||||
|
assertSame(1, tableField.getFields().size());
|
||||||
|
Map<String, FieldDiff> tableFieldMap = tableField.getFields()
|
||||||
|
.stream()
|
||||||
|
.collect(Collectors.toMap(FieldDiff::getFieldName, Function.identity()));
|
||||||
|
TableMeta currentDepartment = current.getTables()
|
||||||
|
.stream()
|
||||||
|
.filter(t -> "departments".equals(t.getName()))
|
||||||
|
.findFirst()
|
||||||
|
.orElseThrow();
|
||||||
|
|
||||||
|
List.of("departments").forEach(tableName -> {
|
||||||
|
assertTrue(tableFieldMap.containsKey(tableName));
|
||||||
|
FieldDiff departments = tableFieldMap.get(tableName);
|
||||||
|
assertIsModified(departments);
|
||||||
|
assertNull(departments.getOriginal());
|
||||||
|
assertNull(departments.getCurrent());
|
||||||
|
|
||||||
|
// columns / indexes / triggers / foreignKes
|
||||||
|
assertSame(4, departments.getFields().size());
|
||||||
|
for (FieldDiff field : departments.getFields()) {
|
||||||
|
assertIsModified(field);
|
||||||
|
if ("columns".equals(field.getFieldName())) {
|
||||||
|
assertSame(2, field.getFields().size());
|
||||||
|
for (FieldDiff columnField : field.getFields()) {
|
||||||
|
assertIsAdded(columnField);
|
||||||
|
assertNull(columnField.getOriginal());
|
||||||
|
assertNotNull(columnField.getCurrent());
|
||||||
|
ColumnMeta colMeta = (ColumnMeta) columnField.getCurrent();
|
||||||
|
boolean matched = currentDepartment.getColumns().stream()
|
||||||
|
.anyMatch(idx -> Objects.equals(idx, colMeta));
|
||||||
|
assertTrue(matched);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ("indexes".equals(field.getFieldName())) {
|
||||||
|
assertSame(1, field.getFields().size());
|
||||||
|
FieldDiff indexes = field.getFields().iterator().next();
|
||||||
|
assertIsAdded(indexes);
|
||||||
|
assertNull(indexes.getOriginal());
|
||||||
|
IndexMeta index = (IndexMeta) indexes.getCurrent();
|
||||||
|
assertNotNull(index);
|
||||||
|
boolean matched = currentDepartment.getIndexes().stream()
|
||||||
|
.anyMatch(idx -> Objects.equals(idx, index));
|
||||||
|
assertTrue(matched);
|
||||||
|
}
|
||||||
|
if ("triggers".equals(field.getFieldName())) {
|
||||||
|
assertSame(1, field.getFields().size());
|
||||||
|
FieldDiff triggers = field.getFields().iterator().next();
|
||||||
|
assertIsAdded(triggers);
|
||||||
|
assertNull(triggers.getOriginal());
|
||||||
|
TriggerMeta tg = (TriggerMeta) triggers.getCurrent();
|
||||||
|
assertNotNull(tg);
|
||||||
|
boolean matched = currentDepartment.getTriggers().stream().anyMatch(t -> Objects.equals(t, tg));
|
||||||
|
assertTrue(matched);
|
||||||
|
}
|
||||||
|
if ("foreignKeys".equals(field.getFieldName())) {
|
||||||
|
assertSame(1, field.getFields().size());
|
||||||
|
FieldDiff foreignKeys = field.getFields().iterator().next();
|
||||||
|
assertIsAdded(foreignKeys);
|
||||||
|
assertNull(foreignKeys.getOriginal());
|
||||||
|
ForeignKeyMeta fk = (ForeignKeyMeta) foreignKeys.getCurrent();
|
||||||
|
assertNotNull(fk);
|
||||||
|
boolean matched = currentDepartment.getForeignKeys().stream().anyMatch(f -> Objects.equals(f, fk));
|
||||||
|
assertTrue(matched);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* dept_emp
|
||||||
|
* fk: dept_emp_ibfk_2
|
||||||
|
* column: from_date, to_date
|
||||||
|
* index: dept_no
|
||||||
|
* trigger: before_insert
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
void diffTableFieldsRemoved() {
|
||||||
|
DatabaseMeta original = load("ut/diffsTest/diffTableFieldsRemoved/original.json");
|
||||||
|
DatabaseMeta current = load("ut/diffsTest/diffTableFieldsRemoved/current.json");
|
||||||
|
|
||||||
|
// database
|
||||||
|
RootDiff diff = Diffs.diff(original, current);
|
||||||
|
assertEquals(DiffType.MODIFIED, diff.getDiffType());
|
||||||
|
|
||||||
|
// modified table: departments
|
||||||
|
assertSame(1, diff.getFields().size());
|
||||||
|
FieldDiff tableField = diff.getFields().iterator().next();
|
||||||
|
assertEquals("tables", tableField.getFieldName());
|
||||||
|
assertEquals(DiffType.MODIFIED, tableField.getDiffType());
|
||||||
|
|
||||||
|
// tables without original & current value
|
||||||
|
assertNull(tableField.getOriginal());
|
||||||
|
assertNull(tableField.getCurrent());
|
||||||
|
|
||||||
|
// modified 1 tables
|
||||||
|
assertSame(1, tableField.getFields().size());
|
||||||
|
Map<String, FieldDiff> tableFieldMap = tableField.getFields()
|
||||||
|
.stream()
|
||||||
|
.collect(Collectors.toMap(FieldDiff::getFieldName, Function.identity()));
|
||||||
|
TableMeta originalTable = original.getTables()
|
||||||
|
.stream()
|
||||||
|
.filter(t -> "dept_emp".equals(t.getName()))
|
||||||
|
.findFirst()
|
||||||
|
.orElseThrow();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* dept_emp
|
||||||
|
* fk: dept_emp_ibfk_2
|
||||||
|
* column: from_date, to_date
|
||||||
|
* index: dept_no
|
||||||
|
* trigger: before_insert
|
||||||
|
*/
|
||||||
|
List.of("dept_emp").forEach(tableName -> {
|
||||||
|
assertTrue(tableFieldMap.containsKey(tableName));
|
||||||
|
FieldDiff departments = tableFieldMap.get(tableName);
|
||||||
|
assertIsModified(departments);
|
||||||
|
assertNull(departments.getOriginal());
|
||||||
|
assertNull(departments.getCurrent());
|
||||||
|
|
||||||
|
// columns / indexes / triggers / foreignKes
|
||||||
|
assertSame(4, departments.getFields().size());
|
||||||
|
for (FieldDiff field : departments.getFields()) {
|
||||||
|
assertIsModified(field);
|
||||||
|
if ("columns".equals(field.getFieldName())) {
|
||||||
|
assertSame(2, field.getFields().size());
|
||||||
|
for (FieldDiff columnField : field.getFields()) {
|
||||||
|
assertIsRemoved(columnField);
|
||||||
|
assertNull(columnField.getCurrent());
|
||||||
|
assertNotNull(columnField.getOriginal());
|
||||||
|
ColumnMeta colMeta = (ColumnMeta) columnField.getOriginal();
|
||||||
|
boolean matched = originalTable.getColumns().stream()
|
||||||
|
.anyMatch(idx -> Objects.equals(idx, colMeta));
|
||||||
|
assertTrue(matched);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ("indexes".equals(field.getFieldName())) {
|
||||||
|
assertSame(1, field.getFields().size());
|
||||||
|
FieldDiff indexes = field.getFields().iterator().next();
|
||||||
|
assertIsRemoved(indexes);
|
||||||
|
assertNull(indexes.getCurrent());
|
||||||
|
IndexMeta index = (IndexMeta) indexes.getOriginal();
|
||||||
|
assertNotNull(index);
|
||||||
|
boolean matched = originalTable.getIndexes().stream()
|
||||||
|
.anyMatch(idx -> Objects.equals(idx, index));
|
||||||
|
assertTrue(matched);
|
||||||
|
}
|
||||||
|
if ("triggers".equals(field.getFieldName())) {
|
||||||
|
assertSame(1, field.getFields().size());
|
||||||
|
FieldDiff triggers = field.getFields().iterator().next();
|
||||||
|
assertIsRemoved(triggers);
|
||||||
|
assertNull(triggers.getCurrent());
|
||||||
|
TriggerMeta tg = (TriggerMeta) triggers.getOriginal();
|
||||||
|
assertNotNull(tg);
|
||||||
|
boolean matched = originalTable.getTriggers().stream().anyMatch(t -> Objects.equals(t, tg));
|
||||||
|
assertTrue(matched);
|
||||||
|
}
|
||||||
|
if ("foreignKeys".equals(field.getFieldName())) {
|
||||||
|
assertSame(1, field.getFields().size());
|
||||||
|
FieldDiff foreignKeys = field.getFields().iterator().next();
|
||||||
|
assertIsRemoved(foreignKeys);
|
||||||
|
assertNull(foreignKeys.getCurrent());
|
||||||
|
ForeignKeyMeta fk = (ForeignKeyMeta) foreignKeys.getOriginal();
|
||||||
|
assertNotNull(fk);
|
||||||
|
boolean matched = originalTable.getForeignKeys().stream().anyMatch(f -> Objects.equals(f, fk));
|
||||||
|
assertTrue(matched);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void diffTableFieldsModified() {
|
||||||
|
DatabaseMeta original = load("ut/diffsTest/diffTableFieldsModified/original.json");
|
||||||
|
DatabaseMeta current = load("ut/diffsTest/diffTableFieldsModified/current.json");
|
||||||
|
|
||||||
|
// database
|
||||||
|
RootDiff diff = Diffs.diff(original, current);
|
||||||
|
assertEquals(DiffType.MODIFIED, diff.getDiffType());
|
||||||
|
|
||||||
|
// modified table: departments, dept_emp
|
||||||
|
assertSame(1, diff.getFields().size());
|
||||||
|
FieldDiff tablesField = diff.getFields().iterator().next();
|
||||||
|
assertEquals("tables", tablesField.getFieldName());
|
||||||
|
assertEquals(DiffType.MODIFIED, tablesField.getDiffType());
|
||||||
|
|
||||||
|
// tables without original & current value
|
||||||
|
assertNull(tablesField.getOriginal());
|
||||||
|
assertNull(tablesField.getCurrent());
|
||||||
|
|
||||||
|
// modified 1 tables
|
||||||
|
assertSame(2, tablesField.getFields().size());
|
||||||
|
Map<String, FieldDiff> tableFieldMap = tablesField.getFields()
|
||||||
|
.stream()
|
||||||
|
.collect(Collectors.toMap(FieldDiff::getFieldName, Function.identity()));
|
||||||
|
Map<String, TableMeta> originalTaleMap = original.getTables()
|
||||||
|
.stream()
|
||||||
|
.collect(Collectors.toMap(TableMeta::getName, Function.identity()));
|
||||||
|
Map<String, TableMeta> currentTableMap = current.getTables()
|
||||||
|
.stream()
|
||||||
|
.collect(Collectors.toMap(TableMeta::getName, Function.identity()));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* departments
|
||||||
|
* column: dept_no add comment
|
||||||
|
* column: dept_name add comment
|
||||||
|
* indexes: dept_name change unique=false
|
||||||
|
*
|
||||||
|
* dept_emp
|
||||||
|
* column: emp_no change default value
|
||||||
|
* column: dept_noL change auto increment true
|
||||||
|
* indexes: dept_no
|
||||||
|
* triggers: before_insert
|
||||||
|
* foreignKeys: dept_emp_ibfk_2
|
||||||
|
*/
|
||||||
|
List.of("departments", "dept_emp").forEach(tableName -> {
|
||||||
|
assertTrue(tableFieldMap.containsKey(tableName));
|
||||||
|
FieldDiff tableField = tableFieldMap.get(tableName);
|
||||||
|
assertIsModified(tableField);
|
||||||
|
assertNull(tableField.getOriginal());
|
||||||
|
assertNull(tableField.getCurrent());
|
||||||
|
|
||||||
|
// columns / indexes / triggers / foreignKes
|
||||||
|
assertSame(4, tableField.getFields().size());
|
||||||
|
for (FieldDiff field : tableField.getFields()) {
|
||||||
|
if ("columns".equals(field.getFieldName())) {
|
||||||
|
assertIsModified(field);
|
||||||
|
assertSame(2, field.getFields().size());
|
||||||
|
for (FieldDiff columnField : field.getFields()) {
|
||||||
|
assertIsModified(columnField);
|
||||||
|
assertNotNull(columnField.getCurrent());
|
||||||
|
assertNotNull(columnField.getOriginal());
|
||||||
|
ColumnMeta originalCol = (ColumnMeta) columnField.getOriginal();
|
||||||
|
boolean matched = originalTaleMap.get(tableName)
|
||||||
|
.getColumns()
|
||||||
|
.stream()
|
||||||
|
.anyMatch(idx -> Objects.equals(idx, originalCol));
|
||||||
|
assertTrue(matched);
|
||||||
|
|
||||||
|
ColumnMeta currentCol = (ColumnMeta) columnField.getCurrent();
|
||||||
|
assertTrue(currentTableMap.get(tableName)
|
||||||
|
.getColumns()
|
||||||
|
.stream()
|
||||||
|
.anyMatch(idx -> Objects.equals(idx, currentCol)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ("indexes".equals(field.getFieldName())) {
|
||||||
|
assertIsModified(field);
|
||||||
|
assertSame(1, field.getFields().size());
|
||||||
|
FieldDiff indexes = field.getFields().iterator().next();
|
||||||
|
assertIsModified(indexes);
|
||||||
|
assertNotNull(indexes.getCurrent());
|
||||||
|
assertNotNull(indexes.getOriginal());
|
||||||
|
|
||||||
|
IndexMeta originalIndex = (IndexMeta) indexes.getOriginal();
|
||||||
|
boolean matched = originalTaleMap.get(tableName)
|
||||||
|
.getIndexes()
|
||||||
|
.stream()
|
||||||
|
.anyMatch(idx -> Objects.equals(idx, originalIndex));
|
||||||
|
assertTrue(matched);
|
||||||
|
|
||||||
|
IndexMeta currentIndex = (IndexMeta) indexes.getCurrent();
|
||||||
|
assertTrue(currentTableMap.get(tableName)
|
||||||
|
.getIndexes()
|
||||||
|
.stream()
|
||||||
|
.anyMatch(idx -> Objects.equals(idx, currentIndex)));
|
||||||
|
}
|
||||||
|
if (tableName.equals("dept_emp") && "triggers".equals(field.getFieldName())) {
|
||||||
|
assertIsModified(field);
|
||||||
|
assertSame(1, field.getFields().size());
|
||||||
|
FieldDiff triggers = field.getFields().iterator().next();
|
||||||
|
assertIsModified(triggers);
|
||||||
|
assertNotNull(triggers.getCurrent());
|
||||||
|
assertNotNull(triggers.getOriginal());
|
||||||
|
TriggerMeta originalTg = (TriggerMeta) triggers.getOriginal();
|
||||||
|
assertTrue(originalTaleMap.get(tableName).getTriggers().stream()
|
||||||
|
.anyMatch(t -> Objects.equals(t, originalTg)));
|
||||||
|
|
||||||
|
TriggerMeta currentTg = (TriggerMeta) triggers.getCurrent();
|
||||||
|
assertTrue(currentTableMap.get(tableName).getTriggers().stream()
|
||||||
|
.anyMatch(t -> Objects.equals(t, currentTg)));
|
||||||
|
}
|
||||||
|
if (tableName.equals("dept_emp") && "foreignKeys".equals(field.getFieldName())) {
|
||||||
|
assertIsModified(field);
|
||||||
|
assertSame(1, field.getFields().size());
|
||||||
|
FieldDiff foreignKeys = field.getFields().iterator().next();
|
||||||
|
assertIsModified(foreignKeys);
|
||||||
|
assertNotNull(foreignKeys.getCurrent());
|
||||||
|
assertNotNull(foreignKeys.getOriginal());
|
||||||
|
ForeignKeyMeta originalFk = (ForeignKeyMeta) foreignKeys.getOriginal();
|
||||||
|
assertTrue(originalTaleMap.get(tableName)
|
||||||
|
.getForeignKeys().stream().anyMatch(f -> Objects.equals(f, originalFk)));
|
||||||
|
|
||||||
|
ForeignKeyMeta currentFk = (ForeignKeyMeta) foreignKeys.getCurrent();
|
||||||
|
assertTrue(currentTableMap.get(tableName)
|
||||||
|
.getForeignKeys().stream().anyMatch(f -> Objects.equals(f, currentFk)));
|
||||||
|
}
|
||||||
|
if (tableName.equals("departments") && List.of("foreignKeys", "triggers").contains(field.getFieldName())) {
|
||||||
|
assertIsNone(field);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void assertIsModified(FieldDiff diff) {
|
||||||
|
assertEquals(DiffType.MODIFIED, diff.getDiffType());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void assertIsNone(FieldDiff diff) {
|
||||||
|
assertEquals(DiffType.NONE, diff.getDiffType());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void assertIsRemoved(FieldDiff diff) {
|
||||||
|
assertEquals(DiffType.REMOVED, diff.getDiffType());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void assertIsAdded(FieldDiff diff) {
|
||||||
|
assertEquals(DiffType.ADDED, diff.getDiffType());
|
||||||
|
}
|
||||||
|
|
||||||
|
private DatabaseMeta load(String url) {
|
||||||
|
URL originalUrl = Thread.currentThread().getContextClassLoader()
|
||||||
|
.getResource(url);
|
||||||
|
try {
|
||||||
|
return objectMapper.readValue(originalUrl, DatabaseMeta.class);
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,466 @@
|
||||||
|
{
|
||||||
|
"tables": [
|
||||||
|
{
|
||||||
|
"name": "departments",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"type": "CHAR",
|
||||||
|
"size": 4,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_name",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 40,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "dept_name",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_name"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_emp",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"type": "CHAR",
|
||||||
|
"size": 4,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"isUniqueKey": false,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "dept_emp_ibfk_2",
|
||||||
|
"fkTableName": "dept_emp",
|
||||||
|
"fkColumnName": "dept_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "departments",
|
||||||
|
"pkColumnName": "dept_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fkName": "dept_emp_ibfk_1",
|
||||||
|
"fkTableName": "dept_emp",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_manager",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"type": "CHAR",
|
||||||
|
"size": 4,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"isUniqueKey": false,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "dept_manager_ibfk_2",
|
||||||
|
"fkTableName": "dept_manager",
|
||||||
|
"fkColumnName": "dept_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "departments",
|
||||||
|
"pkColumnName": "dept_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fkName": "dept_manager_ibfk_1",
|
||||||
|
"fkTableName": "dept_manager",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "employees",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "birth_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "first_name",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 14,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "last_name",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 16,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "gender",
|
||||||
|
"type": "ENUM",
|
||||||
|
"size": 1,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "hire_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "salaries",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "salary",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"from_date"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "salaries_ibfk_1",
|
||||||
|
"fkTableName": "salaries",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "titles",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "title",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 50,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "YES",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"title",
|
||||||
|
"from_date"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "titles_ibfk_1",
|
||||||
|
"fkTableName": "titles",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,470 @@
|
||||||
|
{
|
||||||
|
"databaseName": "employees",
|
||||||
|
"schemaName": "employees",
|
||||||
|
"productName": "MySQL",
|
||||||
|
"productVersion": "8.0.26",
|
||||||
|
"tables": [
|
||||||
|
{
|
||||||
|
"name": "departments",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"type": "CHAR",
|
||||||
|
"size": 4,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_name",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 40,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "dept_name",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_name"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_emp",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"type": "CHAR",
|
||||||
|
"size": 4,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"isUniqueKey": false,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "dept_emp_ibfk_2",
|
||||||
|
"fkTableName": "dept_emp",
|
||||||
|
"fkColumnName": "dept_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "departments",
|
||||||
|
"pkColumnName": "dept_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fkName": "dept_emp_ibfk_1",
|
||||||
|
"fkTableName": "dept_emp",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_manager",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"type": "CHAR",
|
||||||
|
"size": 4,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"isUniqueKey": false,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "dept_manager_ibfk_2",
|
||||||
|
"fkTableName": "dept_manager",
|
||||||
|
"fkColumnName": "dept_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "departments",
|
||||||
|
"pkColumnName": "dept_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fkName": "dept_manager_ibfk_1",
|
||||||
|
"fkTableName": "dept_manager",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "employees",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "birth_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "first_name",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 14,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "last_name",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 16,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "gender",
|
||||||
|
"type": "ENUM",
|
||||||
|
"size": 1,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "hire_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "salaries",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "salary",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"from_date"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "salaries_ibfk_1",
|
||||||
|
"fkTableName": "salaries",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "titles",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "title",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 50,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "YES",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"title",
|
||||||
|
"from_date"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "titles_ibfk_1",
|
||||||
|
"fkTableName": "titles",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,470 @@
|
||||||
|
{
|
||||||
|
"databaseName": "employees",
|
||||||
|
"schemaName": "employees",
|
||||||
|
"productName": "MySQL",
|
||||||
|
"productVersion": "9.0",
|
||||||
|
"tables": [
|
||||||
|
{
|
||||||
|
"name": "departments",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"type": "CHAR",
|
||||||
|
"size": 4,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_name",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 40,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "dept_name",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_name"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_emp",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"type": "CHAR",
|
||||||
|
"size": 4,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"isUniqueKey": false,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "dept_emp_ibfk_2",
|
||||||
|
"fkTableName": "dept_emp",
|
||||||
|
"fkColumnName": "dept_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "departments",
|
||||||
|
"pkColumnName": "dept_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fkName": "dept_emp_ibfk_1",
|
||||||
|
"fkTableName": "dept_emp",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_manager",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"type": "CHAR",
|
||||||
|
"size": 4,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"isUniqueKey": false,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "dept_manager_ibfk_2",
|
||||||
|
"fkTableName": "dept_manager",
|
||||||
|
"fkColumnName": "dept_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "departments",
|
||||||
|
"pkColumnName": "dept_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fkName": "dept_manager_ibfk_1",
|
||||||
|
"fkTableName": "dept_manager",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "employees",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "birth_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "first_name",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 14,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "last_name",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 16,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "gender",
|
||||||
|
"type": "ENUM",
|
||||||
|
"size": 1,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "hire_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "salaries",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "salary",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"from_date"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "salaries_ibfk_1",
|
||||||
|
"fkTableName": "salaries",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "titles",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "title",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 50,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "YES",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"title",
|
||||||
|
"from_date"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "titles_ibfk_1",
|
||||||
|
"fkTableName": "titles",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,466 @@
|
||||||
|
{
|
||||||
|
"tables": [
|
||||||
|
{
|
||||||
|
"name": "departments",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"type": "CHAR",
|
||||||
|
"size": 4,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_name",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 40,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "dept_name",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_name"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_emp",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"type": "CHAR",
|
||||||
|
"size": 4,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"isUniqueKey": false,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "dept_emp_ibfk_2",
|
||||||
|
"fkTableName": "dept_emp",
|
||||||
|
"fkColumnName": "dept_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "departments",
|
||||||
|
"pkColumnName": "dept_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fkName": "dept_emp_ibfk_1",
|
||||||
|
"fkTableName": "dept_emp",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_manager",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"type": "CHAR",
|
||||||
|
"size": 4,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"isUniqueKey": false,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "dept_manager_ibfk_2",
|
||||||
|
"fkTableName": "dept_manager",
|
||||||
|
"fkColumnName": "dept_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "departments",
|
||||||
|
"pkColumnName": "dept_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fkName": "dept_manager_ibfk_1",
|
||||||
|
"fkTableName": "dept_manager",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "employees",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "birth_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "first_name",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 14,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "last_name",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 16,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "gender",
|
||||||
|
"type": "ENUM",
|
||||||
|
"size": 1,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "hire_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "salaries",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "salary",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"from_date"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "salaries_ibfk_1",
|
||||||
|
"fkTableName": "salaries",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "titles",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "title",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 50,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "YES",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"title",
|
||||||
|
"from_date"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "titles_ibfk_1",
|
||||||
|
"fkTableName": "titles",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,466 @@
|
||||||
|
{
|
||||||
|
"tables": [
|
||||||
|
{
|
||||||
|
"name": "departments",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"type": "CHAR",
|
||||||
|
"size": 4,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_name",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 40,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "dept_name",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_name"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_emp",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"type": "CHAR",
|
||||||
|
"size": 4,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"isUniqueKey": false,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "dept_emp_ibfk_2",
|
||||||
|
"fkTableName": "dept_emp",
|
||||||
|
"fkColumnName": "dept_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "departments",
|
||||||
|
"pkColumnName": "dept_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fkName": "dept_emp_ibfk_1",
|
||||||
|
"fkTableName": "dept_emp",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_manager",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"type": "CHAR",
|
||||||
|
"size": 4,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"isUniqueKey": false,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "dept_manager_ibfk_2",
|
||||||
|
"fkTableName": "dept_manager",
|
||||||
|
"fkColumnName": "dept_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "departments",
|
||||||
|
"pkColumnName": "dept_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fkName": "dept_manager_ibfk_1",
|
||||||
|
"fkTableName": "dept_manager",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "employees",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "birth_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "first_name",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 14,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "last_name",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 16,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "gender",
|
||||||
|
"type": "ENUM",
|
||||||
|
"size": 1,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "hire_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "salaries",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "salary",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"from_date"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "salaries_ibfk_1",
|
||||||
|
"fkTableName": "salaries",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "titles",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "title",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 50,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "YES",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"title",
|
||||||
|
"from_date"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "titles_ibfk_1",
|
||||||
|
"fkTableName": "titles",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,466 @@
|
||||||
|
{
|
||||||
|
"tables": [
|
||||||
|
{
|
||||||
|
"name": "departments",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"type": "CHAR",
|
||||||
|
"size": 4,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_name",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 40,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "dept_name",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_name"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_emp",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"type": "CHAR",
|
||||||
|
"size": 4,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"isUniqueKey": false,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "dept_emp_ibfk_2",
|
||||||
|
"fkTableName": "dept_emp",
|
||||||
|
"fkColumnName": "dept_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "departments",
|
||||||
|
"pkColumnName": "dept_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fkName": "dept_emp_ibfk_1",
|
||||||
|
"fkTableName": "dept_emp",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_manager",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"type": "CHAR",
|
||||||
|
"size": 4,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"isUniqueKey": false,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "dept_manager_ibfk_2",
|
||||||
|
"fkTableName": "dept_manager",
|
||||||
|
"fkColumnName": "dept_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "departments",
|
||||||
|
"pkColumnName": "dept_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fkName": "dept_manager_ibfk_1",
|
||||||
|
"fkTableName": "dept_manager",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "employees",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "birth_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "first_name",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 14,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "last_name",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 16,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "gender",
|
||||||
|
"type": "ENUM",
|
||||||
|
"size": 1,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "hire_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "salaries",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "salary",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"from_date"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "salaries_ibfk_1",
|
||||||
|
"fkTableName": "salaries",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "titles",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "title",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 50,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "YES",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"title",
|
||||||
|
"from_date"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "titles_ibfk_1",
|
||||||
|
"fkTableName": "titles",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,466 @@
|
||||||
|
{
|
||||||
|
"tables": [
|
||||||
|
{
|
||||||
|
"name": "departments",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"type": "CHAR",
|
||||||
|
"size": 4,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_name",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 40,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "dept_name",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_name"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_emp",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"type": "CHAR",
|
||||||
|
"size": 4,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"isUniqueKey": false,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "dept_emp_ibfk_2",
|
||||||
|
"fkTableName": "dept_emp",
|
||||||
|
"fkColumnName": "dept_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "departments",
|
||||||
|
"pkColumnName": "dept_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fkName": "dept_emp_ibfk_1",
|
||||||
|
"fkTableName": "dept_emp",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_manager",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"type": "CHAR",
|
||||||
|
"size": 4,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"isUniqueKey": false,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "dept_manager_ibfk_2",
|
||||||
|
"fkTableName": "dept_manager",
|
||||||
|
"fkColumnName": "dept_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "departments",
|
||||||
|
"pkColumnName": "dept_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fkName": "dept_manager_ibfk_1",
|
||||||
|
"fkTableName": "dept_manager",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "employees",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "birth_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "first_name",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 14,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "last_name",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 16,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "gender",
|
||||||
|
"type": "ENUM",
|
||||||
|
"size": 1,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "hire_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "salaries",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "salary",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"from_date"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "salaries_ibfk_1",
|
||||||
|
"fkTableName": "salaries",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "titles",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "title",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 50,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "YES",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"title",
|
||||||
|
"from_date"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "titles_ibfk_1",
|
||||||
|
"fkTableName": "titles",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,328 @@
|
||||||
|
{
|
||||||
|
"tables": [
|
||||||
|
{
|
||||||
|
"name": "dept_manager",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"type": "CHAR",
|
||||||
|
"size": 4,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"isUniqueKey": false,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "dept_manager_ibfk_2",
|
||||||
|
"fkTableName": "dept_manager",
|
||||||
|
"fkColumnName": "dept_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "departments",
|
||||||
|
"pkColumnName": "dept_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fkName": "dept_manager_ibfk_1",
|
||||||
|
"fkTableName": "dept_manager",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "employees",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "birth_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "first_name",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 14,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "last_name",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 16,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "gender",
|
||||||
|
"type": "ENUM",
|
||||||
|
"size": 1,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "hire_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "salaries",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "salary",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"from_date"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "salaries_ibfk_1",
|
||||||
|
"fkTableName": "salaries",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "titles",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "title",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 50,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "YES",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"title",
|
||||||
|
"from_date"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "titles_ibfk_1",
|
||||||
|
"fkTableName": "titles",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,514 @@
|
||||||
|
{
|
||||||
|
"tables": [
|
||||||
|
{
|
||||||
|
"name": "departments",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"type": "CHAR",
|
||||||
|
"size": 4,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_name",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 40,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_code",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 40,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "deleted",
|
||||||
|
"type": "bool",
|
||||||
|
"size": 1,
|
||||||
|
"decimalDigits": 1,
|
||||||
|
"comment": "delete flag",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": 1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "dept_name",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_name"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_deleted",
|
||||||
|
"isUniqueKey": false,
|
||||||
|
"columnNames": [
|
||||||
|
"deleted"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "dept_emp_ibfk_1",
|
||||||
|
"fkTableName": "dept_emp",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": [
|
||||||
|
{
|
||||||
|
"name": "before_insert",
|
||||||
|
"timing": "BEFORE",
|
||||||
|
"manipulation": "INSERT",
|
||||||
|
"statement": "set null",
|
||||||
|
"createAt": "2022-01-01"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_emp",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"type": "CHAR",
|
||||||
|
"size": 4,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"isUniqueKey": false,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "dept_emp_ibfk_2",
|
||||||
|
"fkTableName": "dept_emp",
|
||||||
|
"fkColumnName": "dept_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "departments",
|
||||||
|
"pkColumnName": "dept_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fkName": "dept_emp_ibfk_1",
|
||||||
|
"fkTableName": "dept_emp",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_manager",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"type": "CHAR",
|
||||||
|
"size": 4,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"isUniqueKey": false,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "dept_manager_ibfk_2",
|
||||||
|
"fkTableName": "dept_manager",
|
||||||
|
"fkColumnName": "dept_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "departments",
|
||||||
|
"pkColumnName": "dept_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fkName": "dept_manager_ibfk_1",
|
||||||
|
"fkTableName": "dept_manager",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "employees",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "birth_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "first_name",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 14,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "last_name",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 16,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "gender",
|
||||||
|
"type": "ENUM",
|
||||||
|
"size": 1,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "hire_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "salaries",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "salary",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"from_date"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "salaries_ibfk_1",
|
||||||
|
"fkTableName": "salaries",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "titles",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "title",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 50,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "YES",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"title",
|
||||||
|
"from_date"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "titles_ibfk_1",
|
||||||
|
"fkTableName": "titles",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,466 @@
|
||||||
|
{
|
||||||
|
"tables": [
|
||||||
|
{
|
||||||
|
"name": "departments",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"type": "CHAR",
|
||||||
|
"size": 4,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_name",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 40,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "dept_name",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_name"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_emp",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"type": "CHAR",
|
||||||
|
"size": 4,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"isUniqueKey": false,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "dept_emp_ibfk_2",
|
||||||
|
"fkTableName": "dept_emp",
|
||||||
|
"fkColumnName": "dept_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "departments",
|
||||||
|
"pkColumnName": "dept_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fkName": "dept_emp_ibfk_1",
|
||||||
|
"fkTableName": "dept_emp",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_manager",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"type": "CHAR",
|
||||||
|
"size": 4,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"isUniqueKey": false,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "dept_manager_ibfk_2",
|
||||||
|
"fkTableName": "dept_manager",
|
||||||
|
"fkColumnName": "dept_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "departments",
|
||||||
|
"pkColumnName": "dept_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fkName": "dept_manager_ibfk_1",
|
||||||
|
"fkTableName": "dept_manager",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "employees",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "birth_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "first_name",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 14,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "last_name",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 16,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "gender",
|
||||||
|
"type": "ENUM",
|
||||||
|
"size": 1,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "hire_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "salaries",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "salary",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"from_date"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "salaries_ibfk_1",
|
||||||
|
"fkTableName": "salaries",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "titles",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "title",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 50,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "YES",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"title",
|
||||||
|
"from_date"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "titles_ibfk_1",
|
||||||
|
"fkTableName": "titles",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,474 @@
|
||||||
|
{
|
||||||
|
"tables": [
|
||||||
|
{
|
||||||
|
"name": "departments",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"type": "CHAR",
|
||||||
|
"size": 4,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "department unique no",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_name",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 40,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "department unique name",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "dept_name",
|
||||||
|
"isUniqueKey": false,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_name"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_emp",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": -1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"type": "CHAR",
|
||||||
|
"size": 4,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "YES",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "dept_emp_ibfk_2",
|
||||||
|
"fkTableName": "dept_emp",
|
||||||
|
"fkColumnName": "dept_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "departments",
|
||||||
|
"pkColumnName": "dept_no",
|
||||||
|
"updateRule": "NONE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fkName": "dept_emp_ibfk_1",
|
||||||
|
"fkTableName": "dept_emp",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": [
|
||||||
|
{
|
||||||
|
"name": "before_insert",
|
||||||
|
"timing": "AFTER",
|
||||||
|
"manipulation": "INSERT",
|
||||||
|
"statement": "set null",
|
||||||
|
"createAt": "2022-01-01"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_manager",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"type": "CHAR",
|
||||||
|
"size": 4,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"isUniqueKey": false,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "dept_manager_ibfk_2",
|
||||||
|
"fkTableName": "dept_manager",
|
||||||
|
"fkColumnName": "dept_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "departments",
|
||||||
|
"pkColumnName": "dept_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fkName": "dept_manager_ibfk_1",
|
||||||
|
"fkTableName": "dept_manager",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "employees",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "birth_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "first_name",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 14,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "last_name",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 16,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "gender",
|
||||||
|
"type": "ENUM",
|
||||||
|
"size": 1,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "hire_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "salaries",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "salary",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"from_date"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "salaries_ibfk_1",
|
||||||
|
"fkTableName": "salaries",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "titles",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "title",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 50,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "YES",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"title",
|
||||||
|
"from_date"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "titles_ibfk_1",
|
||||||
|
"fkTableName": "titles",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,472 @@
|
||||||
|
{
|
||||||
|
"tables": [
|
||||||
|
{
|
||||||
|
"name": "departments",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"type": "CHAR",
|
||||||
|
"size": 4,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_name",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 40,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "dept_name",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_name"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_emp",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"type": "CHAR",
|
||||||
|
"size": 4,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"isUniqueKey": false,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "dept_emp_ibfk_2",
|
||||||
|
"fkTableName": "dept_emp",
|
||||||
|
"fkColumnName": "dept_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "departments",
|
||||||
|
"pkColumnName": "dept_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fkName": "dept_emp_ibfk_1",
|
||||||
|
"fkTableName": "dept_emp",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": [{
|
||||||
|
"name": "before_insert",
|
||||||
|
"timing": "BEFORE",
|
||||||
|
"manipulation": "INSERT",
|
||||||
|
"statement": "set null",
|
||||||
|
"createAt": "2022-01-01"
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_manager",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"type": "CHAR",
|
||||||
|
"size": 4,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"isUniqueKey": false,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "dept_manager_ibfk_2",
|
||||||
|
"fkTableName": "dept_manager",
|
||||||
|
"fkColumnName": "dept_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "departments",
|
||||||
|
"pkColumnName": "dept_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fkName": "dept_manager_ibfk_1",
|
||||||
|
"fkTableName": "dept_manager",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "employees",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "birth_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "first_name",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 14,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "last_name",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 16,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "gender",
|
||||||
|
"type": "ENUM",
|
||||||
|
"size": 1,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "hire_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "salaries",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "salary",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"from_date"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "salaries_ibfk_1",
|
||||||
|
"fkTableName": "salaries",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "titles",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "title",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 50,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "YES",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"title",
|
||||||
|
"from_date"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "titles_ibfk_1",
|
||||||
|
"fkTableName": "titles",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,428 @@
|
||||||
|
{
|
||||||
|
"tables": [
|
||||||
|
{
|
||||||
|
"name": "departments",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"type": "CHAR",
|
||||||
|
"size": 4,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_name",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 40,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "dept_name",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_name"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_emp",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"type": "CHAR",
|
||||||
|
"size": 4,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "dept_emp_ibfk_1",
|
||||||
|
"fkTableName": "dept_emp",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_manager",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"type": "CHAR",
|
||||||
|
"size": 4,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"isUniqueKey": false,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "dept_manager_ibfk_2",
|
||||||
|
"fkTableName": "dept_manager",
|
||||||
|
"fkColumnName": "dept_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "departments",
|
||||||
|
"pkColumnName": "dept_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fkName": "dept_manager_ibfk_1",
|
||||||
|
"fkTableName": "dept_manager",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "employees",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "birth_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "first_name",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 14,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "last_name",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 16,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "gender",
|
||||||
|
"type": "ENUM",
|
||||||
|
"size": 1,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "hire_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "salaries",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "salary",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"from_date"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "salaries_ibfk_1",
|
||||||
|
"fkTableName": "salaries",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "titles",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "title",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 50,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "YES",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"title",
|
||||||
|
"from_date"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "titles_ibfk_1",
|
||||||
|
"fkTableName": "titles",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,474 @@
|
||||||
|
{
|
||||||
|
"tables": [
|
||||||
|
{
|
||||||
|
"name": "departments",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"type": "CHAR",
|
||||||
|
"size": 4,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_name",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 40,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "dept_name",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_name"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_emp",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"type": "CHAR",
|
||||||
|
"size": 4,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"isUniqueKey": false,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "dept_emp_ibfk_2",
|
||||||
|
"fkTableName": "dept_emp",
|
||||||
|
"fkColumnName": "dept_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "departments",
|
||||||
|
"pkColumnName": "dept_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fkName": "dept_emp_ibfk_1",
|
||||||
|
"fkTableName": "dept_emp",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": [
|
||||||
|
{
|
||||||
|
"name": "before_insert",
|
||||||
|
"timing": "BEFORE",
|
||||||
|
"manipulation": "INSERT",
|
||||||
|
"statement": "set null",
|
||||||
|
"createAt": "2022-01-01"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_manager",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"type": "CHAR",
|
||||||
|
"size": 4,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"isUniqueKey": false,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "dept_manager_ibfk_2",
|
||||||
|
"fkTableName": "dept_manager",
|
||||||
|
"fkColumnName": "dept_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "departments",
|
||||||
|
"pkColumnName": "dept_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fkName": "dept_manager_ibfk_1",
|
||||||
|
"fkTableName": "dept_manager",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "employees",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "birth_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "first_name",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 14,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "last_name",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 16,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "gender",
|
||||||
|
"type": "ENUM",
|
||||||
|
"size": 1,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "hire_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "salaries",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "salary",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"from_date"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "salaries_ibfk_1",
|
||||||
|
"fkTableName": "salaries",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "titles",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "title",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 50,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "YES",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"title",
|
||||||
|
"from_date"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "titles_ibfk_1",
|
||||||
|
"fkTableName": "titles",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,470 @@
|
||||||
|
{
|
||||||
|
"databaseName": "employees",
|
||||||
|
"schemaName": "employees",
|
||||||
|
"productName": "MySQL",
|
||||||
|
"productVersion": "9.0",
|
||||||
|
"tables": [
|
||||||
|
{
|
||||||
|
"name": "departments",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "部门信息",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"type": "CHAR",
|
||||||
|
"size": 4,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_name",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 40,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "dept_name",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_name"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_emp",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "员工部门关系",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"type": "CHAR",
|
||||||
|
"size": 4,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"isUniqueKey": false,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "dept_emp_ibfk_2",
|
||||||
|
"fkTableName": "dept_emp",
|
||||||
|
"fkColumnName": "dept_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "departments",
|
||||||
|
"pkColumnName": "dept_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fkName": "dept_emp_ibfk_1",
|
||||||
|
"fkTableName": "dept_emp",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_manager",
|
||||||
|
"type": "TABLE2",
|
||||||
|
"comment": "部门经理关系",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"type": "CHAR",
|
||||||
|
"size": 4,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"isUniqueKey": false,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "dept_manager_ibfk_2",
|
||||||
|
"fkTableName": "dept_manager",
|
||||||
|
"fkColumnName": "dept_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "departments",
|
||||||
|
"pkColumnName": "dept_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fkName": "dept_manager_ibfk_1",
|
||||||
|
"fkTableName": "dept_manager",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "employees",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "birth_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "first_name",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 14,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "last_name",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 16,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "gender",
|
||||||
|
"type": "ENUM",
|
||||||
|
"size": 1,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "hire_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "salaries",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "salary",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"from_date"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "salaries_ibfk_1",
|
||||||
|
"fkTableName": "salaries",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "titles",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "title",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 50,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "YES",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"title",
|
||||||
|
"from_date"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "titles_ibfk_1",
|
||||||
|
"fkTableName": "titles",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,470 @@
|
||||||
|
{
|
||||||
|
"databaseName": "employees",
|
||||||
|
"schemaName": "employees",
|
||||||
|
"productName": "MySQL",
|
||||||
|
"productVersion": "9.0",
|
||||||
|
"tables": [
|
||||||
|
{
|
||||||
|
"name": "departments",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"type": "CHAR",
|
||||||
|
"size": 4,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_name",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 40,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "dept_name",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_name"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_emp",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"type": "CHAR",
|
||||||
|
"size": 4,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"isUniqueKey": false,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "dept_emp_ibfk_2",
|
||||||
|
"fkTableName": "dept_emp",
|
||||||
|
"fkColumnName": "dept_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "departments",
|
||||||
|
"pkColumnName": "dept_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fkName": "dept_emp_ibfk_1",
|
||||||
|
"fkTableName": "dept_emp",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_manager",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"type": "CHAR",
|
||||||
|
"size": 4,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"isUniqueKey": false,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "dept_manager_ibfk_2",
|
||||||
|
"fkTableName": "dept_manager",
|
||||||
|
"fkColumnName": "dept_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "departments",
|
||||||
|
"pkColumnName": "dept_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fkName": "dept_manager_ibfk_1",
|
||||||
|
"fkTableName": "dept_manager",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "employees",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "birth_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "first_name",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 14,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "last_name",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 16,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "gender",
|
||||||
|
"type": "ENUM",
|
||||||
|
"size": 1,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "hire_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "salaries",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "salary",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"from_date"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "salaries_ibfk_1",
|
||||||
|
"fkTableName": "salaries",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "titles",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "title",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 50,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "YES",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"title",
|
||||||
|
"from_date"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "titles_ibfk_1",
|
||||||
|
"fkTableName": "titles",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,332 @@
|
||||||
|
{
|
||||||
|
"databaseName": "employees",
|
||||||
|
"schemaName": "employees",
|
||||||
|
"productName": "MySQL",
|
||||||
|
"productVersion": "9.0",
|
||||||
|
"tables": [
|
||||||
|
{
|
||||||
|
"name": "dept_manager",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"type": "CHAR",
|
||||||
|
"size": 4,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"isUniqueKey": false,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "dept_manager_ibfk_2",
|
||||||
|
"fkTableName": "dept_manager",
|
||||||
|
"fkColumnName": "dept_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "departments",
|
||||||
|
"pkColumnName": "dept_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fkName": "dept_manager_ibfk_1",
|
||||||
|
"fkTableName": "dept_manager",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "employees",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "birth_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "first_name",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 14,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "last_name",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 16,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "gender",
|
||||||
|
"type": "ENUM",
|
||||||
|
"size": 1,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "hire_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "salaries",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "salary",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"from_date"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "salaries_ibfk_1",
|
||||||
|
"fkTableName": "salaries",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "titles",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "title",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 50,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "YES",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"title",
|
||||||
|
"from_date"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "titles_ibfk_1",
|
||||||
|
"fkTableName": "titles",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,470 @@
|
||||||
|
{
|
||||||
|
"databaseName": "employees",
|
||||||
|
"schemaName": "employees",
|
||||||
|
"productName": "MySQL",
|
||||||
|
"productVersion": "9.0",
|
||||||
|
"tables": [
|
||||||
|
{
|
||||||
|
"name": "departments",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"type": "CHAR",
|
||||||
|
"size": 4,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_name",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 40,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "dept_name",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_name"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_emp",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"type": "CHAR",
|
||||||
|
"size": 4,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"isUniqueKey": false,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "dept_emp_ibfk_2",
|
||||||
|
"fkTableName": "dept_emp",
|
||||||
|
"fkColumnName": "dept_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "departments",
|
||||||
|
"pkColumnName": "dept_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fkName": "dept_emp_ibfk_1",
|
||||||
|
"fkTableName": "dept_emp",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_manager",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"type": "CHAR",
|
||||||
|
"size": 4,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "dept_no",
|
||||||
|
"isUniqueKey": false,
|
||||||
|
"columnNames": [
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"dept_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "dept_manager_ibfk_2",
|
||||||
|
"fkTableName": "dept_manager",
|
||||||
|
"fkColumnName": "dept_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "departments",
|
||||||
|
"pkColumnName": "dept_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fkName": "dept_manager_ibfk_1",
|
||||||
|
"fkTableName": "dept_manager",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "employees",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "birth_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "first_name",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 14,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "last_name",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 16,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "gender",
|
||||||
|
"type": "ENUM",
|
||||||
|
"size": 1,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "hire_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "salaries",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "salary",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"from_date"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "salaries_ibfk_1",
|
||||||
|
"fkTableName": "salaries",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "titles",
|
||||||
|
"type": "TABLE",
|
||||||
|
"comment": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "emp_no",
|
||||||
|
"type": "INT",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "title",
|
||||||
|
"type": "VARCHAR",
|
||||||
|
"size": 50,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "from_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": true,
|
||||||
|
"nullable": "NO",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "to_date",
|
||||||
|
"type": "DATE",
|
||||||
|
"size": 10,
|
||||||
|
"decimalDigits": null,
|
||||||
|
"comment": "",
|
||||||
|
"isPrimaryKey": false,
|
||||||
|
"nullable": "YES",
|
||||||
|
"autoIncrement": "NO",
|
||||||
|
"defaultValue": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
{
|
||||||
|
"name": "PRIMARY",
|
||||||
|
"isUniqueKey": true,
|
||||||
|
"columnNames": [
|
||||||
|
"emp_no",
|
||||||
|
"title",
|
||||||
|
"from_date"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"foreignKeys": [
|
||||||
|
{
|
||||||
|
"fkName": "titles_ibfk_1",
|
||||||
|
"fkTableName": "titles",
|
||||||
|
"fkColumnName": "emp_no",
|
||||||
|
"pkName": "PRIMARY",
|
||||||
|
"pkTableName": "employees",
|
||||||
|
"pkColumnName": "emp_no",
|
||||||
|
"updateRule": "CASCADE",
|
||||||
|
"deleteRule": "CASCADE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triggers": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
Loading…
Reference in New Issue