From b99be1f59fa6d34fc75b203624d0be6a1e32fa75 Mon Sep 17 00:00:00 2001 From: mrz1836 Date: Wed, 6 Apr 2022 12:03:45 -0400 Subject: [PATCH] Use null field --- model_paymails.go | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/model_paymails.go b/model_paymails.go index 7dec7b36..015c88e6 100644 --- a/model_paymails.go +++ b/model_paymails.go @@ -2,7 +2,6 @@ package bux import ( "context" - "database/sql" "errors" "github.com/BuxOrg/bux/datastore" @@ -22,13 +21,13 @@ type PaymailAddress struct { Model `bson:",inline"` // Model specific fields - ID string `json:"id" toml:"id" yaml:"id" gorm:"<-:create;type:char(64);primaryKey;comment:This is the unique paymail record id" bson:"_id"` // Unique identifier - XpubID string `json:"xpub_id" toml:"xpub_id" yaml:"xpub_id" gorm:"<-:create;type:char(64);index;comment:This is the related xPub" bson:"xpub_id"` // Related xPub ID - Alias string `json:"alias" toml:"alias" yaml:"alias" gorm:"<-;type:varchar(64);comment:This is alias@" bson:"alias"` // Alias part of the paymail - Domain string `json:"domain" toml:"domain" yaml:"domain" gorm:"<-;type:varchar(255);comment:This is @domain.com" bson:"domain"` // Domain of the paymail - Username sql.NullString `json:"username" toml:"username" yaml:"username" gorm:"<-;type:varchar(255);uniqueIndex;comment:This is username" bson:"username"` // Full username - Avatar string `json:"avatar" toml:"avatar" yaml:"avatar" gorm:"<-;type:text;comment:This is avatar url" bson:"avatar"` // This is the url of the user (public profile) - ExternalXpubKey string `json:"external_xpub_key" toml:"external_xpub_key" yaml:"external_xpub_key" gorm:"<-:create;type:varchar(512);index;comment:This is full xPub for external use, encryption optional" bson:"external_xpub_key"` // PublicKey hex encoded + ID string `json:"id" toml:"id" yaml:"id" gorm:"<-:create;type:char(64);primaryKey;comment:This is the unique paymail record id" bson:"_id"` // Unique identifier + XpubID string `json:"xpub_id" toml:"xpub_id" yaml:"xpub_id" gorm:"<-:create;type:char(64);index;comment:This is the related xPub" bson:"xpub_id"` // Related xPub ID + Alias string `json:"alias" toml:"alias" yaml:"alias" gorm:"<-;type:varchar(64);comment:This is alias@" bson:"alias"` // Alias part of the paymail + Domain string `json:"domain" toml:"domain" yaml:"domain" gorm:"<-;type:varchar(255);comment:This is @domain.com" bson:"domain"` // Domain of the paymail + Username utils.NullString `json:"username" toml:"username" yaml:"username" gorm:"<-;type:varchar(255);uniqueIndex;comment:This is username" bson:"username,omitempty"` // Full username + Avatar string `json:"avatar" toml:"avatar" yaml:"avatar" gorm:"<-;type:text;comment:This is avatar url" bson:"avatar"` // This is the url of the user (public profile) + ExternalXpubKey string `json:"external_xpub_key" toml:"external_xpub_key" yaml:"external_xpub_key" gorm:"<-:create;type:varchar(512);index;comment:This is full xPub for external use, encryption optional" bson:"external_xpub_key"` // PublicKey hex encoded // Private fields externalXpubKeyDecrypted string