github.com/iasthc/atlas/cmd/atlas@v0.0.0-20230523071841-73246df3f88d/internal/migrate/ent/runtime.go (about)

     1  // Copyright 2021-present The Atlas Authors. All rights reserved.
     2  // This source code is licensed under the Apache 2.0 license found
     3  // in the LICENSE file in the root directory of this source tree.
     4  
     5  // Code generated by entc, DO NOT EDIT.
     6  
     7  package ent
     8  
     9  import (
    10  	"github.com/iasthc/atlas/cmd/atlas/internal/migrate/ent/revision"
    11  	"github.com/iasthc/atlas/cmd/atlas/internal/migrate/ent/schema"
    12  	"github.com/iasthc/atlas/sql/migrate"
    13  )
    14  
    15  // The init function reads all schema descriptors with runtime code
    16  // (default values, validators, hooks and policies) and stitches it
    17  // to their package variables.
    18  func init() {
    19  	revisionFields := schema.Revision{}.Fields()
    20  	_ = revisionFields
    21  	// revisionDescType is the schema descriptor for type field.
    22  	revisionDescType := revisionFields[2].Descriptor()
    23  	// revision.DefaultType holds the default value on creation for the type field.
    24  	revision.DefaultType = migrate.RevisionType(revisionDescType.Default.(uint))
    25  	// revisionDescApplied is the schema descriptor for applied field.
    26  	revisionDescApplied := revisionFields[3].Descriptor()
    27  	// revision.DefaultApplied holds the default value on creation for the applied field.
    28  	revision.DefaultApplied = revisionDescApplied.Default.(int)
    29  	// revision.AppliedValidator is a validator for the "applied" field. It is called by the builders before save.
    30  	revision.AppliedValidator = revisionDescApplied.Validators[0].(func(int) error)
    31  	// revisionDescTotal is the schema descriptor for total field.
    32  	revisionDescTotal := revisionFields[4].Descriptor()
    33  	// revision.DefaultTotal holds the default value on creation for the total field.
    34  	revision.DefaultTotal = revisionDescTotal.Default.(int)
    35  	// revision.TotalValidator is a validator for the "total" field. It is called by the builders before save.
    36  	revision.TotalValidator = revisionDescTotal.Validators[0].(func(int) error)
    37  }