|
@@ -17,8 +17,8 @@ class SchemaChange extends Component {
|
|
|
columns: props.columns,
|
|
columns: props.columns,
|
|
|
newColName: '',
|
|
newColName: '',
|
|
|
newColType: 'type',
|
|
newColType: 'type',
|
|
|
- types: ['ID', 'String', 'Int', 'Float'],
|
|
|
|
|
- descriptions: ['description', 'key', 'non-null', 'non-null-list']
|
|
|
|
|
|
|
+ types: ['ID', 'String', 'Int', 'Float','Boolean', 'DateTime'],
|
|
|
|
|
+ descriptions: ['description', 'key', 'non-null', 'non-null-list', 'list']
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -227,11 +227,6 @@ class UpdateTableButton extends Component {
|
|
|
|
|
|
|
|
data.schema_by_id = update_schema;
|
|
data.schema_by_id = update_schema;
|
|
|
|
|
|
|
|
- if (update_schema === null) {
|
|
|
|
|
- console.log('你是否忘记了修改 Schenma 组件中的 this.state.schemaID? ');
|
|
|
|
|
- console.log('所以报错 : TypeError: Cannot read property "schemaName" of null');
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
let showSchemaData = cache.readQuery({
|
|
let showSchemaData = cache.readQuery({
|
|
|
query: SHOW_SCHEMA,
|
|
query: SHOW_SCHEMA,
|
|
|
variables: {user_id: userID}
|
|
variables: {user_id: userID}
|
|
@@ -267,10 +262,19 @@ class UpdateTableButton extends Component {
|
|
|
let schemaCols;
|
|
let schemaCols;
|
|
|
if (schemaData.schema_by_id === null) schemaCols = [];
|
|
if (schemaData.schema_by_id === null) schemaCols = [];
|
|
|
else schemaCols = JSON.parse(schemaData.schema_by_id.schemaData);
|
|
else schemaCols = JSON.parse(schemaData.schema_by_id.schemaData);
|
|
|
|
|
+
|
|
|
|
|
+ // 处理一下description的问题
|
|
|
|
|
+ let cols = this.props.columns;
|
|
|
|
|
+ cols.map(obj=> {
|
|
|
|
|
+ if (obj.description === 'description')
|
|
|
|
|
+ obj.description = '';
|
|
|
|
|
+ return obj
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
let newTable = {
|
|
let newTable = {
|
|
|
name: this.props.currentTable,
|
|
name: this.props.currentTable,
|
|
|
remark: this.props.remark,
|
|
remark: this.props.remark,
|
|
|
- cols: this.props.columns
|
|
|
|
|
|
|
+ cols
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const index = this.props.currentTableIndex;
|
|
const index = this.props.currentTableIndex;
|
|
@@ -301,7 +305,6 @@ class UpdateTableButton extends Component {
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
</Query>
|
|
</Query>
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|