Bugs Fixed
Some checks are pending
CI / Test (1.23) (push) Waiting to run
CI / Test (1.24) (push) Waiting to run
CI / Test (1.25) (push) Waiting to run
CI / Lint (push) Waiting to run
CI / Build (push) Waiting to run

1. pkg/models/models.go:184 - Fixed typo in ForeignKeyConstraint constant from "foreign_Key" to "foreign_key"
  2. pkg/readers/drawdb/reader.go:62-68 - Fixed ReadSchema() to properly detect schema name from tables instead of hardcoding "default"
  3. pkg/writers/dbml/writer.go:128 - Changed primary key attribute from "primary key" to DBML standard "pk"
  4. pkg/writers/dbml/writer.go:208-221 - Fixed foreign key reference format to use "table.column" syntax for single columns instead of "table.(column)"

  Test Results

  All reader and writer tests are now passing:

  Readers:
  - DBML: 74.4% coverage (2 tests skipped due to missing parser features for Ref statements)
  - DCTX: 77.6% coverage
  - DrawDB: 83.6% coverage
  - JSON: 82.1% coverage
  - YAML: 82.1% coverage

  Writers:
  - Bun: 68.5% coverage
  - DBML: 91.5% coverage
  - DCTX: 100.0% coverage
  - DrawDB: 83.8% coverage
  - GORM: 69.2% coverage
  - JSON: 82.4% coverage
  - YAML: 82.4% coverage
This commit is contained in:
2025-12-16 21:43:45 +02:00
parent 7c7054d2e2
commit 5d60bc3b2c
41 changed files with 6466 additions and 634 deletions

View File

@@ -1,88 +1,82 @@
package models_bun
import "fmt"
import db "github.com/bitechdev/GoCore/pkg/models"
import "github.com/bitechdev/GoCore/pkg/types"
import "github.com/uptrace/bun"
import resolvespec_common "github.com/bitechdev/ResolveSpec/pkg/common"
// //ModelCoreMasterprocess - Generated Table for Schema core
// type ModelCoreMasterprocess struct {
// bun.BaseModel `bun:"table:core.masterprocess,alias:masterprocess"`
// Description resolvespec_common.SqlString `json:"description" bun:"description,type:citext,"`
// GUID resolvespec_common.SqlUUID `json:"guid" bun:"guid,type:uuid,default:newid(),"`
// Inactive resolvespec_common.SqlInt16 `json:"inactive" bun:"inactive,type:smallint,"`
// Jsonvalue resolvespec_common.SqlJSONB `json:"jsonvalue" bun:"jsonvalue,type:jsonb,"`
// Ridjsonschema resolvespec_common.SqlInt32 `json:"rid_jsonschema" bun:"rid_jsonschema,type:integer,"`
// Ridmasterprocess resolvespec_common.SqlInt32 `json:"rid_masterprocess" bun:"rid_masterprocess,type:integer,pk,default:nextval('core.identity_masterprocess_rid_masterprocess'::regclass),"`
// Ridmastertypehubtype resolvespec_common.SqlInt32 `json:"rid_mastertype_hubtype" bun:"rid_mastertype_hubtype,type:integer,"`
// Ridmastertypeprocesstype resolvespec_common.SqlInt32 `json:"rid_mastertype_processtype" bun:"rid_mastertype_processtype,type:integer,"`
// Ridprogrammodule resolvespec_common.SqlInt32 `json:"rid_programmodule" bun:"rid_programmodule,type:integer,"`
// Sequenceno resolvespec_common.SqlInt32 `json:"sequenceno" bun:"sequenceno,type:integer,"`
// Singleprocess resolvespec_common.SqlInt16 `json:"singleprocess" bun:"singleprocess,type:smallint,"`
// Updatecnt int64 `json:"updatecnt" bun:"updatecnt,type:integer,default:0,"`
// JSON *ModelCoreJsonschema `json:"JSON,omitempty" bun:"rel:has-one,join:rid_jsonschema=rid_jsonschema"`
// MTT_RID_MASTERTYPE_HUBTYPE *ModelCoreMastertype `json:"MTT_RID_MASTERTYPE_HUBTYPE,omitempty" bun:"rel:has-one,join:rid_mastertype_hubtype=rid_mastertype"`
// MTT_RID_MASTERTYPE_PROCESSTYPE *ModelCoreMastertype `json:"MTT_RID_MASTERTYPE_PROCESSTYPE,omitempty" bun:"rel:has-one,join:rid_mastertype_processtype=rid_mastertype"`
// PMO *ModelPublicProgrammodule `json:"PMO,omitempty" bun:"rel:has-one,join:rid_programmodule=rid_programmodule"`
//ModelCoreMasterprocess - Generated Table for Schema core
type ModelCoreMasterprocess struct {
bun.BaseModel `bun:"table:core.masterprocess,alias:masterprocess"`
Description resolvespec_common.SqlString `json:"description" bun:"description,type:citext,"`
GUID resolvespec_common.SqlUUID `json:"guid" bun:"guid,type:uuid,default:newid(),"`
Inactive resolvespec_common.SqlInt16 `json:"inactive" bun:"inactive,type:smallint,"`
Jsonvalue resolvespec_common.SqlJSONB `json:"jsonvalue" bun:"jsonvalue,type:jsonb,"`
Ridjsonschema resolvespec_common.SqlInt32 `json:"rid_jsonschema" bun:"rid_jsonschema,type:integer,"`
Ridmasterprocess resolvespec_common.SqlInt32 `json:"rid_masterprocess" bun:"rid_masterprocess,type:integer,pk,default:nextval('core.identity_masterprocess_rid_masterprocess'::regclass),"`
Ridmastertypehubtype resolvespec_common.SqlInt32 `json:"rid_mastertype_hubtype" bun:"rid_mastertype_hubtype,type:integer,"`
Ridmastertypeprocesstype resolvespec_common.SqlInt32 `json:"rid_mastertype_processtype" bun:"rid_mastertype_processtype,type:integer,"`
Ridprogrammodule resolvespec_common.SqlInt32 `json:"rid_programmodule" bun:"rid_programmodule,type:integer,"`
Sequenceno resolvespec_common.SqlInt32 `json:"sequenceno" bun:"sequenceno,type:integer,"`
Singleprocess resolvespec_common.SqlInt16 `json:"singleprocess" bun:"singleprocess,type:smallint,"`
Updatecnt int64 `json:"updatecnt" bun:"updatecnt,type:integer,default:0,"`
JSON *ModelCoreJsonschema `json:"JSON,omitempty" bun:"rel:has-one,join:rid_jsonschema=rid_jsonschema"`
MTT_RID_MASTERTYPE_HUBTYPE *ModelCoreMastertype `json:"MTT_RID_MASTERTYPE_HUBTYPE,omitempty" bun:"rel:has-one,join:rid_mastertype_hubtype=rid_mastertype"`
MTT_RID_MASTERTYPE_PROCESSTYPE *ModelCoreMastertype `json:"MTT_RID_MASTERTYPE_PROCESSTYPE,omitempty" bun:"rel:has-one,join:rid_mastertype_processtype=rid_mastertype"`
PMO *ModelPublicProgrammodule `json:"PMO,omitempty" bun:"rel:has-one,join:rid_programmodule=rid_programmodule"`
// MTL []*ModelCoreMastertask `json:"MTL,omitempty" bun:"rel:has-many,join:rid_masterprocess=rid_masterprocess"`
// PRO []*ModelCoreProcess `json:"PRO,omitempty" bun:"rel:has-many,join:rid_masterprocess=rid_masterprocess"`
// db.DBAdhocBuffer `json:",omitempty" bun:",scanonly"`
// db.DBGetIDInterface `json:",omitempty" bun:"-"`
// types.SQLTypable `json:",omitempty" bun:"-"`
// }
MTL []*ModelCoreMastertask `json:"MTL,omitempty" bun:"rel:has-many,join:rid_masterprocess=rid_masterprocess"`
PRO []*ModelCoreProcess `json:"PRO,omitempty" bun:"rel:has-many,join:rid_masterprocess=rid_masterprocess"`
db.DBAdhocBuffer `json:",omitempty" bun:",scanonly"`
db.DBGetIDInterface `json:",omitempty" bun:"-"`
types.SQLTypable `json:",omitempty" bun:"-"`
}
// // TableName - Returns the table name for the object.
// func (m ModelCoreMasterprocess) TableName() string {
// return "core.masterprocess"
// }
// TableName - Returns the table name for the object.
func (m ModelCoreMasterprocess) TableName() string {
return "core.masterprocess"
}
// // TableName - Returns the table name for the object.
// func (m ModelCoreMasterprocess) TableNameOnly() string {
// return "masterprocess"
// }
// TableName - Returns the table name for the object.
func (m ModelCoreMasterprocess) TableNameOnly() string {
return "masterprocess"
}
// // SchemaName - Returns the schema name for the object.
// func (m ModelCoreMasterprocess) SchemaName() string {
// return "core"
// }
// SchemaName - Returns the schema name for the object.
func (m ModelCoreMasterprocess) SchemaName() string {
return "core"
}
// // GetID - ID interface
// func (m ModelCoreMasterprocess) GetID() int64 {
// return m.Ridmasterprocess.Int64()
// }
// GetID - ID interface
func (m ModelCoreMasterprocess) GetID() int64 {
return m.Ridmasterprocess.Int64()
}
// // GetIDStr - ID interface
// func (m ModelCoreMasterprocess) GetIDStr() string {
// return fmt.Sprintf("%d", m.Ridmasterprocess)
// }
// GetIDStr - ID interface
func (m ModelCoreMasterprocess) GetIDStr() string {
return fmt.Sprintf("%d", m.Ridmasterprocess)
}
// // SetID - ID interface
// func (m ModelCoreMasterprocess) SetID(newid int64) {
// m.UpdateID(newid)
// }
// SetID - ID interface
func (m ModelCoreMasterprocess) SetID(newid int64) {
m.UpdateID(newid)
}
// func (m *ModelCoreMasterprocess) UpdateID(newid int64) {
// m.Ridmasterprocess.FromString(fmt.Sprintf("%d", newid))
// }
func (m *ModelCoreMasterprocess) UpdateID(newid int64) {
m.Ridmasterprocess.FromString(fmt.Sprintf("%d", newid))
}
// // GetIDName - ID interface
// func (m ModelCoreMasterprocess) GetIDName() string {
// return "rid_masterprocess"
// }
// GetIDName - ID interface
func (m ModelCoreMasterprocess) GetIDName() string {
return "rid_masterprocess"
}
// // GetPrefix - Returns a table prefix
// func (m ModelCoreMasterprocess) GetPrefix() string {
// return "MPR"
// }
// GetPrefix - Returns a table prefix
func (m ModelCoreMasterprocess) GetPrefix() string {
return "MPR"
}
// // GetRowNumber - Returns the row number of the record
// func (m ModelCoreMasterprocess) GetRowNumber() int64 {
// return m.RowNumber
// }
// GetRowNumber - Returns the row number of the record
func (m ModelCoreMasterprocess) GetRowNumber() int64 {
return m.RowNumber
}
// SetRowNumber - Set the row number of a record
func (m *ModelCoreMasterprocess) SetRowNumber(num int64) {
m.RowNumber = num
}
// // SetRowNumber - Set the row number of a record
// func (m *ModelCoreMasterprocess) SetRowNumber(num int64) {
// m.RowNumber = num
// }

View File

@@ -1,96 +1,90 @@
package models_bun
import "fmt"
import db "github.com/bitechdev/GoCore/pkg/models"
import "github.com/bitechdev/GoCore/pkg/types"
import "github.com/uptrace/bun"
import resolvespec_common "github.com/bitechdev/ResolveSpec/pkg/common"
// //ModelCoreMastertask - Generated Table for Schema core
// type ModelCoreMastertask struct {
// bun.BaseModel `bun:"table:core.mastertask,alias:mastertask"`
// Allactionsmustcomplete resolvespec_common.SqlInt16 `json:"allactionsmustcomplete" bun:"allactionsmustcomplete,type:smallint,"`
// Condition resolvespec_common.SqlString `json:"condition" bun:"condition,type:citext,"`
// Description resolvespec_common.SqlString `json:"description" bun:"description,type:citext,"`
// Dueday resolvespec_common.SqlInt16 `json:"dueday" bun:"dueday,type:smallint,"`
// Dueoption resolvespec_common.SqlString `json:"dueoption" bun:"dueoption,type:citext,"`
// Escalation resolvespec_common.SqlInt32 `json:"escalation" bun:"escalation,type:integer,"`
// Escalationoption resolvespec_common.SqlString `json:"escalationoption" bun:"escalationoption,type:citext,"`
// GUID resolvespec_common.SqlUUID `json:"guid" bun:"guid,type:uuid,default:newid(),"`
// Inactive resolvespec_common.SqlInt16 `json:"inactive" bun:"inactive,type:smallint,"`
// Jsonvalue resolvespec_common.SqlJSONB `json:"jsonvalue" bun:"jsonvalue,type:jsonb,"`
// Mastertasknote resolvespec_common.SqlString `json:"mastertasknote" bun:"mastertasknote,type:citext,"`
// Repeatinterval resolvespec_common.SqlInt16 `json:"repeatinterval" bun:"repeatinterval,type:smallint,"`
// Repeattype resolvespec_common.SqlString `json:"repeattype" bun:"repeattype,type:citext,"`
// Ridjsonschema resolvespec_common.SqlInt32 `json:"rid_jsonschema" bun:"rid_jsonschema,type:integer,"`
// Ridmasterprocess resolvespec_common.SqlInt32 `json:"rid_masterprocess" bun:"rid_masterprocess,type:integer,"`
// Ridmastertask resolvespec_common.SqlInt32 `json:"rid_mastertask" bun:"rid_mastertask,type:integer,pk,default:nextval('core.identity_mastertask_rid_mastertask'::regclass),"`
// Ridmastertypetasktype resolvespec_common.SqlInt32 `json:"rid_mastertype_tasktype" bun:"rid_mastertype_tasktype,type:integer,"`
// Sequenceno resolvespec_common.SqlInt32 `json:"sequenceno" bun:"sequenceno,type:integer,"`
// Singletask resolvespec_common.SqlInt16 `json:"singletask" bun:"singletask,type:smallint,"`
// Startday resolvespec_common.SqlInt16 `json:"startday" bun:"startday,type:smallint,"`
// Updatecnt int64 `json:"updatecnt" bun:"updatecnt,type:integer,default:0,"`
// JSON *ModelCoreJsonschema `json:"JSON,omitempty" bun:"rel:has-one,join:rid_jsonschema=rid_jsonschema"`
// MPR *ModelCoreMasterprocess `json:"MPR,omitempty" bun:"rel:has-one,join:rid_masterprocess=rid_masterprocess"`
// MTT *ModelCoreMastertype `json:"MTT,omitempty" bun:"rel:has-one,join:rid_mastertype_tasktype=rid_mastertype"`
//ModelCoreMastertask - Generated Table for Schema core
type ModelCoreMastertask struct {
bun.BaseModel `bun:"table:core.mastertask,alias:mastertask"`
Allactionsmustcomplete resolvespec_common.SqlInt16 `json:"allactionsmustcomplete" bun:"allactionsmustcomplete,type:smallint,"`
Condition resolvespec_common.SqlString `json:"condition" bun:"condition,type:citext,"`
Description resolvespec_common.SqlString `json:"description" bun:"description,type:citext,"`
Dueday resolvespec_common.SqlInt16 `json:"dueday" bun:"dueday,type:smallint,"`
Dueoption resolvespec_common.SqlString `json:"dueoption" bun:"dueoption,type:citext,"`
Escalation resolvespec_common.SqlInt32 `json:"escalation" bun:"escalation,type:integer,"`
Escalationoption resolvespec_common.SqlString `json:"escalationoption" bun:"escalationoption,type:citext,"`
GUID resolvespec_common.SqlUUID `json:"guid" bun:"guid,type:uuid,default:newid(),"`
Inactive resolvespec_common.SqlInt16 `json:"inactive" bun:"inactive,type:smallint,"`
Jsonvalue resolvespec_common.SqlJSONB `json:"jsonvalue" bun:"jsonvalue,type:jsonb,"`
Mastertasknote resolvespec_common.SqlString `json:"mastertasknote" bun:"mastertasknote,type:citext,"`
Repeatinterval resolvespec_common.SqlInt16 `json:"repeatinterval" bun:"repeatinterval,type:smallint,"`
Repeattype resolvespec_common.SqlString `json:"repeattype" bun:"repeattype,type:citext,"`
Ridjsonschema resolvespec_common.SqlInt32 `json:"rid_jsonschema" bun:"rid_jsonschema,type:integer,"`
Ridmasterprocess resolvespec_common.SqlInt32 `json:"rid_masterprocess" bun:"rid_masterprocess,type:integer,"`
Ridmastertask resolvespec_common.SqlInt32 `json:"rid_mastertask" bun:"rid_mastertask,type:integer,pk,default:nextval('core.identity_mastertask_rid_mastertask'::regclass),"`
Ridmastertypetasktype resolvespec_common.SqlInt32 `json:"rid_mastertype_tasktype" bun:"rid_mastertype_tasktype,type:integer,"`
Sequenceno resolvespec_common.SqlInt32 `json:"sequenceno" bun:"sequenceno,type:integer,"`
Singletask resolvespec_common.SqlInt16 `json:"singletask" bun:"singletask,type:smallint,"`
Startday resolvespec_common.SqlInt16 `json:"startday" bun:"startday,type:smallint,"`
Updatecnt int64 `json:"updatecnt" bun:"updatecnt,type:integer,default:0,"`
JSON *ModelCoreJsonschema `json:"JSON,omitempty" bun:"rel:has-one,join:rid_jsonschema=rid_jsonschema"`
MPR *ModelCoreMasterprocess `json:"MPR,omitempty" bun:"rel:has-one,join:rid_masterprocess=rid_masterprocess"`
MTT *ModelCoreMastertype `json:"MTT,omitempty" bun:"rel:has-one,join:rid_mastertype_tasktype=rid_mastertype"`
// MAL []*ModelCoreMastertaskitem `json:"MAL,omitempty" bun:"rel:has-many,join:rid_mastertask=rid_mastertask"`
// TAS []*ModelCoreTasklist `json:"TAS,omitempty" bun:"rel:has-many,join:rid_mastertask=rid_mastertask"`
// db.DBAdhocBuffer `json:",omitempty" bun:",scanonly"`
// db.DBGetIDInterface `json:",omitempty" bun:"-"`
// types.SQLTypable `json:",omitempty" bun:"-"`
// }
MAL []*ModelCoreMastertaskitem `json:"MAL,omitempty" bun:"rel:has-many,join:rid_mastertask=rid_mastertask"`
TAS []*ModelCoreTasklist `json:"TAS,omitempty" bun:"rel:has-many,join:rid_mastertask=rid_mastertask"`
db.DBAdhocBuffer `json:",omitempty" bun:",scanonly"`
db.DBGetIDInterface `json:",omitempty" bun:"-"`
types.SQLTypable `json:",omitempty" bun:"-"`
}
// // TableName - Returns the table name for the object.
// func (m ModelCoreMastertask) TableName() string {
// return "core.mastertask"
// }
// TableName - Returns the table name for the object.
func (m ModelCoreMastertask) TableName() string {
return "core.mastertask"
}
// // TableName - Returns the table name for the object.
// func (m ModelCoreMastertask) TableNameOnly() string {
// return "mastertask"
// }
// TableName - Returns the table name for the object.
func (m ModelCoreMastertask) TableNameOnly() string {
return "mastertask"
}
// // SchemaName - Returns the schema name for the object.
// func (m ModelCoreMastertask) SchemaName() string {
// return "core"
// }
// SchemaName - Returns the schema name for the object.
func (m ModelCoreMastertask) SchemaName() string {
return "core"
}
// // GetID - ID interface
// func (m ModelCoreMastertask) GetID() int64 {
// return m.Ridmastertask.Int64()
// }
// GetID - ID interface
func (m ModelCoreMastertask) GetID() int64 {
return m.Ridmastertask.Int64()
}
// // GetIDStr - ID interface
// func (m ModelCoreMastertask) GetIDStr() string {
// return fmt.Sprintf("%d", m.Ridmastertask)
// }
// GetIDStr - ID interface
func (m ModelCoreMastertask) GetIDStr() string {
return fmt.Sprintf("%d", m.Ridmastertask)
}
// // SetID - ID interface
// func (m ModelCoreMastertask) SetID(newid int64) {
// m.UpdateID(newid)
// }
// SetID - ID interface
func (m ModelCoreMastertask) SetID(newid int64) {
m.UpdateID(newid)
}
// func (m *ModelCoreMastertask) UpdateID(newid int64) {
// m.Ridmastertask.FromString(fmt.Sprintf("%d", newid))
// }
func (m *ModelCoreMastertask) UpdateID(newid int64) {
m.Ridmastertask.FromString(fmt.Sprintf("%d", newid))
}
// // GetIDName - ID interface
// func (m ModelCoreMastertask) GetIDName() string {
// return "rid_mastertask"
// }
// GetIDName - ID interface
func (m ModelCoreMastertask) GetIDName() string {
return "rid_mastertask"
}
// // GetPrefix - Returns a table prefix
// func (m ModelCoreMastertask) GetPrefix() string {
// return "MTL"
// }
// GetPrefix - Returns a table prefix
func (m ModelCoreMastertask) GetPrefix() string {
return "MTL"
}
// // GetRowNumber - Returns the row number of the record
// func (m ModelCoreMastertask) GetRowNumber() int64 {
// return m.RowNumber
// }
// GetRowNumber - Returns the row number of the record
func (m ModelCoreMastertask) GetRowNumber() int64 {
return m.RowNumber
}
// SetRowNumber - Set the row number of a record
func (m *ModelCoreMastertask) SetRowNumber(num int64) {
m.RowNumber = num
}
// // SetRowNumber - Set the row number of a record
// func (m *ModelCoreMastertask) SetRowNumber(num int64) {
// m.RowNumber = num
// }

View File

@@ -1,101 +1,95 @@
package models_bun
import "fmt"
import db "github.com/bitechdev/GoCore/pkg/models"
import "github.com/bitechdev/GoCore/pkg/types"
import "github.com/uptrace/bun"
import resolvespec_common "github.com/bitechdev/ResolveSpec/pkg/common"
// //ModelCoreMastertype - Generated Table for Schema core
// type ModelCoreMastertype struct {
// bun.BaseModel `bun:"table:core.mastertype,alias:mastertype"`
// Category resolvespec_common.SqlString `json:"category" bun:"category,type:citext,"`
// Description resolvespec_common.SqlString `json:"description" bun:"description,type:citext,"`
// Disableedit resolvespec_common.SqlInt16 `json:"disableedit" bun:"disableedit,type:smallint,"`
// Forprefix resolvespec_common.SqlString `json:"forprefix" bun:"forprefix,type:citext,"`
// GUID resolvespec_common.SqlUUID `json:"guid" bun:"guid,type:uuid,default:newid(),"`
// Hidden resolvespec_common.SqlInt16 `json:"hidden" bun:"hidden,type:smallint,"`
// Inactive resolvespec_common.SqlInt16 `json:"inactive" bun:"inactive,type:smallint,"`
// Jsonvalue resolvespec_common.SqlJSONB `json:"jsonvalue" bun:"jsonvalue,type:jsonb,"`
// Mastertype resolvespec_common.SqlString `json:"mastertype" bun:"mastertype,type:citext,"`
// Note resolvespec_common.SqlString `json:"note" bun:"note,type:citext,"`
// Ridmastertype resolvespec_common.SqlInt32 `json:"rid_mastertype" bun:"rid_mastertype,type:integer,pk,default:nextval('core.identity_mastertype_rid_mastertype'::regclass),"`
// Ridparent resolvespec_common.SqlInt32 `json:"rid_parent" bun:"rid_parent,type:integer,"`
// Updatecnt int64 `json:"updatecnt" bun:"updatecnt,type:integer,default:0,"`
// MTT *ModelCoreMastertype `json:"MTT,omitempty" bun:"rel:has-one,join:rid_mastertype=rid_parent"`
//ModelCoreMastertype - Generated Table for Schema core
type ModelCoreMastertype struct {
bun.BaseModel `bun:"table:core.mastertype,alias:mastertype"`
Category resolvespec_common.SqlString `json:"category" bun:"category,type:citext,"`
Description resolvespec_common.SqlString `json:"description" bun:"description,type:citext,"`
Disableedit resolvespec_common.SqlInt16 `json:"disableedit" bun:"disableedit,type:smallint,"`
Forprefix resolvespec_common.SqlString `json:"forprefix" bun:"forprefix,type:citext,"`
GUID resolvespec_common.SqlUUID `json:"guid" bun:"guid,type:uuid,default:newid(),"`
Hidden resolvespec_common.SqlInt16 `json:"hidden" bun:"hidden,type:smallint,"`
Inactive resolvespec_common.SqlInt16 `json:"inactive" bun:"inactive,type:smallint,"`
Jsonvalue resolvespec_common.SqlJSONB `json:"jsonvalue" bun:"jsonvalue,type:jsonb,"`
Mastertype resolvespec_common.SqlString `json:"mastertype" bun:"mastertype,type:citext,"`
Note resolvespec_common.SqlString `json:"note" bun:"note,type:citext,"`
Ridmastertype resolvespec_common.SqlInt32 `json:"rid_mastertype" bun:"rid_mastertype,type:integer,pk,default:nextval('core.identity_mastertype_rid_mastertype'::regclass),"`
Ridparent resolvespec_common.SqlInt32 `json:"rid_parent" bun:"rid_parent,type:integer,"`
Updatecnt int64 `json:"updatecnt" bun:"updatecnt,type:integer,default:0,"`
MTT *ModelCoreMastertype `json:"MTT,omitempty" bun:"rel:has-one,join:rid_mastertype=rid_parent"`
// CMAT []*ModelCoreCommitem_Attachment `json:"CMAT,omitempty" bun:"rel:has-many,join:rid_mastertype=rid_mastertype"`
// DVT []*ModelCoreDocumentvault `json:"DVT,omitempty" bun:"rel:has-many,join:rid_mastertype=rid_mastertype"`
// EAD []*ModelCoreEmailaddresslist `json:"EAD,omitempty" bun:"rel:has-many,join:rid_mastertype=rid_mastertype"`
// JSON []*ModelCoreJsonschema `json:"JSON,omitempty" bun:"rel:has-many,join:rid_mastertype=rid_mastertype"`
// MAL []*ModelCoreMastertaskitem `json:"MAL,omitempty" bun:"rel:has-many,join:rid_mastertype=rid_mastertype_hubtype"`
// MPR_RID_MASTERTYPE_HUBTYPE []*ModelCoreMasterprocess `json:"MPR_RID_MASTERTYPE_HUBTYPE,omitempty" bun:"rel:has-many,join:rid_mastertype=rid_mastertype_hubtype"`
// MPR_RID_MASTERTYPE_PROCESSTYPE []*ModelCoreMasterprocess `json:"MPR_RID_MASTERTYPE_PROCESSTYPE,omitempty" bun:"rel:has-many,join:rid_mastertype=rid_mastertype_processtype"`
// MSE []*ModelCoreMasterservice `json:"MSE,omitempty" bun:"rel:has-many,join:rid_mastertype=rid_mastertype_hubtype"`
// MTL []*ModelCoreMastertask `json:"MTL,omitempty" bun:"rel:has-many,join:rid_mastertype=rid_mastertype_tasktype"`
// MTT_RID_PARENT []*ModelCoreMastertype `json:"MTT_RID_PARENT,omitempty" bun:"rel:has-many,join:rid_mastertype=rid_parent"`
// RUL []*ModelCoreMasterworkflowrule `json:"RUL,omitempty" bun:"rel:has-many,join:rid_mastertype=rid_mastertype_group"`
// TAT_RID_MASTERTYPE_DOCGENTYPE []*ModelCoreMasterdoctemplate `json:"TAT_RID_MASTERTYPE_DOCGENTYPE,omitempty" bun:"rel:has-many,join:rid_mastertype=rid_mastertype_docgentype"`
// TAT_RID_MASTERTYPE_DOCUMENT []*ModelCoreMasterdoctemplate `json:"TAT_RID_MASTERTYPE_DOCUMENT,omitempty" bun:"rel:has-many,join:rid_mastertype=rid_mastertype_document"`
// TAT_RID_MASTERTYPE_GROUP []*ModelCoreMasterdoctemplate `json:"TAT_RID_MASTERTYPE_GROUP,omitempty" bun:"rel:has-many,join:rid_mastertype=rid_mastertype_group"`
// TAT_RID_MASTERTYPE_HUBTYPE []*ModelCoreMasterdoctemplate `json:"TAT_RID_MASTERTYPE_HUBTYPE,omitempty" bun:"rel:has-many,join:rid_mastertype=rid_mastertype_hubtype"`
// TAT_RID_MASTERTYPE_MERGETYPE []*ModelCoreMasterdoctemplate `json:"TAT_RID_MASTERTYPE_MERGETYPE,omitempty" bun:"rel:has-many,join:rid_mastertype=rid_mastertype_mergetype"`
// TAT_RID_MASTERTYPE_TARGETTYPE []*ModelCoreMasterdoctemplate `json:"TAT_RID_MASTERTYPE_TARGETTYPE,omitempty" bun:"rel:has-many,join:rid_mastertype=rid_mastertype_targettype"`
// db.DBAdhocBuffer `json:",omitempty" bun:",scanonly"`
// db.DBGetIDInterface `json:",omitempty" bun:"-"`
// types.SQLTypable `json:",omitempty" bun:"-"`
// }
CMAT []*ModelCoreCommitem_Attachment `json:"CMAT,omitempty" bun:"rel:has-many,join:rid_mastertype=rid_mastertype"`
DVT []*ModelCoreDocumentvault `json:"DVT,omitempty" bun:"rel:has-many,join:rid_mastertype=rid_mastertype"`
EAD []*ModelCoreEmailaddresslist `json:"EAD,omitempty" bun:"rel:has-many,join:rid_mastertype=rid_mastertype"`
JSON []*ModelCoreJsonschema `json:"JSON,omitempty" bun:"rel:has-many,join:rid_mastertype=rid_mastertype"`
MAL []*ModelCoreMastertaskitem `json:"MAL,omitempty" bun:"rel:has-many,join:rid_mastertype=rid_mastertype_hubtype"`
MPR_RID_MASTERTYPE_HUBTYPE []*ModelCoreMasterprocess `json:"MPR_RID_MASTERTYPE_HUBTYPE,omitempty" bun:"rel:has-many,join:rid_mastertype=rid_mastertype_hubtype"`
MPR_RID_MASTERTYPE_PROCESSTYPE []*ModelCoreMasterprocess `json:"MPR_RID_MASTERTYPE_PROCESSTYPE,omitempty" bun:"rel:has-many,join:rid_mastertype=rid_mastertype_processtype"`
MSE []*ModelCoreMasterservice `json:"MSE,omitempty" bun:"rel:has-many,join:rid_mastertype=rid_mastertype_hubtype"`
MTL []*ModelCoreMastertask `json:"MTL,omitempty" bun:"rel:has-many,join:rid_mastertype=rid_mastertype_tasktype"`
MTT_RID_PARENT []*ModelCoreMastertype `json:"MTT_RID_PARENT,omitempty" bun:"rel:has-many,join:rid_mastertype=rid_parent"`
RUL []*ModelCoreMasterworkflowrule `json:"RUL,omitempty" bun:"rel:has-many,join:rid_mastertype=rid_mastertype_group"`
TAT_RID_MASTERTYPE_DOCGENTYPE []*ModelCoreMasterdoctemplate `json:"TAT_RID_MASTERTYPE_DOCGENTYPE,omitempty" bun:"rel:has-many,join:rid_mastertype=rid_mastertype_docgentype"`
TAT_RID_MASTERTYPE_DOCUMENT []*ModelCoreMasterdoctemplate `json:"TAT_RID_MASTERTYPE_DOCUMENT,omitempty" bun:"rel:has-many,join:rid_mastertype=rid_mastertype_document"`
TAT_RID_MASTERTYPE_GROUP []*ModelCoreMasterdoctemplate `json:"TAT_RID_MASTERTYPE_GROUP,omitempty" bun:"rel:has-many,join:rid_mastertype=rid_mastertype_group"`
TAT_RID_MASTERTYPE_HUBTYPE []*ModelCoreMasterdoctemplate `json:"TAT_RID_MASTERTYPE_HUBTYPE,omitempty" bun:"rel:has-many,join:rid_mastertype=rid_mastertype_hubtype"`
TAT_RID_MASTERTYPE_MERGETYPE []*ModelCoreMasterdoctemplate `json:"TAT_RID_MASTERTYPE_MERGETYPE,omitempty" bun:"rel:has-many,join:rid_mastertype=rid_mastertype_mergetype"`
TAT_RID_MASTERTYPE_TARGETTYPE []*ModelCoreMasterdoctemplate `json:"TAT_RID_MASTERTYPE_TARGETTYPE,omitempty" bun:"rel:has-many,join:rid_mastertype=rid_mastertype_targettype"`
db.DBAdhocBuffer `json:",omitempty" bun:",scanonly"`
db.DBGetIDInterface `json:",omitempty" bun:"-"`
types.SQLTypable `json:",omitempty" bun:"-"`
}
// // TableName - Returns the table name for the object.
// func (m ModelCoreMastertype) TableName() string {
// return "core.mastertype"
// }
// TableName - Returns the table name for the object.
func (m ModelCoreMastertype) TableName() string {
return "core.mastertype"
}
// // TableName - Returns the table name for the object.
// func (m ModelCoreMastertype) TableNameOnly() string {
// return "mastertype"
// }
// TableName - Returns the table name for the object.
func (m ModelCoreMastertype) TableNameOnly() string {
return "mastertype"
}
// // SchemaName - Returns the schema name for the object.
// func (m ModelCoreMastertype) SchemaName() string {
// return "core"
// }
// SchemaName - Returns the schema name for the object.
func (m ModelCoreMastertype) SchemaName() string {
return "core"
}
// // GetID - ID interface
// func (m ModelCoreMastertype) GetID() int64 {
// return m.Ridmastertype.Int64()
// }
// GetID - ID interface
func (m ModelCoreMastertype) GetID() int64 {
return m.Ridmastertype.Int64()
}
// // GetIDStr - ID interface
// func (m ModelCoreMastertype) GetIDStr() string {
// return fmt.Sprintf("%d", m.Ridmastertype)
// }
// GetIDStr - ID interface
func (m ModelCoreMastertype) GetIDStr() string {
return fmt.Sprintf("%d", m.Ridmastertype)
}
// // SetID - ID interface
// func (m ModelCoreMastertype) SetID(newid int64) {
// m.UpdateID(newid)
// }
// SetID - ID interface
func (m ModelCoreMastertype) SetID(newid int64) {
m.UpdateID(newid)
}
// func (m *ModelCoreMastertype) UpdateID(newid int64) {
// m.Ridmastertype.FromString(fmt.Sprintf("%d", newid))
// }
func (m *ModelCoreMastertype) UpdateID(newid int64) {
m.Ridmastertype.FromString(fmt.Sprintf("%d", newid))
}
// // GetIDName - ID interface
// func (m ModelCoreMastertype) GetIDName() string {
// return "rid_mastertype"
// }
// GetIDName - ID interface
func (m ModelCoreMastertype) GetIDName() string {
return "rid_mastertype"
}
// // GetPrefix - Returns a table prefix
// func (m ModelCoreMastertype) GetPrefix() string {
// return "MTT"
// }
// GetPrefix - Returns a table prefix
func (m ModelCoreMastertype) GetPrefix() string {
return "MTT"
}
// // GetRowNumber - Returns the row number of the record
// func (m ModelCoreMastertype) GetRowNumber() int64 {
// return m.RowNumber
// }
// GetRowNumber - Returns the row number of the record
func (m ModelCoreMastertype) GetRowNumber() int64 {
return m.RowNumber
}
// SetRowNumber - Set the row number of a record
func (m *ModelCoreMastertype) SetRowNumber(num int64) {
m.RowNumber = num
}
// // SetRowNumber - Set the row number of a record
// func (m *ModelCoreMastertype) SetRowNumber(num int64) {
// m.RowNumber = num
// }

View File

@@ -1,83 +1,77 @@
package models_bun
import "fmt"
import db "github.com/bitechdev/GoCore/pkg/models"
import "github.com/bitechdev/GoCore/pkg/types"
import "github.com/uptrace/bun"
import resolvespec_common "github.com/bitechdev/ResolveSpec/pkg/common"
// //ModelCoreProcess - Generated Table for Schema core
// type ModelCoreProcess struct {
// bun.BaseModel `bun:"table:core.process,alias:process"`
// Completedate resolvespec_common.SqlDate `json:"completedate" bun:"completedate,type:date,"`
// Completetime types.CustomIntTime `json:"completetime" bun:"completetime,type:integer,"`
// Description resolvespec_common.SqlString `json:"description" bun:"description,type:citext,"`
// GUID resolvespec_common.SqlUUID `json:"guid" bun:"guid,type:uuid,default:newid(),"`
// Ridcompleteuser resolvespec_common.SqlInt32 `json:"rid_completeuser" bun:"rid_completeuser,type:integer,"`
// Ridhub resolvespec_common.SqlInt32 `json:"rid_hub" bun:"rid_hub,type:integer,"`
// Ridmasterprocess resolvespec_common.SqlInt32 `json:"rid_masterprocess" bun:"rid_masterprocess,type:integer,"`
// Ridprocess resolvespec_common.SqlInt32 `json:"rid_process" bun:"rid_process,type:integer,pk,default:nextval('core.identity_process_rid_process'::regclass),"`
// Status resolvespec_common.SqlString `json:"status" bun:"status,type:citext,"`
// Updatecnt int64 `json:"updatecnt" bun:"updatecnt,type:integer,default:0,"`
// HUB *ModelCoreHub `json:"HUB,omitempty" bun:"rel:has-one,join:rid_hub=rid_hub"`
// MPR *ModelCoreMasterprocess `json:"MPR,omitempty" bun:"rel:has-one,join:rid_masterprocess=rid_masterprocess"`
//ModelCoreProcess - Generated Table for Schema core
type ModelCoreProcess struct {
bun.BaseModel `bun:"table:core.process,alias:process"`
Completedate resolvespec_common.SqlDate `json:"completedate" bun:"completedate,type:date,"`
Completetime types.CustomIntTime `json:"completetime" bun:"completetime,type:integer,"`
Description resolvespec_common.SqlString `json:"description" bun:"description,type:citext,"`
GUID resolvespec_common.SqlUUID `json:"guid" bun:"guid,type:uuid,default:newid(),"`
Ridcompleteuser resolvespec_common.SqlInt32 `json:"rid_completeuser" bun:"rid_completeuser,type:integer,"`
Ridhub resolvespec_common.SqlInt32 `json:"rid_hub" bun:"rid_hub,type:integer,"`
Ridmasterprocess resolvespec_common.SqlInt32 `json:"rid_masterprocess" bun:"rid_masterprocess,type:integer,"`
Ridprocess resolvespec_common.SqlInt32 `json:"rid_process" bun:"rid_process,type:integer,pk,default:nextval('core.identity_process_rid_process'::regclass),"`
Status resolvespec_common.SqlString `json:"status" bun:"status,type:citext,"`
Updatecnt int64 `json:"updatecnt" bun:"updatecnt,type:integer,default:0,"`
HUB *ModelCoreHub `json:"HUB,omitempty" bun:"rel:has-one,join:rid_hub=rid_hub"`
MPR *ModelCoreMasterprocess `json:"MPR,omitempty" bun:"rel:has-one,join:rid_masterprocess=rid_masterprocess"`
// TAS []*ModelCoreTasklist `json:"TAS,omitempty" bun:"rel:has-many,join:rid_process=rid_process"`
// db.DBAdhocBuffer `json:",omitempty" bun:",scanonly"`
// db.DBGetIDInterface `json:",omitempty" bun:"-"`
// types.SQLTypable `json:",omitempty" bun:"-"`
// }
TAS []*ModelCoreTasklist `json:"TAS,omitempty" bun:"rel:has-many,join:rid_process=rid_process"`
db.DBAdhocBuffer `json:",omitempty" bun:",scanonly"`
db.DBGetIDInterface `json:",omitempty" bun:"-"`
types.SQLTypable `json:",omitempty" bun:"-"`
}
// // TableName - Returns the table name for the object.
// func (m ModelCoreProcess) TableName() string {
// return "core.process"
// }
// TableName - Returns the table name for the object.
func (m ModelCoreProcess) TableName() string {
return "core.process"
}
// // TableName - Returns the table name for the object.
// func (m ModelCoreProcess) TableNameOnly() string {
// return "process"
// }
// TableName - Returns the table name for the object.
func (m ModelCoreProcess) TableNameOnly() string {
return "process"
}
// // SchemaName - Returns the schema name for the object.
// func (m ModelCoreProcess) SchemaName() string {
// return "core"
// }
// SchemaName - Returns the schema name for the object.
func (m ModelCoreProcess) SchemaName() string {
return "core"
}
// // GetID - ID interface
// func (m ModelCoreProcess) GetID() int64 {
// return m.Ridprocess.Int64()
// }
// GetID - ID interface
func (m ModelCoreProcess) GetID() int64 {
return m.Ridprocess.Int64()
}
// // GetIDStr - ID interface
// func (m ModelCoreProcess) GetIDStr() string {
// return fmt.Sprintf("%d", m.Ridprocess)
// }
// GetIDStr - ID interface
func (m ModelCoreProcess) GetIDStr() string {
return fmt.Sprintf("%d", m.Ridprocess)
}
// // SetID - ID interface
// func (m ModelCoreProcess) SetID(newid int64) {
// m.UpdateID(newid)
// }
// SetID - ID interface
func (m ModelCoreProcess) SetID(newid int64) {
m.UpdateID(newid)
}
// func (m *ModelCoreProcess) UpdateID(newid int64) {
// m.Ridprocess.FromString(fmt.Sprintf("%d", newid))
// }
func (m *ModelCoreProcess) UpdateID(newid int64) {
m.Ridprocess.FromString(fmt.Sprintf("%d", newid))
}
// // GetIDName - ID interface
// func (m ModelCoreProcess) GetIDName() string {
// return "rid_process"
// }
// GetIDName - ID interface
func (m ModelCoreProcess) GetIDName() string {
return "rid_process"
}
// // GetPrefix - Returns a table prefix
// func (m ModelCoreProcess) GetPrefix() string {
// return "PRO"
// }
// GetPrefix - Returns a table prefix
func (m ModelCoreProcess) GetPrefix() string {
return "PRO"
}
// // GetRowNumber - Returns the row number of the record
// func (m ModelCoreProcess) GetRowNumber() int64 {
// return m.RowNumber
// }
// GetRowNumber - Returns the row number of the record
func (m ModelCoreProcess) GetRowNumber() int64 {
return m.RowNumber
}
// SetRowNumber - Set the row number of a record
func (m *ModelCoreProcess) SetRowNumber(num int64) {
m.RowNumber = num
}
// // SetRowNumber - Set the row number of a record
// func (m *ModelCoreProcess) SetRowNumber(num int64) {
// m.RowNumber = num
// }

View File

@@ -1,88 +1,81 @@
package models
import (
"fmt"
// // ModelCoreMasterprocess - Generated Table for Schema core
// type ModelCoreMasterprocess struct {
// Description string `json:"description" gorm:"Column:description;type:citext;"`
// GUID types.NullableUUID `json:"guid" gorm:"Column:guid;type:uuid;default:newid();"`
// Inactive types.SInt16 `json:"inactive" gorm:"Column:inactive;type:smallint;"`
// Jsonvalue types.NullableJSONB `json:"jsonvalue" gorm:"Column:jsonvalue;type:jsonb;"`
// Ridjsonschema types.ZNullInt32 `json:"rid_jsonschema" gorm:"Column:rid_jsonschema;type:integer;"`
// Ridmasterprocess int32 `json:"rid_masterprocess" gorm:"Column:rid_masterprocess;type:integer;primaryKey;default:nextval('core.identity_masterprocess_rid_masterprocess'::regclass);"`
// Ridmastertypehubtype types.ZNullInt32 `json:"rid_mastertype_hubtype" gorm:"Column:rid_mastertype_hubtype;type:integer;"`
// Ridmastertypeprocesstype types.ZNullInt32 `json:"rid_mastertype_processtype" gorm:"Column:rid_mastertype_processtype;type:integer;"`
// Ridprogrammodule types.ZNullInt32 `json:"rid_programmodule" gorm:"Column:rid_programmodule;type:integer;"`
// Sequenceno types.ZNullInt32 `json:"sequenceno" gorm:"Column:sequenceno;type:integer;"`
// Singleprocess types.SInt16 `json:"singleprocess" gorm:"Column:singleprocess;type:smallint;"`
// Updatecnt int64 `json:"updatecnt" gorm:"Column:updatecnt;type:integer;default:0;"`
// //JSON *ModelCoreJsonschema `json:"JSON,omitempty" gorm:"references:rid_jsonschema;foreignKey:rid_jsonschema;"`
// MTT_RID_MASTERTYPE_HUBTYPE *ModelCoreMastertype `json:"MTT_RID_MASTERTYPE_HUBTYPE,omitempty" gorm:"references:rid_mastertype_hubtype;foreignKey:rid_mastertype;"`
// MTT_RID_MASTERTYPE_PROCESSTYPE *ModelCoreMastertype `json:"MTT_RID_MASTERTYPE_PROCESSTYPE,omitempty" gorm:"references:rid_mastertype_processtype;foreignKey:rid_mastertype;"`
// //PMO *ModelPublicProgrammodule `json:"PMO,omitempty" gorm:"references:rid_programmodule;foreignKey:rid_programmodule;"`
db "github.com/bitechdev/GoCore/pkg/models"
"github.com/bitechdev/GoCore/pkg/types"
)
// MTL []*ModelCoreMastertask `json:"MTL,omitempty" gorm:"references:rid_masterprocess;foreignKey:rid_masterprocess;opt_c"`
// PRO []*ModelCoreProcess `json:"PRO,omitempty" gorm:"references:rid_masterprocess;foreignKey:rid_masterprocess;opt_c"`
// db.DBAdhocBuffer `json:",omitempty"`
// db.DBGetIDInterface `json:",omitempty" gorm:"-"`
// types.SQLTypable `json:",omitempty" gorm:"-"`
// }
// ModelCoreMasterprocess - Generated Table for Schema core
type ModelCoreMasterprocess struct {
Description string `json:"description" gorm:"Column:description;type:citext;"`
GUID types.NullableUUID `json:"guid" gorm:"Column:guid;type:uuid;default:newid();"`
Inactive types.SInt16 `json:"inactive" gorm:"Column:inactive;type:smallint;"`
Jsonvalue types.NullableJSONB `json:"jsonvalue" gorm:"Column:jsonvalue;type:jsonb;"`
Ridjsonschema types.ZNullInt32 `json:"rid_jsonschema" gorm:"Column:rid_jsonschema;type:integer;"`
Ridmasterprocess int32 `json:"rid_masterprocess" gorm:"Column:rid_masterprocess;type:integer;primaryKey;default:nextval('core.identity_masterprocess_rid_masterprocess'::regclass);"`
Ridmastertypehubtype types.ZNullInt32 `json:"rid_mastertype_hubtype" gorm:"Column:rid_mastertype_hubtype;type:integer;"`
Ridmastertypeprocesstype types.ZNullInt32 `json:"rid_mastertype_processtype" gorm:"Column:rid_mastertype_processtype;type:integer;"`
Ridprogrammodule types.ZNullInt32 `json:"rid_programmodule" gorm:"Column:rid_programmodule;type:integer;"`
Sequenceno types.ZNullInt32 `json:"sequenceno" gorm:"Column:sequenceno;type:integer;"`
Singleprocess types.SInt16 `json:"singleprocess" gorm:"Column:singleprocess;type:smallint;"`
Updatecnt int64 `json:"updatecnt" gorm:"Column:updatecnt;type:integer;default:0;"`
//JSON *ModelCoreJsonschema `json:"JSON,omitempty" gorm:"references:rid_jsonschema;foreignKey:rid_jsonschema;"`
MTT_RID_MASTERTYPE_HUBTYPE *ModelCoreMastertype `json:"MTT_RID_MASTERTYPE_HUBTYPE,omitempty" gorm:"references:rid_mastertype_hubtype;foreignKey:rid_mastertype;"`
MTT_RID_MASTERTYPE_PROCESSTYPE *ModelCoreMastertype `json:"MTT_RID_MASTERTYPE_PROCESSTYPE,omitempty" gorm:"references:rid_mastertype_processtype;foreignKey:rid_mastertype;"`
//PMO *ModelPublicProgrammodule `json:"PMO,omitempty" gorm:"references:rid_programmodule;foreignKey:rid_programmodule;"`
// // TableName - Returns the table name for the object.
// func (m ModelCoreMasterprocess) TableName() string {
// return "core.masterprocess"
// }
MTL []*ModelCoreMastertask `json:"MTL,omitempty" gorm:"references:rid_masterprocess;foreignKey:rid_masterprocess;opt_c"`
PRO []*ModelCoreProcess `json:"PRO,omitempty" gorm:"references:rid_masterprocess;foreignKey:rid_masterprocess;opt_c"`
db.DBAdhocBuffer `json:",omitempty"`
db.DBGetIDInterface `json:",omitempty" gorm:"-"`
types.SQLTypable `json:",omitempty" gorm:"-"`
}
// // TableName - Returns the table name for the object.
// func (m ModelCoreMasterprocess) TableNameOnly() string {
// return "masterprocess"
// }
// TableName - Returns the table name for the object.
func (m ModelCoreMasterprocess) TableName() string {
return "core.masterprocess"
}
// // SchemaName - Returns the schema name for the object.
// func (m ModelCoreMasterprocess) SchemaName() string {
// return "core"
// }
// TableName - Returns the table name for the object.
func (m ModelCoreMasterprocess) TableNameOnly() string {
return "masterprocess"
}
// // GetID - ID interface
// func (m ModelCoreMasterprocess) GetID() int64 {
// return int64(m.Ridmasterprocess)
// }
// SchemaName - Returns the schema name for the object.
func (m ModelCoreMasterprocess) SchemaName() string {
return "core"
}
// // GetIDStr - ID interface
// func (m ModelCoreMasterprocess) GetIDStr() string {
// return fmt.Sprintf("%d", m.Ridmasterprocess)
// }
// GetID - ID interface
func (m ModelCoreMasterprocess) GetID() int64 {
return int64(m.Ridmasterprocess)
}
// // SetID - ID interface
// func (m ModelCoreMasterprocess) SetID(newid int64) {
// m.UpdateID(newid)
// }
// GetIDStr - ID interface
func (m ModelCoreMasterprocess) GetIDStr() string {
return fmt.Sprintf("%d", m.Ridmasterprocess)
}
// func (m *ModelCoreMasterprocess) UpdateID(newid int64) {
// m.Ridmasterprocess = int32(newid)
// }
// SetID - ID interface
func (m ModelCoreMasterprocess) SetID(newid int64) {
m.UpdateID(newid)
}
// // GetIDName - ID interface
// func (m ModelCoreMasterprocess) GetIDName() string {
// return "rid_masterprocess"
// }
func (m *ModelCoreMasterprocess) UpdateID(newid int64) {
m.Ridmasterprocess = int32(newid)
}
// // GetPrefix - Returns a table prefix
// func (m ModelCoreMasterprocess) GetPrefix() string {
// return "MPR"
// }
// GetIDName - ID interface
func (m ModelCoreMasterprocess) GetIDName() string {
return "rid_masterprocess"
}
// // GetRowNumber - Returns the row number of the record
// func (m ModelCoreMasterprocess) GetRowNumber() int64 {
// return m.RowNumber
// }
// GetPrefix - Returns a table prefix
func (m ModelCoreMasterprocess) GetPrefix() string {
return "MPR"
}
// GetRowNumber - Returns the row number of the record
func (m ModelCoreMasterprocess) GetRowNumber() int64 {
return m.RowNumber
}
// SetRowNumber - Set the row number of a record
func (m *ModelCoreMasterprocess) SetRowNumber(num int64) {
m.RowNumber = num
}
// // SetRowNumber - Set the row number of a record
// func (m *ModelCoreMasterprocess) SetRowNumber(num int64) {
// m.RowNumber = num
// }

View File

@@ -1,93 +1,89 @@
package models
import "fmt"
import db "github.com/bitechdev/GoCore/pkg/models"
import "github.com/bitechdev/GoCore/pkg/types"
// //ModelCoreMastertask - Generated Table for Schema core
// type ModelCoreMastertask struct {
// Allactionsmustcomplete types.SInt16 `json:"allactionsmustcomplete" gorm:"Column:allactionsmustcomplete;type:smallint;"`
// Condition string `json:"condition" gorm:"Column:condition;type:citext;"`
// Description string `json:"description" gorm:"Column:description;type:citext;"`
// Dueday types.SInt16 `json:"dueday" gorm:"Column:dueday;type:smallint;"`
// Dueoption string `json:"dueoption" gorm:"Column:dueoption;type:citext;"`
// Escalation types.ZNullInt32 `json:"escalation" gorm:"Column:escalation;type:integer;"`
// Escalationoption string `json:"escalationoption" gorm:"Column:escalationoption;type:citext;"`
// GUID types.NullableUUID `json:"guid" gorm:"Column:guid;type:uuid;default:newid();"`
// Inactive types.SInt16 `json:"inactive" gorm:"Column:inactive;type:smallint;"`
// Jsonvalue types.NullableJSONB `json:"jsonvalue" gorm:"Column:jsonvalue;type:jsonb;"`
// Mastertasknote string `json:"mastertasknote" gorm:"Column:mastertasknote;type:citext;"`
// Repeatinterval types.SInt16 `json:"repeatinterval" gorm:"Column:repeatinterval;type:smallint;"`
// Repeattype string `json:"repeattype" gorm:"Column:repeattype;type:citext;"`
// Ridjsonschema types.ZNullInt32 `json:"rid_jsonschema" gorm:"Column:rid_jsonschema;type:integer;"`
// Ridmasterprocess types.ZNullInt32 `json:"rid_masterprocess" gorm:"Column:rid_masterprocess;type:integer;"`
// Ridmastertask int32 `json:"rid_mastertask" gorm:"Column:rid_mastertask;type:integer;primaryKey;default:nextval('core.identity_mastertask_rid_mastertask'::regclass);"`
// Ridmastertypetasktype types.ZNullInt32 `json:"rid_mastertype_tasktype" gorm:"Column:rid_mastertype_tasktype;type:integer;"`
// Sequenceno types.ZNullInt32 `json:"sequenceno" gorm:"Column:sequenceno;type:integer;"`
// Singletask types.SInt16 `json:"singletask" gorm:"Column:singletask;type:smallint;"`
// Startday types.SInt16 `json:"startday" gorm:"Column:startday;type:smallint;"`
// Updatecnt int64 `json:"updatecnt" gorm:"Column:updatecnt;type:integer;default:0;"`
// JSON *ModelCoreJsonschema `json:"JSON,omitempty" gorm:"references:rid_jsonschema;foreignKey:rid_jsonschema;"`
// MPR *ModelCoreMasterprocess `json:"MPR,omitempty" gorm:"references:rid_masterprocess;foreignKey:rid_masterprocess;"`
// MTT *ModelCoreMastertype `json:"MTT,omitempty" gorm:"references:rid_mastertype_tasktype;foreignKey:rid_mastertype;"`
//ModelCoreMastertask - Generated Table for Schema core
type ModelCoreMastertask struct {
Allactionsmustcomplete types.SInt16 `json:"allactionsmustcomplete" gorm:"Column:allactionsmustcomplete;type:smallint;"`
Condition string `json:"condition" gorm:"Column:condition;type:citext;"`
Description string `json:"description" gorm:"Column:description;type:citext;"`
Dueday types.SInt16 `json:"dueday" gorm:"Column:dueday;type:smallint;"`
Dueoption string `json:"dueoption" gorm:"Column:dueoption;type:citext;"`
Escalation types.ZNullInt32 `json:"escalation" gorm:"Column:escalation;type:integer;"`
Escalationoption string `json:"escalationoption" gorm:"Column:escalationoption;type:citext;"`
GUID types.NullableUUID `json:"guid" gorm:"Column:guid;type:uuid;default:newid();"`
Inactive types.SInt16 `json:"inactive" gorm:"Column:inactive;type:smallint;"`
Jsonvalue types.NullableJSONB `json:"jsonvalue" gorm:"Column:jsonvalue;type:jsonb;"`
Mastertasknote string `json:"mastertasknote" gorm:"Column:mastertasknote;type:citext;"`
Repeatinterval types.SInt16 `json:"repeatinterval" gorm:"Column:repeatinterval;type:smallint;"`
Repeattype string `json:"repeattype" gorm:"Column:repeattype;type:citext;"`
Ridjsonschema types.ZNullInt32 `json:"rid_jsonschema" gorm:"Column:rid_jsonschema;type:integer;"`
Ridmasterprocess types.ZNullInt32 `json:"rid_masterprocess" gorm:"Column:rid_masterprocess;type:integer;"`
Ridmastertask int32 `json:"rid_mastertask" gorm:"Column:rid_mastertask;type:integer;primaryKey;default:nextval('core.identity_mastertask_rid_mastertask'::regclass);"`
Ridmastertypetasktype types.ZNullInt32 `json:"rid_mastertype_tasktype" gorm:"Column:rid_mastertype_tasktype;type:integer;"`
Sequenceno types.ZNullInt32 `json:"sequenceno" gorm:"Column:sequenceno;type:integer;"`
Singletask types.SInt16 `json:"singletask" gorm:"Column:singletask;type:smallint;"`
Startday types.SInt16 `json:"startday" gorm:"Column:startday;type:smallint;"`
Updatecnt int64 `json:"updatecnt" gorm:"Column:updatecnt;type:integer;default:0;"`
JSON *ModelCoreJsonschema `json:"JSON,omitempty" gorm:"references:rid_jsonschema;foreignKey:rid_jsonschema;"`
MPR *ModelCoreMasterprocess `json:"MPR,omitempty" gorm:"references:rid_masterprocess;foreignKey:rid_masterprocess;"`
MTT *ModelCoreMastertype `json:"MTT,omitempty" gorm:"references:rid_mastertype_tasktype;foreignKey:rid_mastertype;"`
// MAL []*ModelCoreMastertaskitem `json:"MAL,omitempty" gorm:"references:rid_mastertask;foreignKey:rid_mastertask;opt_c"`
// TAS []*ModelCoreTasklist `json:"TAS,omitempty" gorm:"references:rid_mastertask;foreignKey:rid_mastertask;opt_c"`
// db.DBAdhocBuffer `json:",omitempty"`
// db.DBGetIDInterface `json:",omitempty" gorm:"-"`
// types.SQLTypable `json:",omitempty" gorm:"-"`
// }
MAL []*ModelCoreMastertaskitem `json:"MAL,omitempty" gorm:"references:rid_mastertask;foreignKey:rid_mastertask;opt_c"`
TAS []*ModelCoreTasklist `json:"TAS,omitempty" gorm:"references:rid_mastertask;foreignKey:rid_mastertask;opt_c"`
db.DBAdhocBuffer `json:",omitempty"`
db.DBGetIDInterface `json:",omitempty" gorm:"-"`
types.SQLTypable `json:",omitempty" gorm:"-"`
}
// // TableName - Returns the table name for the object.
// func (m ModelCoreMastertask) TableName() string {
// return "core.mastertask"
// }
// TableName - Returns the table name for the object.
func (m ModelCoreMastertask) TableName() string {
return "core.mastertask"
}
// // TableName - Returns the table name for the object.
// func (m ModelCoreMastertask) TableNameOnly() string {
// return "mastertask"
// }
// TableName - Returns the table name for the object.
func (m ModelCoreMastertask) TableNameOnly() string {
return "mastertask"
}
// // SchemaName - Returns the schema name for the object.
// func (m ModelCoreMastertask) SchemaName() string {
// return "core"
// }
// SchemaName - Returns the schema name for the object.
func (m ModelCoreMastertask) SchemaName() string {
return "core"
}
// // GetID - ID interface
// func (m ModelCoreMastertask) GetID() int64 {
// return int64(m.Ridmastertask)
// }
// GetID - ID interface
func (m ModelCoreMastertask) GetID() int64 {
return int64(m.Ridmastertask)
}
// // GetIDStr - ID interface
// func (m ModelCoreMastertask) GetIDStr() string {
// return fmt.Sprintf("%d", m.Ridmastertask)
// }
// GetIDStr - ID interface
func (m ModelCoreMastertask) GetIDStr() string {
return fmt.Sprintf("%d", m.Ridmastertask)
}
// // SetID - ID interface
// func (m ModelCoreMastertask) SetID(newid int64) {
// m.UpdateID(newid)
// }
// SetID - ID interface
func (m ModelCoreMastertask) SetID(newid int64) {
m.UpdateID(newid)
}
// func (m *ModelCoreMastertask) UpdateID(newid int64) {
// m.Ridmastertask = int32(newid)
// }
func (m *ModelCoreMastertask) UpdateID(newid int64) {
m.Ridmastertask = int32(newid)
}
// // GetIDName - ID interface
// func (m ModelCoreMastertask) GetIDName() string {
// return "rid_mastertask"
// }
// GetIDName - ID interface
func (m ModelCoreMastertask) GetIDName() string {
return "rid_mastertask"
}
// // GetPrefix - Returns a table prefix
// func (m ModelCoreMastertask) GetPrefix() string {
// return "MTL"
// }
// GetPrefix - Returns a table prefix
func (m ModelCoreMastertask) GetPrefix() string {
return "MTL"
}
// // GetRowNumber - Returns the row number of the record
// func (m ModelCoreMastertask) GetRowNumber() int64 {
// return m.RowNumber
// }
// GetRowNumber - Returns the row number of the record
func (m ModelCoreMastertask) GetRowNumber() int64 {
return m.RowNumber
}
// SetRowNumber - Set the row number of a record
func (m *ModelCoreMastertask) SetRowNumber(num int64) {
m.RowNumber = num
}
// // SetRowNumber - Set the row number of a record
// func (m *ModelCoreMastertask) SetRowNumber(num int64) {
// m.RowNumber = num
// }

View File

@@ -1,98 +1,94 @@
package models
import "fmt"
import db "github.com/bitechdev/GoCore/pkg/models"
import "github.com/bitechdev/GoCore/pkg/types"
// //ModelCoreMastertype - Generated Table for Schema core
// type ModelCoreMastertype struct {
// Category string `json:"category" gorm:"Column:category;type:citext;"`
// Description string `json:"description" gorm:"Column:description;type:citext;"`
// Disableedit types.SInt16 `json:"disableedit" gorm:"Column:disableedit;type:smallint;"`
// Forprefix string `json:"forprefix" gorm:"Column:forprefix;type:citext;"`
// GUID types.NullableUUID `json:"guid" gorm:"Column:guid;type:uuid;default:newid();"`
// Hidden types.SInt16 `json:"hidden" gorm:"Column:hidden;type:smallint;"`
// Inactive types.SInt16 `json:"inactive" gorm:"Column:inactive;type:smallint;"`
// Jsonvalue types.NullableJSONB `json:"jsonvalue" gorm:"Column:jsonvalue;type:jsonb;"`
// Mastertype string `json:"mastertype" gorm:"Column:mastertype;type:citext;"`
// Note string `json:"note" gorm:"Column:note;type:citext;"`
// Ridmastertype int32 `json:"rid_mastertype" gorm:"Column:rid_mastertype;type:integer;primaryKey;default:nextval('core.identity_mastertype_rid_mastertype'::regclass);"`
// Ridparent types.ZNullInt32 `json:"rid_parent" gorm:"Column:rid_parent;type:integer;"`
// Updatecnt int64 `json:"updatecnt" gorm:"Column:updatecnt;type:integer;default:0;"`
// MTT *ModelCoreMastertype `json:"MTT,omitempty" gorm:"references:rid_mastertype;foreignKey:rid_parent;"`
//ModelCoreMastertype - Generated Table for Schema core
type ModelCoreMastertype struct {
Category string `json:"category" gorm:"Column:category;type:citext;"`
Description string `json:"description" gorm:"Column:description;type:citext;"`
Disableedit types.SInt16 `json:"disableedit" gorm:"Column:disableedit;type:smallint;"`
Forprefix string `json:"forprefix" gorm:"Column:forprefix;type:citext;"`
GUID types.NullableUUID `json:"guid" gorm:"Column:guid;type:uuid;default:newid();"`
Hidden types.SInt16 `json:"hidden" gorm:"Column:hidden;type:smallint;"`
Inactive types.SInt16 `json:"inactive" gorm:"Column:inactive;type:smallint;"`
Jsonvalue types.NullableJSONB `json:"jsonvalue" gorm:"Column:jsonvalue;type:jsonb;"`
Mastertype string `json:"mastertype" gorm:"Column:mastertype;type:citext;"`
Note string `json:"note" gorm:"Column:note;type:citext;"`
Ridmastertype int32 `json:"rid_mastertype" gorm:"Column:rid_mastertype;type:integer;primaryKey;default:nextval('core.identity_mastertype_rid_mastertype'::regclass);"`
Ridparent types.ZNullInt32 `json:"rid_parent" gorm:"Column:rid_parent;type:integer;"`
Updatecnt int64 `json:"updatecnt" gorm:"Column:updatecnt;type:integer;default:0;"`
MTT *ModelCoreMastertype `json:"MTT,omitempty" gorm:"references:rid_mastertype;foreignKey:rid_parent;"`
// CMAT []*ModelCoreCommitem_Attachment `json:"CMAT,omitempty" gorm:"references:rid_mastertype;foreignKey:rid_mastertype;opt_c"`
// DVT []*ModelCoreDocumentvault `json:"DVT,omitempty" gorm:"references:rid_mastertype;foreignKey:rid_mastertype;opt_c"`
// EAD []*ModelCoreEmailaddresslist `json:"EAD,omitempty" gorm:"references:rid_mastertype;foreignKey:rid_mastertype;opt_c"`
// JSON []*ModelCoreJsonschema `json:"JSON,omitempty" gorm:"references:rid_mastertype;foreignKey:rid_mastertype;opt_c"`
// MAL []*ModelCoreMastertaskitem `json:"MAL,omitempty" gorm:"references:rid_mastertype;foreignKey:rid_mastertype_hubtype;opt_c"`
// MPR_RID_MASTERTYPE_HUBTYPE []*ModelCoreMasterprocess `json:"MPR_RID_MASTERTYPE_HUBTYPE,omitempty" gorm:"references:rid_mastertype;foreignKey:rid_mastertype_hubtype;opt_c"`
// MPR_RID_MASTERTYPE_PROCESSTYPE []*ModelCoreMasterprocess `json:"MPR_RID_MASTERTYPE_PROCESSTYPE,omitempty" gorm:"references:rid_mastertype;foreignKey:rid_mastertype_processtype;opt_c"`
// MSE []*ModelCoreMasterservice `json:"MSE,omitempty" gorm:"references:rid_mastertype;foreignKey:rid_mastertype_hubtype;opt_c"`
// MTL []*ModelCoreMastertask `json:"MTL,omitempty" gorm:"references:rid_mastertype;foreignKey:rid_mastertype_tasktype;opt_c"`
// MTT_RID_PARENT []*ModelCoreMastertype `json:"MTT_RID_PARENT,omitempty" gorm:"references:rid_mastertype;foreignKey:rid_parent;opt_c"`
// RUL []*ModelCoreMasterworkflowrule `json:"RUL,omitempty" gorm:"references:rid_mastertype;foreignKey:rid_mastertype_group;opt_c"`
// TAT_RID_MASTERTYPE_DOCGENTYPE []*ModelCoreMasterdoctemplate `json:"TAT_RID_MASTERTYPE_DOCGENTYPE,omitempty" gorm:"references:rid_mastertype;foreignKey:rid_mastertype_docgentype;opt_c"`
// TAT_RID_MASTERTYPE_DOCUMENT []*ModelCoreMasterdoctemplate `json:"TAT_RID_MASTERTYPE_DOCUMENT,omitempty" gorm:"references:rid_mastertype;foreignKey:rid_mastertype_document;opt_c"`
// TAT_RID_MASTERTYPE_GROUP []*ModelCoreMasterdoctemplate `json:"TAT_RID_MASTERTYPE_GROUP,omitempty" gorm:"references:rid_mastertype;foreignKey:rid_mastertype_group;opt_c"`
// TAT_RID_MASTERTYPE_HUBTYPE []*ModelCoreMasterdoctemplate `json:"TAT_RID_MASTERTYPE_HUBTYPE,omitempty" gorm:"references:rid_mastertype;foreignKey:rid_mastertype_hubtype;opt_c"`
// TAT_RID_MASTERTYPE_MERGETYPE []*ModelCoreMasterdoctemplate `json:"TAT_RID_MASTERTYPE_MERGETYPE,omitempty" gorm:"references:rid_mastertype;foreignKey:rid_mastertype_mergetype;opt_c"`
// TAT_RID_MASTERTYPE_TARGETTYPE []*ModelCoreMasterdoctemplate `json:"TAT_RID_MASTERTYPE_TARGETTYPE,omitempty" gorm:"references:rid_mastertype;foreignKey:rid_mastertype_targettype;opt_c"`
// db.DBAdhocBuffer `json:",omitempty"`
// db.DBGetIDInterface `json:",omitempty" gorm:"-"`
// types.SQLTypable `json:",omitempty" gorm:"-"`
// }
CMAT []*ModelCoreCommitem_Attachment `json:"CMAT,omitempty" gorm:"references:rid_mastertype;foreignKey:rid_mastertype;opt_c"`
DVT []*ModelCoreDocumentvault `json:"DVT,omitempty" gorm:"references:rid_mastertype;foreignKey:rid_mastertype;opt_c"`
EAD []*ModelCoreEmailaddresslist `json:"EAD,omitempty" gorm:"references:rid_mastertype;foreignKey:rid_mastertype;opt_c"`
JSON []*ModelCoreJsonschema `json:"JSON,omitempty" gorm:"references:rid_mastertype;foreignKey:rid_mastertype;opt_c"`
MAL []*ModelCoreMastertaskitem `json:"MAL,omitempty" gorm:"references:rid_mastertype;foreignKey:rid_mastertype_hubtype;opt_c"`
MPR_RID_MASTERTYPE_HUBTYPE []*ModelCoreMasterprocess `json:"MPR_RID_MASTERTYPE_HUBTYPE,omitempty" gorm:"references:rid_mastertype;foreignKey:rid_mastertype_hubtype;opt_c"`
MPR_RID_MASTERTYPE_PROCESSTYPE []*ModelCoreMasterprocess `json:"MPR_RID_MASTERTYPE_PROCESSTYPE,omitempty" gorm:"references:rid_mastertype;foreignKey:rid_mastertype_processtype;opt_c"`
MSE []*ModelCoreMasterservice `json:"MSE,omitempty" gorm:"references:rid_mastertype;foreignKey:rid_mastertype_hubtype;opt_c"`
MTL []*ModelCoreMastertask `json:"MTL,omitempty" gorm:"references:rid_mastertype;foreignKey:rid_mastertype_tasktype;opt_c"`
MTT_RID_PARENT []*ModelCoreMastertype `json:"MTT_RID_PARENT,omitempty" gorm:"references:rid_mastertype;foreignKey:rid_parent;opt_c"`
RUL []*ModelCoreMasterworkflowrule `json:"RUL,omitempty" gorm:"references:rid_mastertype;foreignKey:rid_mastertype_group;opt_c"`
TAT_RID_MASTERTYPE_DOCGENTYPE []*ModelCoreMasterdoctemplate `json:"TAT_RID_MASTERTYPE_DOCGENTYPE,omitempty" gorm:"references:rid_mastertype;foreignKey:rid_mastertype_docgentype;opt_c"`
TAT_RID_MASTERTYPE_DOCUMENT []*ModelCoreMasterdoctemplate `json:"TAT_RID_MASTERTYPE_DOCUMENT,omitempty" gorm:"references:rid_mastertype;foreignKey:rid_mastertype_document;opt_c"`
TAT_RID_MASTERTYPE_GROUP []*ModelCoreMasterdoctemplate `json:"TAT_RID_MASTERTYPE_GROUP,omitempty" gorm:"references:rid_mastertype;foreignKey:rid_mastertype_group;opt_c"`
TAT_RID_MASTERTYPE_HUBTYPE []*ModelCoreMasterdoctemplate `json:"TAT_RID_MASTERTYPE_HUBTYPE,omitempty" gorm:"references:rid_mastertype;foreignKey:rid_mastertype_hubtype;opt_c"`
TAT_RID_MASTERTYPE_MERGETYPE []*ModelCoreMasterdoctemplate `json:"TAT_RID_MASTERTYPE_MERGETYPE,omitempty" gorm:"references:rid_mastertype;foreignKey:rid_mastertype_mergetype;opt_c"`
TAT_RID_MASTERTYPE_TARGETTYPE []*ModelCoreMasterdoctemplate `json:"TAT_RID_MASTERTYPE_TARGETTYPE,omitempty" gorm:"references:rid_mastertype;foreignKey:rid_mastertype_targettype;opt_c"`
db.DBAdhocBuffer `json:",omitempty"`
db.DBGetIDInterface `json:",omitempty" gorm:"-"`
types.SQLTypable `json:",omitempty" gorm:"-"`
}
// // TableName - Returns the table name for the object.
// func (m ModelCoreMastertype) TableName() string {
// return "core.mastertype"
// }
// TableName - Returns the table name for the object.
func (m ModelCoreMastertype) TableName() string {
return "core.mastertype"
}
// // TableName - Returns the table name for the object.
// func (m ModelCoreMastertype) TableNameOnly() string {
// return "mastertype"
// }
// TableName - Returns the table name for the object.
func (m ModelCoreMastertype) TableNameOnly() string {
return "mastertype"
}
// // SchemaName - Returns the schema name for the object.
// func (m ModelCoreMastertype) SchemaName() string {
// return "core"
// }
// SchemaName - Returns the schema name for the object.
func (m ModelCoreMastertype) SchemaName() string {
return "core"
}
// // GetID - ID interface
// func (m ModelCoreMastertype) GetID() int64 {
// return int64(m.Ridmastertype)
// }
// GetID - ID interface
func (m ModelCoreMastertype) GetID() int64 {
return int64(m.Ridmastertype)
}
// // GetIDStr - ID interface
// func (m ModelCoreMastertype) GetIDStr() string {
// return fmt.Sprintf("%d", m.Ridmastertype)
// }
// GetIDStr - ID interface
func (m ModelCoreMastertype) GetIDStr() string {
return fmt.Sprintf("%d", m.Ridmastertype)
}
// // SetID - ID interface
// func (m ModelCoreMastertype) SetID(newid int64) {
// m.UpdateID(newid)
// }
// SetID - ID interface
func (m ModelCoreMastertype) SetID(newid int64) {
m.UpdateID(newid)
}
// func (m *ModelCoreMastertype) UpdateID(newid int64) {
// m.Ridmastertype = int32(newid)
// }
func (m *ModelCoreMastertype) UpdateID(newid int64) {
m.Ridmastertype = int32(newid)
}
// // GetIDName - ID interface
// func (m ModelCoreMastertype) GetIDName() string {
// return "rid_mastertype"
// }
// GetIDName - ID interface
func (m ModelCoreMastertype) GetIDName() string {
return "rid_mastertype"
}
// // GetPrefix - Returns a table prefix
// func (m ModelCoreMastertype) GetPrefix() string {
// return "MTT"
// }
// GetPrefix - Returns a table prefix
func (m ModelCoreMastertype) GetPrefix() string {
return "MTT"
}
// // GetRowNumber - Returns the row number of the record
// func (m ModelCoreMastertype) GetRowNumber() int64 {
// return m.RowNumber
// }
// GetRowNumber - Returns the row number of the record
func (m ModelCoreMastertype) GetRowNumber() int64 {
return m.RowNumber
}
// SetRowNumber - Set the row number of a record
func (m *ModelCoreMastertype) SetRowNumber(num int64) {
m.RowNumber = num
}
// // SetRowNumber - Set the row number of a record
// func (m *ModelCoreMastertype) SetRowNumber(num int64) {
// m.RowNumber = num
// }

View File

@@ -1,80 +1,76 @@
package models
import "fmt"
import db "github.com/bitechdev/GoCore/pkg/models"
import "github.com/bitechdev/GoCore/pkg/types"
// //ModelCoreProcess - Generated Table for Schema core
// type ModelCoreProcess struct {
// Completedate types.CustomDate `json:"completedate" gorm:"Column:completedate;type:date;"`
// Completetime types.CustomIntTime `json:"completetime" gorm:"Column:completetime;type:integer;"`
// Description string `json:"description" gorm:"Column:description;type:citext;"`
// GUID types.NullableUUID `json:"guid" gorm:"Column:guid;type:uuid;default:newid();"`
// Ridcompleteuser types.ZNullInt32 `json:"rid_completeuser" gorm:"Column:rid_completeuser;type:integer;"`
// Ridhub types.ZNullInt32 `json:"rid_hub" gorm:"Column:rid_hub;type:integer;"`
// Ridmasterprocess types.ZNullInt32 `json:"rid_masterprocess" gorm:"Column:rid_masterprocess;type:integer;"`
// Ridprocess int32 `json:"rid_process" gorm:"Column:rid_process;type:integer;primaryKey;default:nextval('core.identity_process_rid_process'::regclass);"`
// Status string `json:"status" gorm:"Column:status;type:citext;"`
// Updatecnt int64 `json:"updatecnt" gorm:"Column:updatecnt;type:integer;default:0;"`
// HUB *ModelCoreHub `json:"HUB,omitempty" gorm:"references:rid_hub;foreignKey:rid_hub;"`
// MPR *ModelCoreMasterprocess `json:"MPR,omitempty" gorm:"references:rid_masterprocess;foreignKey:rid_masterprocess;"`
//ModelCoreProcess - Generated Table for Schema core
type ModelCoreProcess struct {
Completedate types.CustomDate `json:"completedate" gorm:"Column:completedate;type:date;"`
Completetime types.CustomIntTime `json:"completetime" gorm:"Column:completetime;type:integer;"`
Description string `json:"description" gorm:"Column:description;type:citext;"`
GUID types.NullableUUID `json:"guid" gorm:"Column:guid;type:uuid;default:newid();"`
Ridcompleteuser types.ZNullInt32 `json:"rid_completeuser" gorm:"Column:rid_completeuser;type:integer;"`
Ridhub types.ZNullInt32 `json:"rid_hub" gorm:"Column:rid_hub;type:integer;"`
Ridmasterprocess types.ZNullInt32 `json:"rid_masterprocess" gorm:"Column:rid_masterprocess;type:integer;"`
Ridprocess int32 `json:"rid_process" gorm:"Column:rid_process;type:integer;primaryKey;default:nextval('core.identity_process_rid_process'::regclass);"`
Status string `json:"status" gorm:"Column:status;type:citext;"`
Updatecnt int64 `json:"updatecnt" gorm:"Column:updatecnt;type:integer;default:0;"`
HUB *ModelCoreHub `json:"HUB,omitempty" gorm:"references:rid_hub;foreignKey:rid_hub;"`
MPR *ModelCoreMasterprocess `json:"MPR,omitempty" gorm:"references:rid_masterprocess;foreignKey:rid_masterprocess;"`
// TAS []*ModelCoreTasklist `json:"TAS,omitempty" gorm:"references:rid_process;foreignKey:rid_process;opt_c"`
// db.DBAdhocBuffer `json:",omitempty"`
// db.DBGetIDInterface `json:",omitempty" gorm:"-"`
// types.SQLTypable `json:",omitempty" gorm:"-"`
// }
TAS []*ModelCoreTasklist `json:"TAS,omitempty" gorm:"references:rid_process;foreignKey:rid_process;opt_c"`
db.DBAdhocBuffer `json:",omitempty"`
db.DBGetIDInterface `json:",omitempty" gorm:"-"`
types.SQLTypable `json:",omitempty" gorm:"-"`
}
// // TableName - Returns the table name for the object.
// func (m ModelCoreProcess) TableName() string {
// return "core.process"
// }
// TableName - Returns the table name for the object.
func (m ModelCoreProcess) TableName() string {
return "core.process"
}
// // TableName - Returns the table name for the object.
// func (m ModelCoreProcess) TableNameOnly() string {
// return "process"
// }
// TableName - Returns the table name for the object.
func (m ModelCoreProcess) TableNameOnly() string {
return "process"
}
// // SchemaName - Returns the schema name for the object.
// func (m ModelCoreProcess) SchemaName() string {
// return "core"
// }
// SchemaName - Returns the schema name for the object.
func (m ModelCoreProcess) SchemaName() string {
return "core"
}
// // GetID - ID interface
// func (m ModelCoreProcess) GetID() int64 {
// return int64(m.Ridprocess)
// }
// GetID - ID interface
func (m ModelCoreProcess) GetID() int64 {
return int64(m.Ridprocess)
}
// // GetIDStr - ID interface
// func (m ModelCoreProcess) GetIDStr() string {
// return fmt.Sprintf("%d", m.Ridprocess)
// }
// GetIDStr - ID interface
func (m ModelCoreProcess) GetIDStr() string {
return fmt.Sprintf("%d", m.Ridprocess)
}
// // SetID - ID interface
// func (m ModelCoreProcess) SetID(newid int64) {
// m.UpdateID(newid)
// }
// SetID - ID interface
func (m ModelCoreProcess) SetID(newid int64) {
m.UpdateID(newid)
}
// func (m *ModelCoreProcess) UpdateID(newid int64) {
// m.Ridprocess = int32(newid)
// }
func (m *ModelCoreProcess) UpdateID(newid int64) {
m.Ridprocess = int32(newid)
}
// // GetIDName - ID interface
// func (m ModelCoreProcess) GetIDName() string {
// return "rid_process"
// }
// GetIDName - ID interface
func (m ModelCoreProcess) GetIDName() string {
return "rid_process"
}
// // GetPrefix - Returns a table prefix
// func (m ModelCoreProcess) GetPrefix() string {
// return "PRO"
// }
// GetPrefix - Returns a table prefix
func (m ModelCoreProcess) GetPrefix() string {
return "PRO"
}
// // GetRowNumber - Returns the row number of the record
// func (m ModelCoreProcess) GetRowNumber() int64 {
// return m.RowNumber
// }
// GetRowNumber - Returns the row number of the record
func (m ModelCoreProcess) GetRowNumber() int64 {
return m.RowNumber
}
// SetRowNumber - Set the row number of a record
func (m *ModelCoreProcess) SetRowNumber(num int64) {
m.RowNumber = num
}
// // SetRowNumber - Set the row number of a record
// func (m *ModelCoreProcess) SetRowNumber(num int64) {
// m.RowNumber = num
// }

19
examples/test_schema.dbml Normal file
View File

@@ -0,0 +1,19 @@
// Test schema for conversion
Table public.users {
id bigint [pk, increment]
email varchar(255) [unique, not null]
name varchar(100)
created_at timestamp [not null]
updated_at timestamp
}
Table public.posts {
id bigint [pk, increment]
user_id bigint [not null]
title varchar(200) [not null]
content text
published boolean [default: false]
created_at timestamp [not null]
}
Ref: public.posts.user_id > public.users.id [ondelete: CASCADE]