github.com/NpoolPlatform/chain-middleware@v0.0.0-20240228100535-eb1bcf896eb9/pkg/db/ent/schema/coinextra.go (about)

     1  package schema
     2  
     3  import (
     4  	"entgo.io/ent"
     5  	"entgo.io/ent/schema/field"
     6  	"github.com/NpoolPlatform/chain-middleware/pkg/db/mixin"
     7  	crudermixin "github.com/NpoolPlatform/libent-cruder/pkg/mixin"
     8  	"github.com/google/uuid"
     9  )
    10  
    11  // CoinExtra holds the schema definition for the CoinExtra entity.
    12  type CoinExtra struct {
    13  	ent.Schema
    14  }
    15  
    16  func (CoinExtra) Mixin() []ent.Mixin {
    17  	return []ent.Mixin{
    18  		mixin.TimeMixin{},
    19  		crudermixin.AutoIDMixin{},
    20  	}
    21  }
    22  
    23  // Fields of the CoinExtra.
    24  func (CoinExtra) Fields() []ent.Field {
    25  	return []ent.Field{
    26  		field.
    27  			UUID("coin_type_id", uuid.UUID{}).
    28  			Optional().
    29  			Default(uuid.New),
    30  		field.
    31  			String("home_page").
    32  			Optional().
    33  			Default(""),
    34  		field.
    35  			String("specs").
    36  			Optional().
    37  			Default(""),
    38  		field.
    39  			Bool("stable_usd").
    40  			Optional().
    41  			Default(false),
    42  	}
    43  }
    44  
    45  // Edges of the CoinExtra.
    46  func (CoinExtra) Edges() []ent.Edge {
    47  	return nil
    48  }