diff --git a/src/common/customizations/postgresql.js b/src/common/customizations/postgresql.js index f75724e5..076def7c 100644 --- a/src/common/customizations/postgresql.js +++ b/src/common/customizations/postgresql.js @@ -22,7 +22,7 @@ module.exports = { viewAdd: true, triggerAdd: false, routineAdd: true, - functionAdd: true, + functionAdd: false, databaseEdit: false, tableSettings: true, viewSettings: true, diff --git a/src/common/fieldTypes.js b/src/common/fieldTypes.js index 5ae03e3f..011c9939 100644 --- a/src/common/fieldTypes.js +++ b/src/common/fieldTypes.js @@ -54,6 +54,7 @@ export const TIME = [ 'TIME', 'TIME WITH TIME ZONE' ]; + export const DATETIME = [ 'DATETIME', 'TIMESTAMP', @@ -61,6 +62,12 @@ export const DATETIME = [ 'TIMESTAMP WITH TIME ZONE' ]; +// Used to check datetime fields only +export const HAS_TIMEZONE = [ + 'TIMESTAMP WITH TIME ZONE', + 'TIME WITH TIME ZONE' +]; + export const BLOB = [ 'BLOB', 'TINYBLOB', diff --git a/src/renderer/components/WorkspaceQueryTableRow.vue b/src/renderer/components/WorkspaceQueryTableRow.vue index 7ef4b275..2f9b2a57 100644 --- a/src/renderer/components/WorkspaceQueryTableRow.vue +++ b/src/renderer/components/WorkspaceQueryTableRow.vue @@ -182,7 +182,7 @@ import { mimeFromHex } from 'common/libs/mimeFromHex'; import { formatBytes } from 'common/libs/formatBytes'; import { bufferToBase64 } from 'common/libs/bufferToBase64'; import hexToBinary from 'common/libs/hexToBinary'; -import { TEXT, LONG_TEXT, ARRAY, TEXT_SEARCH, NUMBER, FLOAT, BOOLEAN, DATE, TIME, DATETIME, BLOB, BIT } from 'common/fieldTypes'; +import { TEXT, LONG_TEXT, ARRAY, TEXT_SEARCH, NUMBER, FLOAT, BOOLEAN, DATE, TIME, DATETIME, BLOB, BIT, HAS_TIMEZONE } from 'common/fieldTypes'; import { VueMaskDirective } from 'v-mask'; import ConfirmModal from '@/components/BaseConfirmModal'; import TextEditor from '@/components/BaseTextEditor'; @@ -286,6 +286,9 @@ export default { for (let i = 0; i < precision; i++) timeMask += i === 0 ? '.#' : '#'; + if (HAS_TIMEZONE.includes(this.editingType)) + timeMask += 'X##'; + return { type: 'text', mask: timeMask }; } @@ -299,6 +302,9 @@ export default { for (let i = 0; i < precision; i++) datetimeMask += i === 0 ? '.#' : '#'; + if (HAS_TIMEZONE.includes(this.editingType)) + datetimeMask += 'X##'; + return { type: 'text', mask: datetimeMask }; }