Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
Revert "feat: add a promot for altering snowflake engine"
Tianzhou89bc699489d6
diff --git a/frontend/src/components/IssueSidebar.vue b/frontend/src/components/IssueSidebar.vueindex a662fa7e12..2015308b7b 100644--- a/frontend/src/components/IssueSidebar.vue+++ b/frontend/src/components/IssueSidebar.vue@@ -191,7 +191,7 @@</template><script lang="ts">-import { computed, ComputedRef, PropType, reactive } from "vue";+import { computed, PropType, reactive } from "vue";import { useStore } from "vuex";import isEqual from "lodash-es/isEqual";import DatabaseSelect from "../components/DatabaseSelect.vue";@@ -253,14 +253,6 @@ export default {required: true,type: Boolean,},- database: {- required: true,- type: Object as PropType<ComputedRef<Database> | ComputedRef<undefined>>,- },- instance: {- required: true,- type: Object as PropType<ComputedRef<Instance>>,- },},components: {DatabaseSelect,@@ -285,9 +277,24 @@ export default {return props.issue.payload[field.id];};+ const database = computed((): Database | undefined => {+ if (props.create) {+ const stage = props.selectedStage as StageCreate;+ if (stage.taskList[0].databaseId) {+ return store.getters["database/databaseById"](+ stage.taskList[0].databaseId+ );+ }+ return undefined;+ }++ const stage = props.selectedStage as Stage;+ return stage.taskList[0].database;+ });+const databaseName = computed((): string | undefined => {- if (props.database.value) {- return props.database.value.name;+ if (database.value) {+ return database.value.name;}const stage = props.selectedStage as Stage;@@ -306,6 +313,22 @@ export default {return undefined;});+ const instance = computed((): Instance => {+ if (props.create) {+ // If database is available, then we derive the instance from database because we always fetch database's instance.+ // On the other hand, instance for stage.taskList[0].instanceId might not be loaded (e.g. when creating an update schema issue)+ if (database.value) {+ return database.value.instance;+ }+ const stage = props.selectedStage as StageCreate;+ return store.getters["instance/instanceById"](+ stage.taskList[0].instanceId+ );+ }+ const stage = props.selectedStage as Stage;+ return stage.taskList[0].instance;+ });+const environment = computed((): Environment => {if (props.create) {const stage = props.selectedStage as StageCreate;@@ -381,19 +404,16 @@ export default {});const clickDatabase = () => {- if (props.database.value) {+ if (database.value) {router.push({name: "workspace.database.detail",params: {- databaseSlug: databaseSlug(props.database.value),+ databaseSlug: databaseSlug(database.value),},});} else {store- .dispatch(- "database/fetchDatabaseListByInstanceId",- props.instance.value.id- )+ .dispatch("database/fetchDatabaseListByInstanceId", instance.value.id).then((list: Database[]) => {for (const database of list) {if (database.name == databaseName.value) {@@ -415,6 +435,8 @@ export default {state,fieldValue,environment,+ instance,+ database,databaseName,project,showInstance,diff --git a/frontend/src/components/IssueTaskStatementPanel.vue b/frontend/src/components/IssueTaskStatementPanel.vueindex 6a395160bc..083f153b50 100644--- a/frontend/src/components/IssueTaskStatementPanel.vue+++ b/frontend/src/components/IssueTaskStatementPanel.vue@@ -11,7 +11,6 @@>{{ rollback ? "Rollback SQL" : "SQL" }}<span v-if="create && !rollback" class="text-red-600">*</span>- <span class="text-accent">{{ hintForSQL }}</span><spanv-if="!create && !rollback && migrationType == 'BASELINE'"class="text-accent"@@ -194,10 +193,6 @@ export default {required: true,type: Boolean,},- hintForSQL: {- required: false,- type: String,- },},components: {},setup(props, { emit }) {diff --git a/frontend/src/views/IssueDetail.vue b/frontend/src/views/IssueDetail.vueindex a58d67d169..8f900dd362 100644--- a/frontend/src/views/IssueDetail.vue+++ b/frontend/src/views/IssueDetail.vue@@ -123,8 +123,6 @@><IssueSidebar:issue="issue"- :database="database"- :instance="instance":create="state.create":selectedStage="selectedStage":inputFieldList="issueTemplate.inputFieldList"@@ -152,7 +150,6 @@list every IssueTaskStatementPanel for each stage and use v-if to show the active one. --><template v-if="state.create"><IssueTaskStatementPanel- :hintForSQL="hintForSQL":statement="selectedStatement":create="state.create":allowEdit="true"@@ -170,7 +167,6 @@><template v-if="selectedStage.id == stage.id"><IssueTaskStatementPanel- :hintForSQL="hintForSQL":statement="statement(stage)":create="state.create":allowEdit="allowEditStatement"@@ -251,7 +247,6 @@ import {watchEffect,reactive,ref,- ComputedRef,} from "vue";import { useStore } from "vuex";import { useRouter } from "vue-router";@@ -286,7 +281,6 @@ import {IssuePatch,PrincipalId,Database,- Instance,Environment,Stage,StageId,@@ -1177,50 +1171,9 @@ export default {return count > 1;});- const database = computed((): Database | undefined => {- const temp = selectedStage as unknown;- if (create) {- const stage = temp as ComputedRef<StageCreate>;- const databaseId = stage.value.taskList[0].databaseId;- if (databaseId) {- return store.getters["database/databaseById"](databaseId);- }-- return undefined;- }- const stage = temp as ComputedRef<Stage>;- return stage.value.taskList[0].database;- });-- const instance = computed((): Instance => {- const temp = selectedStage as unknown;- if (create) {- // If database is available, then we derive the instance from database because we always fetch database's instance.- // On the other hand, instance for stage.taskList[0].instanceId might not be loaded (e.g. when creating an update schema issue)- if (database.value) {- return database.value.instance;- }- const stage = temp as StageCreate;- return store.getters["instance/instanceById"](- stage.taskList[0].instanceId- );- }- const stage = temp as Stage;- return stage.taskList[0].instance;- });-- const hintForSQL = computed(() => {- return instance.value.engine === "SNOWFLAKE"- ? ` your are altering a snowflake database, please add <schema> before each tabel altered`- : "";- });-return {state,issue,- database,- instance,- hintForSQL,updateName,updateDescription,updateStatement,