Database diagrams editor that allows you to visualize and design your DB with a single query.
TypeScript databasedbdb-migrationeditorerdmariadbmssqlmysqlpostgresqlreactreact-flowschema-migrationssqlsqlitetypescriptvisualizationxyflow
feat(default value): add default value option to table field settings (#770)
Jonathan Fishnerc9ea7da0923f
diff --git a/src/i18n/locales/ar.ts b/src/i18n/locales/ar.tsindex 3d9bd443..92a8bdf4 100644--- a/src/i18n/locales/ar.ts+++ b/src/i18n/locales/ar.ts@@ -151,6 +151,8 @@ export const ar: LanguageTranslation = {delete_field: 'حذف الحقل',// TODO: Translatecharacter_length: 'Max Length',+ default_value: 'Default Value',+ no_default: 'No default',},index_actions: {title: 'خصائص الفهرس',diff --git a/src/i18n/locales/bn.ts b/src/i18n/locales/bn.tsindex b9f10ae7..27f3bbc9 100644--- a/src/i18n/locales/bn.ts+++ b/src/i18n/locales/bn.ts@@ -151,6 +151,9 @@ export const bn: LanguageTranslation = {no_comments: 'কোনো মন্তব্য নেই',delete_field: 'ফিল্ড মুছুন',// TODO: Translate+ default_value: 'Default Value',+ no_default: 'No default',+ // TODO: Translatecharacter_length: 'Max Length',},index_actions: {diff --git a/src/i18n/locales/de.ts b/src/i18n/locales/de.tsindex 1f90cb7a..0ed4f099 100644--- a/src/i18n/locales/de.ts+++ b/src/i18n/locales/de.ts@@ -152,6 +152,9 @@ export const de: LanguageTranslation = {no_comments: 'Keine Kommentare',delete_field: 'Feld löschen',// TODO: Translate+ default_value: 'Default Value',+ no_default: 'No default',+ // TODO: Translatecharacter_length: 'Max Length',},index_actions: {diff --git a/src/i18n/locales/en.ts b/src/i18n/locales/en.tsindex 6929bde0..de3684fb 100644--- a/src/i18n/locales/en.ts+++ b/src/i18n/locales/en.ts@@ -146,6 +146,8 @@ export const en = {character_length: 'Max Length',comments: 'Comments',no_comments: 'No comments',+ default_value: 'Default Value',+ no_default: 'No default',delete_field: 'Delete Field',},index_actions: {diff --git a/src/i18n/locales/es.ts b/src/i18n/locales/es.tsindex 82d37c54..86d8833b 100644--- a/src/i18n/locales/es.ts+++ b/src/i18n/locales/es.ts@@ -141,6 +141,9 @@ export const es: LanguageTranslation = {no_comments: 'Sin comentarios',delete_field: 'Eliminar Campo',// TODO: Translate+ default_value: 'Default Value',+ no_default: 'No default',+ // TODO: Translatecharacter_length: 'Max Length',},index_actions: {diff --git a/src/i18n/locales/fr.ts b/src/i18n/locales/fr.tsindex ecad8690..04a1895e 100644--- a/src/i18n/locales/fr.ts+++ b/src/i18n/locales/fr.ts@@ -139,6 +139,9 @@ export const fr: LanguageTranslation = {no_comments: 'Pas de commentaires',delete_field: 'Supprimer le Champ',// TODO: Translate+ default_value: 'Default Value',+ no_default: 'No default',+ // TODO: Translatecharacter_length: 'Max Length',},index_actions: {diff --git a/src/i18n/locales/gu.ts b/src/i18n/locales/gu.tsindex ce149946..8939be5e 100644--- a/src/i18n/locales/gu.ts+++ b/src/i18n/locales/gu.ts@@ -152,6 +152,9 @@ export const gu: LanguageTranslation = {no_comments: 'કોઈ ટિપ્પણીઓ નથી',delete_field: 'ફીલ્ડ કાઢી નાખો',// TODO: Translate+ default_value: 'Default Value',+ no_default: 'No default',+ // TODO: Translatecharacter_length: 'Max Length',},index_actions: {diff --git a/src/i18n/locales/hi.ts b/src/i18n/locales/hi.tsindex 114d6e78..a6af6296 100644--- a/src/i18n/locales/hi.ts+++ b/src/i18n/locales/hi.ts@@ -151,6 +151,9 @@ export const hi: LanguageTranslation = {no_comments: 'कोई टिप्पणी नहीं',delete_field: 'फ़ील्ड हटाएँ',// TODO: Translate+ default_value: 'Default Value',+ no_default: 'No default',+ // TODO: Translatecharacter_length: 'Max Length',},index_actions: {diff --git a/src/i18n/locales/id_ID.ts b/src/i18n/locales/id_ID.tsindex 8ef48ef9..28842140 100644--- a/src/i18n/locales/id_ID.ts+++ b/src/i18n/locales/id_ID.ts@@ -150,6 +150,9 @@ export const id_ID: LanguageTranslation = {no_comments: 'Tidak ada komentar',delete_field: 'Hapus Kolom',// TODO: Translate+ default_value: 'Default Value',+ no_default: 'No default',+ // TODO: Translatecharacter_length: 'Max Length',},index_actions: {diff --git a/src/i18n/locales/ja.ts b/src/i18n/locales/ja.tsindex 73fd34bb..f9d130bd 100644--- a/src/i18n/locales/ja.ts+++ b/src/i18n/locales/ja.ts@@ -154,6 +154,9 @@ export const ja: LanguageTranslation = {no_comments: 'コメントがありません',delete_field: 'フィールドを削除',// TODO: Translate+ default_value: 'Default Value',+ no_default: 'No default',+ // TODO: Translatecharacter_length: 'Max Length',},index_actions: {diff --git a/src/i18n/locales/ko_KR.ts b/src/i18n/locales/ko_KR.tsindex d4c8af97..2dc0fe1b 100644--- a/src/i18n/locales/ko_KR.ts+++ b/src/i18n/locales/ko_KR.ts@@ -150,6 +150,9 @@ export const ko_KR: LanguageTranslation = {no_comments: '주석 없음',delete_field: '필드 삭제',// TODO: Translate+ default_value: 'Default Value',+ no_default: 'No default',+ // TODO: Translatecharacter_length: 'Max Length',},index_actions: {diff --git a/src/i18n/locales/mr.ts b/src/i18n/locales/mr.tsindex c59cbeb0..f8e6dc82 100644--- a/src/i18n/locales/mr.ts+++ b/src/i18n/locales/mr.ts@@ -153,6 +153,9 @@ export const mr: LanguageTranslation = {no_comments: 'कोणत्याही टिप्पणी नाहीत',delete_field: 'फील्ड हटवा',// TODO: Translate+ default_value: 'Default Value',+ no_default: 'No default',+ // TODO: Translatecharacter_length: 'Max Length',},index_actions: {diff --git a/src/i18n/locales/ne.ts b/src/i18n/locales/ne.tsindex 9f283b20..8ace4e0d 100644--- a/src/i18n/locales/ne.ts+++ b/src/i18n/locales/ne.ts@@ -151,6 +151,9 @@ export const ne: LanguageTranslation = {no_comments: 'कुनै टिप्पणीहरू छैनन्',delete_field: 'क्षेत्र हटाउनुहोस्',// TODO: Translate+ default_value: 'Default Value',+ no_default: 'No default',+ // TODO: Translatecharacter_length: 'Max Length',},index_actions: {diff --git a/src/i18n/locales/pt_BR.ts b/src/i18n/locales/pt_BR.tsindex 78a1c092..b35dfb03 100644--- a/src/i18n/locales/pt_BR.ts+++ b/src/i18n/locales/pt_BR.ts@@ -151,6 +151,9 @@ export const pt_BR: LanguageTranslation = {no_comments: 'Sem comentários',delete_field: 'Excluir Campo',// TODO: Translate+ default_value: 'Default Value',+ no_default: 'No default',+ // TODO: Translatecharacter_length: 'Max Length',},index_actions: {diff --git a/src/i18n/locales/ru.ts b/src/i18n/locales/ru.tsindex 37e6be58..0b13a855 100644--- a/src/i18n/locales/ru.ts+++ b/src/i18n/locales/ru.ts@@ -147,6 +147,9 @@ export const ru: LanguageTranslation = {comments: 'Комментарии',no_comments: 'Нет комментария',delete_field: 'Удалить поле',+ // TODO: Translate+ default_value: 'Default Value',+ no_default: 'No default',character_length: 'Макс. длина',},index_actions: {diff --git a/src/i18n/locales/te.ts b/src/i18n/locales/te.tsindex 2bc3acc0..f240b9fa 100644--- a/src/i18n/locales/te.ts+++ b/src/i18n/locales/te.ts@@ -151,6 +151,9 @@ export const te: LanguageTranslation = {no_comments: 'వ్యాఖ్యలు లేవు',delete_field: 'ఫీల్డ్ తొలగించు',// TODO: Translate+ default_value: 'Default Value',+ no_default: 'No default',+ // TODO: Translatecharacter_length: 'Max Length',},index_actions: {diff --git a/src/i18n/locales/tr.ts b/src/i18n/locales/tr.tsindex 624a1be5..2a699c0f 100644--- a/src/i18n/locales/tr.ts+++ b/src/i18n/locales/tr.ts@@ -150,6 +150,9 @@ export const tr: LanguageTranslation = {no_comments: 'Yorum yok',delete_field: 'Alanı Sil',// TODO: Translate+ default_value: 'Default Value',+ no_default: 'No default',+ // TODO: Translatecharacter_length: 'Max Length',},index_actions: {diff --git a/src/i18n/locales/uk.ts b/src/i18n/locales/uk.tsindex 680d0818..602ebd75 100644--- a/src/i18n/locales/uk.ts+++ b/src/i18n/locales/uk.ts@@ -149,6 +149,9 @@ export const uk: LanguageTranslation = {no_comments: 'Немає коментарів',delete_field: 'Видалити поле',// TODO: Translate+ default_value: 'Default Value',+ no_default: 'No default',+ // TODO: Translatecharacter_length: 'Max Length',},index_actions: {diff --git a/src/i18n/locales/vi.ts b/src/i18n/locales/vi.tsindex 3cd4a197..21b88721 100644--- a/src/i18n/locales/vi.ts+++ b/src/i18n/locales/vi.ts@@ -150,6 +150,9 @@ export const vi: LanguageTranslation = {no_comments: 'Không có bình luận',delete_field: 'Xóa trường',// TODO: Translate+ default_value: 'Default Value',+ no_default: 'No default',+ // TODO: Translatecharacter_length: 'Max Length',},index_actions: {diff --git a/src/i18n/locales/zh_CN.ts b/src/i18n/locales/zh_CN.tsindex b82c45cb..5d5ebb79 100644--- a/src/i18n/locales/zh_CN.ts+++ b/src/i18n/locales/zh_CN.ts@@ -147,6 +147,9 @@ export const zh_CN: LanguageTranslation = {no_comments: '空',delete_field: '删除字段',// TODO: Translate+ default_value: 'Default Value',+ no_default: 'No default',+ // TODO: Translatecharacter_length: 'Max Length',},index_actions: {diff --git a/src/i18n/locales/zh_TW.ts b/src/i18n/locales/zh_TW.tsindex e95cd2d9..dafd2059 100644--- a/src/i18n/locales/zh_TW.ts+++ b/src/i18n/locales/zh_TW.ts@@ -147,6 +147,9 @@ export const zh_TW: LanguageTranslation = {no_comments: '無註解',delete_field: '刪除欄位',// TODO: Translate+ default_value: 'Default Value',+ no_default: 'No default',+ // TODO: Translatecharacter_length: 'Max Length',},index_actions: {diff --git a/src/pages/editor-page/side-panel/tables-section/table-list/table-list-item/table-list-item-content/table-field/table-field-modal/table-field-modal.tsx b/src/pages/editor-page/side-panel/tables-section/table-list/table-list-item/table-list-item-content/table-field/table-field-modal/table-field-modal.tsxindex 3be50130..2144ff66 100644--- a/src/pages/editor-page/side-panel/tables-section/table-list/table-list-item/table-list-item-content/table-field/table-field-modal/table-field-modal.tsx+++ b/src/pages/editor-page/side-panel/tables-section/table-list/table-list-item/table-list-item-content/table-field/table-field-modal/table-field-modal.tsx@@ -53,6 +53,7 @@ export const TableFieldPopover: React.FC<TableFieldPopoverProps> = ({comments: localField.comments,characterMaximumLength: localField.characterMaximumLength,unique: localField.unique,+ default: localField.default,});}prevFieldRef.current = localField;@@ -102,6 +103,26 @@ export const TableFieldPopover: React.FC<TableFieldPopoverProps> = ({}/></div>+ <div className="flex flex-col gap-2">+ <Label htmlFor="default" className="text-subtitle">+ {t(+ 'side_panel.tables_section.table.field_actions.default_value'+ )}+ </Label>+ <Input+ value={localField.default ?? ''}+ onChange={(e) =>+ setLocalField((current) => ({+ ...current,+ default: e.target.value || null,+ }))+ }+ placeholder={t(+ 'side_panel.tables_section.table.field_actions.no_default'+ )}+ className="w-full rounded-md bg-muted text-sm"+ />+ </div>{findDataTypeDataById(field.type.id)?.hasCharMaxLength ? (<div className="flex flex-col gap-2">