mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-15 09:22:43 +03:00
This commit is contained in:
parent
5916b97b86
commit
40c391df09
@ -38,7 +38,6 @@ class Main extends React.Component {
|
|||||||
let isUpdateAvailable = false;
|
let isUpdateAvailable = false;
|
||||||
try {
|
try {
|
||||||
const showEvents = semverCheck('eventsTab', this.props.serverVersion);
|
const showEvents = semverCheck('eventsTab', this.props.serverVersion);
|
||||||
console.log(showEvents);
|
|
||||||
if (showEvents) {
|
if (showEvents) {
|
||||||
this.setState({ showEvents: true });
|
this.setState({ showEvents: true });
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,7 @@ const DataHeader = ({
|
|||||||
className={styles.schemaBorder}
|
className={styles.schemaBorder}
|
||||||
to={appPrefix + '/schema'}
|
to={appPrefix + '/schema'}
|
||||||
>
|
>
|
||||||
Schema
|
Schema - {currentSchema}
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -34,7 +34,7 @@ const executeSQL = isMigration => (dispatch, getState) => {
|
|||||||
const currMigrationMode = getState().main.migrationMode;
|
const currMigrationMode = getState().main.migrationMode;
|
||||||
|
|
||||||
const migrateUrl = returnMigrateUrl(currMigrationMode);
|
const migrateUrl = returnMigrateUrl(currMigrationMode);
|
||||||
const currentSchema = getState().tables.currentSchema;
|
let currentSchema = 'public';
|
||||||
const isCascadeChecked = getState().rawSQL.isCascadeChecked;
|
const isCascadeChecked = getState().rawSQL.isCascadeChecked;
|
||||||
|
|
||||||
let url = Endpoints.rawSQL;
|
let url = Endpoints.rawSQL;
|
||||||
@ -46,11 +46,18 @@ const executeSQL = isMigration => (dispatch, getState) => {
|
|||||||
];
|
];
|
||||||
// check if track view enabled
|
// check if track view enabled
|
||||||
if (getState().rawSQL.isTableTrackChecked) {
|
if (getState().rawSQL.isTableTrackChecked) {
|
||||||
const regExp = /create (view|table) (\S+)/i;
|
const regExp = /create (view|table) ((\S+)\.(\S+)|(\S+))/i;
|
||||||
const matches = sql.match(regExp);
|
const matches = sql.match(regExp);
|
||||||
let trackViewName = matches ? matches[2] : '';
|
// If group 5 is undefined, use group 3 and 4 for schema and table respectively
|
||||||
if (trackViewName.indexOf('.') !== -1) {
|
// If group 5 is present, use group 5 for table name using public schema.
|
||||||
trackViewName = matches[2].split('.')[1];
|
let trackViewName = '';
|
||||||
|
if (matches && matches.length === 6) {
|
||||||
|
if (matches[5]) {
|
||||||
|
trackViewName = matches[5];
|
||||||
|
} else {
|
||||||
|
currentSchema = matches[3].replace(/['"]+/g, '');
|
||||||
|
trackViewName = matches[4];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
trackViewName = trackViewName.replace(/['"]+/g, ''); // replace quotes
|
trackViewName = trackViewName.replace(/['"]+/g, ''); // replace quotes
|
||||||
const trackQuery = {
|
const trackQuery = {
|
||||||
|
Loading…
Reference in New Issue
Block a user