diff --git a/compose/types/attachment.go b/compose/types/attachment.go index 60b53068f..2c8b324e4 100644 --- a/compose/types/attachment.go +++ b/compose/types/attachment.go @@ -12,19 +12,19 @@ import ( type ( Attachment struct { - ID uint64 `db:"id" json:"attachmentID,string"` - OwnerID uint64 `db:"rel_owner" json:"ownerID,string"` - Kind string `db:"kind" json:"-"` - Url string `db:"url" json:"url,omitempty"` - PreviewUrl string `db:"preview_url" json:"previewUrl,omitempty"` - Name string `db:"name" json:"name,omitempty"` - Meta attachmentMeta `db:"meta" json:"meta"` + ID uint64 `json:"attachmentID,string"` + OwnerID uint64 `json:"ownerID,string"` + Kind string `json:"-"` + Url string `json:"url,omitempty"` + PreviewUrl string `json:"previewUrl,omitempty"` + Name string `json:"name,omitempty"` + Meta attachmentMeta `json:"meta"` - NamespaceID uint64 `db:"rel_namespace" json:"namespaceID,string"` + NamespaceID uint64 `json:"namespaceID,string"` - CreatedAt time.Time `db:"created_at" json:"createdAt,omitempty"` - UpdatedAt *time.Time `db:"updated_at" json:"updatedAt,omitempty"` - DeletedAt *time.Time `db:"deleted_at" json:"deletedAt,omitempty"` + CreatedAt time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` } // AttachmentFilter is used for filtering and as a return value from Find diff --git a/compose/types/chart.go b/compose/types/chart.go index d6df2134d..0879dc34f 100644 --- a/compose/types/chart.go +++ b/compose/types/chart.go @@ -14,16 +14,16 @@ import ( type ( Chart struct { - ID uint64 `json:"chartID,string" db:"id"` - Handle string `json:"handle" db:"handle"` - Name string `json:"name" db:"name"` - Config ChartConfig `json:"config" db:"config"` + ID uint64 `json:"chartID,string"` + Handle string `json:"handle"` + Name string `json:"name"` + Config ChartConfig `json:"config"` NamespaceID uint64 `json:"namespaceID,string" db:"rel_namespace,string"` - CreatedAt time.Time `db:"created_at" json:"createdAt,omitempty"` - UpdatedAt *time.Time `db:"updated_at" json:"updatedAt,omitempty"` - DeletedAt *time.Time `db:"deleted_at" json:"deletedAt,omitempty"` + CreatedAt time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` } ChartConfig struct { diff --git a/compose/types/module.go b/compose/types/module.go index 44c19245a..31cd730af 100644 --- a/compose/types/module.go +++ b/compose/types/module.go @@ -12,17 +12,17 @@ import ( type ( Module struct { - ID uint64 `json:"moduleID,string" db:"id"` - Handle string `json:"handle" db:"handle"` - Name string `json:"name" db:"name"` - Meta types.JSONText `json:"meta" db:"json"` + ID uint64 `json:"moduleID,string"` + Handle string `json:"handle"` + Name string `json:"name"` + Meta types.JSONText `json:"meta"` Fields ModuleFieldSet `json:"fields" db:"-"` - NamespaceID uint64 `json:"namespaceID,string" db:"rel_namespace"` + NamespaceID uint64 `json:"namespaceID,string"` - CreatedAt time.Time `db:"created_at" json:"createdAt,omitempty"` - UpdatedAt *time.Time `db:"updated_at" json:"updatedAt,omitempty"` - DeletedAt *time.Time `db:"deleted_at" json:"deletedAt,omitempty"` + CreatedAt time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` } ModuleFilter struct { diff --git a/compose/types/module_field.go b/compose/types/module_field.go index 2ef388985..7d3e9903f 100644 --- a/compose/types/module_field.go +++ b/compose/types/module_field.go @@ -12,25 +12,25 @@ import ( type ( // Modules - CRM module definitions ModuleField struct { - ID uint64 `json:"fieldID,string" db:"id"` - ModuleID uint64 `json:"moduleID,string" db:"rel_module"` - Place int `json:"-" db:"place"` + ID uint64 `json:"fieldID,string"` + ModuleID uint64 `json:"moduleID,string"` + Place int `json:"-"` - Kind string `json:"kind" db:"kind"` - Name string `json:"name" db:"name"` - Label string `json:"label" db:"label"` + Kind string `json:"kind"` + Name string `json:"name"` + Label string `json:"label"` - Options ModuleFieldOptions `json:"options" db:"options"` + Options ModuleFieldOptions `json:"options"` - Private bool `json:"isPrivate" db:"is_private"` - Required bool `json:"isRequired" db:"is_required"` - Visible bool `json:"isVisible" db:"is_visible"` - Multi bool `json:"isMulti" db:"is_multi"` - DefaultValue RecordValueSet `json:"defaultValue" db:"default_value"` + Private bool `json:"isPrivate"` + Required bool `json:"isRequired"` + Visible bool `json:"isVisible"` + Multi bool `json:"isMulti"` + DefaultValue RecordValueSet `json:"defaultValue"` - CreatedAt time.Time `db:"created_at" json:"createdAt,omitempty"` - UpdatedAt *time.Time `db:"updated_at" json:"updatedAt,omitempty"` - DeletedAt *time.Time `db:"deleted_at" json:"deletedAt,omitempty"` + CreatedAt time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` } ) diff --git a/compose/types/namespace.go b/compose/types/namespace.go index ca7843b4f..e5b357f85 100644 --- a/compose/types/namespace.go +++ b/compose/types/namespace.go @@ -14,15 +14,15 @@ import ( type ( Namespace struct { - ID uint64 `db:"id" json:"namespaceID,string"` - Name string `db:"name" json:"name"` - Slug string `db:"slug" json:"slug"` - Enabled bool `db:"enabled" json:"enabled"` - Meta NamespaceMeta `db:"meta" json:"meta"` + ID uint64 `json:"namespaceID,string"` + Name string `json:"name"` + Slug string `json:"slug"` + Enabled bool `json:"enabled"` + Meta NamespaceMeta `json:"meta"` - CreatedAt time.Time `db:"created_at" json:"createdAt,omitempty"` - UpdatedAt *time.Time `db:"updated_at" json:"updatedAt,omitempty"` - DeletedAt *time.Time `db:"deleted_at" json:"deletedAt,omitempty"` + CreatedAt time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` } NamespaceFilter struct { diff --git a/compose/types/page.go b/compose/types/page.go index cfe420e9b..8d38980ee 100644 --- a/compose/types/page.go +++ b/compose/types/page.go @@ -15,27 +15,27 @@ import ( type ( // Page - page structure Page struct { - ID uint64 `json:"pageID,string" db:"id"` - SelfID uint64 `json:"selfID,string" db:"self_id"` + ID uint64 `json:"pageID,string"` + SelfID uint64 `json:"selfID,string"` - NamespaceID uint64 `json:"namespaceID,string" db:"rel_namespace"` + NamespaceID uint64 `json:"namespaceID,string"` - ModuleID uint64 `json:"moduleID,string" db:"rel_module"` + ModuleID uint64 `json:"moduleID,string"` - Handle string `json:"handle" db:"handle"` - Title string `json:"title" db:"title"` - Description string `json:"description" db:"description"` + Handle string `json:"handle"` + Title string `json:"title"` + Description string `json:"description"` - Blocks PageBlocks `json:"blocks" db:"blocks"` + Blocks PageBlocks `json:"blocks"` Children PageSet `json:"children,omitempty" db:"-"` - Visible bool `json:"visible" db:"visible"` - Weight int `json:"weight" db:"weight"` + Visible bool `json:"visible"` + Weight int `json:"weight"` - CreatedAt time.Time `db:"created_at" json:"createdAt,omitempty"` - UpdatedAt *time.Time `db:"updated_at" json:"updatedAt,omitempty"` - DeletedAt *time.Time `db:"deleted_at" json:"deletedAt,omitempty"` + CreatedAt time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` } PageBlocks []PageBlock diff --git a/compose/types/record.go b/compose/types/record.go index 90eb34dd0..adc8d4572 100644 --- a/compose/types/record.go +++ b/compose/types/record.go @@ -32,20 +32,20 @@ type ( // Record is a stored row in the `record` table Record struct { - ID uint64 `json:"recordID,string" db:"id"` - ModuleID uint64 `json:"moduleID,string" db:"module_id"` + ID uint64 `json:"recordID,string"` + ModuleID uint64 `json:"moduleID,string"` Values RecordValueSet `json:"values,omitempty" db:"-"` - NamespaceID uint64 `json:"namespaceID,string" db:"rel_namespace"` + NamespaceID uint64 `json:"namespaceID,string"` - OwnedBy uint64 `db:"owned_by" json:"ownedBy,string"` - CreatedAt time.Time `db:"created_at" json:"createdAt,omitempty"` - CreatedBy uint64 `db:"created_by" json:"createdBy,string" ` - UpdatedAt *time.Time `db:"updated_at" json:"updatedAt,omitempty"` - UpdatedBy uint64 `db:"updated_by" json:"updatedBy,string,omitempty" ` - DeletedAt *time.Time `db:"deleted_at" json:"deletedAt,omitempty"` - DeletedBy uint64 `db:"deleted_by" json:"deletedBy,string,omitempty" ` + OwnedBy uint64 `json:"ownedBy,string"` + CreatedAt time.Time `json:"createdAt,omitempty"` + CreatedBy uint64 `json:"createdBy,string" ` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedBy uint64 `json:"updatedBy,string,omitempty" ` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy uint64 `json:"deletedBy,string,omitempty" ` } RecordFilter struct { diff --git a/compose/types/record_value.go b/compose/types/record_value.go index 1208bab26..4d330c326 100644 --- a/compose/types/record_value.go +++ b/compose/types/record_value.go @@ -12,12 +12,12 @@ import ( type ( // RecordValue is a stored row in the `record_value` table RecordValue struct { - RecordID uint64 `db:"record_id" json:"-"` - Name string `db:"name" json:"name"` - Value string `db:"value" json:"value,omitempty"` - Ref uint64 `db:"ref" json:"-"` - Place uint `db:"place" json:"-"` - DeletedAt *time.Time `db:"deleted_at" json:"deletedAt,omitempty"` + RecordID uint64 `json:"-"` + Name string `json:"name"` + Value string `json:"value,omitempty"` + Ref uint64 `json:"-"` + Place uint `json:"-"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` Updated bool `db:"-" json:"-"` OldValue string `db:"-" json:"-"` diff --git a/system/types/applications.go b/system/types/applications.go index 5e668cbe1..9656cc4ca 100644 --- a/system/types/applications.go +++ b/system/types/applications.go @@ -14,16 +14,16 @@ import ( type ( Application struct { - ID uint64 `json:"applicationID,string" db:"id"` - Name string `json:"name" db:"name"` - OwnerID uint64 `json:"ownerID" db:"rel_owner"` - Enabled bool `json:"enabled" db:"enabled"` + ID uint64 `json:"applicationID,string"` + Name string `json:"name"` + OwnerID uint64 `json:"ownerID"` + Enabled bool `json:"enabled"` - Unify *ApplicationUnify `json:"unify,omitempty" db:"unify"` + Unify *ApplicationUnify `json:"unify,omitempty"` - CreatedAt time.Time `json:"createdAt,omitempty" db:"created_at"` - UpdatedAt *time.Time `json:"updatedAt,omitempty" db:"updated_at"` - DeletedAt *time.Time `json:"deletedAt,omitempty" db:"deleted_at"` + CreatedAt time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` } ApplicationUnify struct { diff --git a/system/types/attachment.go b/system/types/attachment.go index 8c423c0cd..1d22928c0 100644 --- a/system/types/attachment.go +++ b/system/types/attachment.go @@ -11,17 +11,17 @@ import ( type ( Attachment struct { - ID uint64 `db:"id" json:"attachmentID,string"` - OwnerID uint64 `db:"rel_owner" json:"ownerID,string"` - Kind string `db:"kind" json:"-"` - Url string `db:"url" json:"url,omitempty"` - PreviewUrl string `db:"preview_url" json:"previewUrl,omitempty"` - Name string `db:"name" json:"name,omitempty"` - Meta attachmentMeta `db:"meta" json:"meta"` + ID uint64 `json:"attachmentID,string"` + OwnerID uint64 `json:"ownerID,string"` + Kind string `json:"-"` + Url string `json:"url,omitempty"` + PreviewUrl string `json:"previewUrl,omitempty"` + Name string `json:"name,omitempty"` + Meta attachmentMeta `json:"meta"` - CreatedAt time.Time `db:"created_at" json:"createdAt,omitempty"` - UpdatedAt *time.Time `db:"updated_at" json:"updatedAt,omitempty"` - DeletedAt *time.Time `db:"deleted_at" json:"deletedAt,omitempty"` + CreatedAt time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` } // AttachmentFilter is used for filtering and as a return value from Find diff --git a/system/types/credentials.go b/system/types/credentials.go index afa3e699e..899c3d13c 100644 --- a/system/types/credentials.go +++ b/system/types/credentials.go @@ -10,17 +10,17 @@ import ( type ( Credentials struct { - ID uint64 `json:"credentialsID,string" db:"id"` - OwnerID uint64 `json:"ownerID,string" db:"rel_owner"` - Label string `json:"label" db:"label"` - Kind string `json:"kind" db:"kind"` - Credentials string `json:"-" db:"credentials"` - Meta types.JSONText `json:"-" db:"meta"` - LastUsedAt *time.Time `json:"lastUsedAt,omitempty" db:"last_used_at"` - ExpiresAt *time.Time `json:"expiresAt,omitempty" db:"expires_at"` - CreatedAt time.Time `json:"createdAt,omitempty" db:"created_at"` - UpdatedAt *time.Time `json:"updatedAt,omitempty" db:"updated_at"` - DeletedAt *time.Time `json:"deletedAt,omitempty" db:"deleted_at"` + ID uint64 `json:"credentialsID,string"` + OwnerID uint64 `json:"ownerID,string"` + Label string `json:"label"` + Kind string `json:"kind"` + Credentials string `json:"-"` + Meta types.JSONText `json:"-"` + LastUsedAt *time.Time `json:"lastUsedAt,omitempty"` + ExpiresAt *time.Time `json:"expiresAt,omitempty"` + CreatedAt time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` } CredentialsFilter struct { diff --git a/system/types/reminder.go b/system/types/reminder.go index 64228504d..0511dcbc0 100644 --- a/system/types/reminder.go +++ b/system/types/reminder.go @@ -9,23 +9,23 @@ import ( type ( Reminder struct { - ID uint64 `json:"reminderID,string" db:"id"` - Resource string `json:"resource" db:"resource"` - Payload types.JSONText `json:"payload" db:"payload"` - SnoozeCount uint `json:"snoozeCount" db:"snooze_count"` + ID uint64 `json:"reminderID,string"` + Resource string `json:"resource"` + Payload types.JSONText `json:"payload"` + SnoozeCount uint `json:"snoozeCount"` - AssignedTo uint64 `json:"assignedTo,string" db:"assigned_to"` - AssignedBy uint64 `json:"assignedBy,string" db:"assigned_by"` - AssignedAt time.Time `json:"assignedAt" db:"assigned_at"` + AssignedTo uint64 `json:"assignedTo,string"` + AssignedBy uint64 `json:"assignedBy,string"` + AssignedAt time.Time `json:"assignedAt"` - DismissedBy uint64 `json:"dismissedBy,string" db:"dismissed_by"` - DismissedAt *time.Time `json:"dismissedAt" db:"dismissed_at"` + DismissedBy uint64 `json:"dismissedBy,string"` + DismissedAt *time.Time `json:"dismissedAt"` - RemindAt *time.Time `json:"remindAt" db:"remind_at"` + RemindAt *time.Time `json:"remindAt"` - CreatedAt time.Time `json:"createdAt,omitempty" db:"created_at"` - UpdatedAt *time.Time `json:"updatedAt,omitempty" db:"updated_at"` - DeletedAt *time.Time `json:"deletedAt,omitempty" db:"deleted_at"` + CreatedAt time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` } ReminderFilter struct { diff --git a/system/types/role.go b/system/types/role.go index 06edde388..abd7fb1e5 100644 --- a/system/types/role.go +++ b/system/types/role.go @@ -11,13 +11,13 @@ import ( type ( // Role - An organisation may have many roles. Roles may have many channels available. Access to channels may be shared between roles. Role struct { - ID uint64 `json:"roleID,string" db:"id"` - Name string `json:"name" db:"name"` - Handle string `json:"handle" db:"handle"` - CreatedAt time.Time `json:"createdAt,omitempty" db:"created_at"` - UpdatedAt *time.Time `json:"updatedAt,omitempty" db:"updated_at"` - ArchivedAt *time.Time `json:"archivedAt,omitempty" db:"archived_at"` - DeletedAt *time.Time `json:"deletedAt,omitempty" db:"deleted_at"` + ID uint64 `json:"roleID,string"` + Name string `json:"name"` + Handle string `json:"handle"` + CreatedAt time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + ArchivedAt *time.Time `json:"archivedAt,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` } RoleFilter struct { diff --git a/system/types/settings.go b/system/types/settings.go index 974406ced..f6ecf9eb9 100644 --- a/system/types/settings.go +++ b/system/types/settings.go @@ -12,15 +12,15 @@ import ( type ( SettingValue struct { - Name string `json:"name" db:"name"` - Value types.JSONText `json:"value" db:"value"` + Name string `json:"name"` + Value types.JSONText `json:"value"` // Setting owner, 0 for global settings - OwnedBy uint64 `json:"-" db:"rel_owner"` + OwnedBy uint64 `json:"-"` // Who updated & when - UpdatedAt time.Time `json:"updatedAt" db:"updated_at"` - UpdatedBy uint64 `json:"updatedBy" db:"updated_by"` + UpdatedAt time.Time `json:"updatedAt"` + UpdatedBy uint64 `json:"updatedBy"` } SettingsFilter struct { diff --git a/system/types/user.go b/system/types/user.go index cb174f53e..d84fbc3fb 100644 --- a/system/types/user.go +++ b/system/types/user.go @@ -15,21 +15,21 @@ import ( type ( User struct { - ID uint64 `json:"userID,string" db:"id"` - Username string `json:"username" db:"username"` - Email string `json:"email" db:"email"` - Name string `json:"name" db:"name"` - Handle string `json:"handle" db:"handle"` - Kind UserKind `json:"kind" db:"kind"` + ID uint64 `json:"userID,string"` + Username string `json:"username"` + Email string `json:"email"` + Name string `json:"name"` + Handle string `json:"handle"` + Kind UserKind `json:"kind"` - Meta *UserMeta `json:"meta" db:"meta"` + Meta *UserMeta `json:"meta"` - EmailConfirmed bool `json:"-" db:"email_confirmed"` + EmailConfirmed bool `json:"-"` - CreatedAt time.Time `json:"createdAt,omitempty" db:"created_at"` - UpdatedAt *time.Time `json:"updatedAt,omitempty" db:"updated_at"` - SuspendedAt *time.Time `json:"suspendedAt,omitempty" db:"suspended_at"` - DeletedAt *time.Time `json:"deletedAt,omitempty" db:"deleted_at"` + CreatedAt time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + SuspendedAt *time.Time `json:"suspendedAt,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` // Hold list of roles this user is member of. // we're using this for auth/identifier purposes, to support Roles() func