Skip to content

Commit b07d04a

Browse files
karthikvt26shahidhk
authored andcommitted
configuration list is alphabetical, add note in sql tab for down migrations (close hasura#616) (close hasura#617)
1 parent 408b943 commit b07d04a

File tree

4 files changed

+38
-3
lines changed

4 files changed

+38
-3
lines changed

console/src/components/Services/Data/DataActions.js

+19-2
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ const fetchSchemaList = () => (dispatch, getState) => {
4848
schema: 'information_schema',
4949
},
5050
columns: ['schema_name'],
51+
order_by: [{ column: 'schema_name', type: 'asc', nulls: 'last' }],
5152
where: {
5253
schema_name: {
5354
$nin: [
@@ -85,8 +86,16 @@ const loadSchema = () => (dispatch, getState) => {
8586
name: 'hdb_table',
8687
schema: 'hdb_catalog',
8788
},
88-
columns: ['*.*'],
89+
columns: [
90+
'*.*',
91+
{
92+
name: 'columns',
93+
columns: ['*.*'],
94+
order_by: [{ column: 'column_name', type: 'asc', nulls: 'last' }],
95+
},
96+
],
8997
where: { table_schema: currentSchema },
98+
order_by: [{ column: 'table_name', type: 'asc', nulls: 'last' }],
9099
},
91100
}),
92101
};
@@ -319,8 +328,16 @@ const fetchTableListBySchema = schemaName => (dispatch, getState) => {
319328
name: 'hdb_table',
320329
schema: 'hdb_catalog',
321330
},
322-
columns: ['*.*'],
331+
columns: [
332+
'*.*',
333+
{
334+
name: 'columns',
335+
columns: ['*.*'],
336+
order_by: [{ column: 'column_name', type: 'asc', nulls: 'last' }],
337+
},
338+
],
323339
where: { table_schema: schemaName },
340+
order_by: [{ column: 'table_name', type: 'asc', nulls: 'last' }],
324341
},
325342
}),
326343
};

console/src/components/Services/Data/RawSQL/RawSQL.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,9 @@ const RawSQL = ({
100100
));
101101
const rows = result.map((row, i) => (
102102
<tr key={i}>
103-
{row.map((columnValue, j) => <td key={j}>{columnValue}</td>)}
103+
{row.map((columnValue, j) => (
104+
<td key={j}>{columnValue}</td>
105+
))}
104106
</tr>
105107
));
106108
return !resultType || resultType === 'command' ? null : (
@@ -163,6 +165,11 @@ const RawSQL = ({
163165
</Link>{' '}
164166
functionality.
165167
</li>
168+
<li>
169+
Please note that if the migrations are enabled,
170+
<code>down</code>
171+
migrations will not be generated for SQL statements.
172+
</li>
166173
</ul>
167174
</div>
168175
<hr />

console/src/components/Services/Data/TableCommon/Table.scss

+6
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
padding: 0;
44
}
55

6+
.migration_disclaimer {
7+
font-size: 12px;
8+
margin-left: 10px;
9+
margin-top: 10px;
10+
color: rgb(236, 61, 61);
11+
}
612
.tableContainer {
713
overflow: auto;
814
//margin-top: 25px;

console/src/components/Services/Data/TableRelationships/AddManualRelationship.js

+5
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
relManualAddClicked,
1010
relTypeChange,
1111
addRelViewMigrate,
12+
REL_SET_MANUAL_COLUMNS,
1213
} from './Actions';
1314
import {
1415
fetchTableListBySchema,
@@ -47,6 +48,10 @@ class AddManualRelationship extends Component {
4748
type: UPDATE_REMOTE_SCHEMA_MANUAL_REL,
4849
data: e.target.value,
4950
});
51+
this.props.dispatch({
52+
type: REL_SET_MANUAL_COLUMNS,
53+
data: [],
54+
});
5055
this.props.dispatch(fetchTableListBySchema(e.target.value));
5156
}
5257
onRelNameChange(e) {

0 commit comments

Comments
 (0)