// Copyright 2021-present The Atlas Authors. All rights reserved.
// This source code is licensed under the Apache 2.0 license found
// in the LICENSE file in the root directory of this source tree.

// Code generated by entc, DO NOT EDIT.

package ent

import "ariga.io/atlas/sql/migrate"

// SetRevision takes the values for each field from the given migrate.Revision.
func (rc *RevisionCreate) SetRevision(rev *migrate.Revision) *RevisionCreate {
	rc.SetID(rev.Version)
	rc.SetDescription(rev.Description)
	rc.SetType(rev.Type)
	rc.SetApplied(rev.Applied)
	rc.SetTotal(rev.Total)
	rc.SetExecutedAt(rev.ExecutedAt)
	rc.SetExecutionTime(rev.ExecutionTime)
	rc.SetError(rev.Error)
	rc.SetErrorStmt(rev.ErrorStmt)
	rc.SetHash(rev.Hash)
	rc.SetPartialHashes(rev.PartialHashes)
	rc.SetOperatorVersion(rev.OperatorVersion)
	return rc
}

// AtlasRevision returns an migrate.Revision from the current Revision.
func (_m *Revision) AtlasRevision() *migrate.Revision {
	return &migrate.Revision{
		Version:         _m.ID,
		Description:     _m.Description,
		Type:            _m.Type,
		Applied:         _m.Applied,
		Total:           _m.Total,
		ExecutedAt:      _m.ExecutedAt,
		ExecutionTime:   _m.ExecutionTime,
		Error:           _m.Error,
		ErrorStmt:       _m.ErrorStmt,
		Hash:            _m.Hash,
		PartialHashes:   _m.PartialHashes,
		OperatorVersion: _m.OperatorVersion,
	}
}
