From 722fe556e3fd95262e41b76ba53374d7a6637619 Mon Sep 17 00:00:00 2001 From: piexlMax Date: Sun, 17 Dec 2023 17:40:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=88=9D=E5=A7=8B=E5=AD=97?= =?UTF-8?q?=E5=85=B8=E5=86=85=E5=AE=B9=EF=BC=8C=E5=85=BC=E5=AE=B9=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E5=8C=96=E4=BD=BF=E7=94=A8pgsql=E8=AF=BB=E5=8F=96?= =?UTF-8?q?=E8=A1=A8=E7=9A=84=E6=95=B0=E6=8D=AE=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/source/system/dictionary_detail.go | 48 +++++++++++++---------- 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/server/source/system/dictionary_detail.go b/server/source/system/dictionary_detail.go index 8fabfbcb..4ec234cd 100644 --- a/server/source/system/dictionary_detail.go +++ b/server/source/system/dictionary_detail.go @@ -55,40 +55,48 @@ func (i *initDictDetail) InitializeData(ctx context.Context) (context.Context, e } dicts[1].SysDictionaryDetails = []sysModel.SysDictionaryDetail{ - {Label: "smallint", Value: 1, Status: &True, Sort: 1}, - {Label: "mediumint", Value: 2, Status: &True, Sort: 2}, - {Label: "int", Value: 3, Status: &True, Sort: 3}, - {Label: "bigint", Value: 4, Status: &True, Sort: 4}, + {Label: "smallint", Value: 1, Status: &True, Extend: "mysql", Sort: 1}, + {Label: "mediumint", Value: 2, Status: &True, Extend: "mysql", Sort: 2}, + {Label: "int", Value: 3, Status: &True, Extend: "mysql", Sort: 3}, + {Label: "bigint", Value: 4, Status: &True, Extend: "mysql", Sort: 4}, + {Label: "int2", Value: 5, Status: &True, Extend: "pgsql", Sort: 5}, + {Label: "int4", Value: 6, Status: &True, Extend: "pgsql", Sort: 6}, + {Label: "int6", Value: 7, Status: &True, Extend: "pgsql", Sort: 7}, + {Label: "int8", Value: 8, Status: &True, Extend: "pgsql", Sort: 8}, } dicts[2].SysDictionaryDetails = []sysModel.SysDictionaryDetail{ {Label: "date", Status: &True}, - {Label: "time", Value: 1, Status: &True, Sort: 1}, - {Label: "year", Value: 2, Status: &True, Sort: 2}, - {Label: "datetime", Value: 3, Status: &True, Sort: 3}, - {Label: "timestamp", Value: 5, Status: &True, Sort: 5}, + {Label: "time", Value: 1, Status: &True, Extend: "mysql", Sort: 1}, + {Label: "year", Value: 2, Status: &True, Extend: "mysql", Sort: 2}, + {Label: "datetime", Value: 3, Status: &True, Extend: "mysql", Sort: 3}, + {Label: "timestamp", Value: 5, Status: &True, Extend: "mysql", Sort: 5}, + {Label: "timestamptz", Value: 6, Status: &True, Extend: "pgsql", Sort: 5}, } dicts[3].SysDictionaryDetails = []sysModel.SysDictionaryDetail{ {Label: "float", Status: &True}, - {Label: "double", Value: 1, Status: &True, Sort: 1}, - {Label: "decimal", Value: 2, Status: &True, Sort: 2}, + {Label: "double", Value: 1, Status: &True, Extend: "mysql", Sort: 1}, + {Label: "decimal", Value: 2, Status: &True, Extend: "mysql", Sort: 2}, + {Label: "numeric", Value: 3, Status: &True, Extend: "pgsql", Sort: 3}, + {Label: "smallserial", Value: 4, Status: &True, Extend: "pgsql", Sort: 4}, } dicts[4].SysDictionaryDetails = []sysModel.SysDictionaryDetail{ {Label: "char", Status: &True}, - {Label: "varchar", Value: 1, Status: &True, Sort: 1}, - {Label: "tinyblob", Value: 2, Status: &True, Sort: 2}, - {Label: "tinytext", Value: 3, Status: &True, Sort: 3}, - {Label: "text", Value: 4, Status: &True, Sort: 4}, - {Label: "blob", Value: 5, Status: &True, Sort: 5}, - {Label: "mediumblob", Value: 6, Status: &True, Sort: 6}, - {Label: "mediumtext", Value: 7, Status: &True, Sort: 7}, - {Label: "longblob", Value: 8, Status: &True, Sort: 8}, - {Label: "longtext", Value: 9, Status: &True, Sort: 9}, + {Label: "varchar", Value: 1, Status: &True, Extend: "mysql", Sort: 1}, + {Label: "tinyblob", Value: 2, Status: &True, Extend: "mysql", Sort: 2}, + {Label: "tinytext", Value: 3, Status: &True, Extend: "mysql", Sort: 3}, + {Label: "text", Value: 4, Status: &True, Extend: "mysql", Sort: 4}, + {Label: "blob", Value: 5, Status: &True, Extend: "mysql", Sort: 5}, + {Label: "mediumblob", Value: 6, Status: &True, Extend: "mysql", Sort: 6}, + {Label: "mediumtext", Value: 7, Status: &True, Extend: "mysql", Sort: 7}, + {Label: "longblob", Value: 8, Status: &True, Extend: "mysql", Sort: 8}, + {Label: "longtext", Value: 9, Status: &True, Extend: "mysql", Sort: 9}, } dicts[5].SysDictionaryDetails = []sysModel.SysDictionaryDetail{ - {Label: "tinyint", Status: &True}, + {Label: "tinyint", Value: 1, Extend: "mysql", Status: &True}, + {Label: "bool", Value: 2, Extend: "pgsql", Status: &True}, } for _, dict := range dicts { if err := db.Model(&dict).Association("SysDictionaryDetails").