Copy the core payments/db code into payments/db/migration1 and add the required sqlc-generated types/queries from sqldb/sqlc. This effectively freezes the migration code so it stays robust against future query or schema changes in the main payments package. Replace the delegation to channeldb.ReadElement/WriteElement with self-contained, frozen implementations that only handle the exact types required by this migration package. This removes the dependency on the live channeldb codec so that future changes to channeldb serialization cannot silently corrupt or break the migration. UnknownElementType is also defined locally for the same reason.
111 lines
2.1 KiB
Go
111 lines
2.1 KiB
Go
// Code generated by sqlc. DO NOT EDIT.
|
|
// versions:
|
|
// sqlc v1.29.0
|
|
|
|
package sqlc
|
|
|
|
import (
|
|
"database/sql"
|
|
"time"
|
|
)
|
|
|
|
type Payment struct {
|
|
ID int64
|
|
AmountMsat int64
|
|
CreatedAt time.Time
|
|
PaymentIdentifier []byte
|
|
FailReason sql.NullInt32
|
|
}
|
|
|
|
type PaymentAttemptFirstHopCustomRecord struct {
|
|
ID int64
|
|
HtlcAttemptIndex int64
|
|
Key int64
|
|
Value []byte
|
|
}
|
|
|
|
type PaymentDuplicate struct {
|
|
ID int64
|
|
PaymentID int64
|
|
AmountMsat int64
|
|
CreatedAt time.Time
|
|
FailReason sql.NullInt32
|
|
SettlePreimage []byte
|
|
SettleTime sql.NullTime
|
|
}
|
|
|
|
type PaymentFirstHopCustomRecord struct {
|
|
ID int64
|
|
PaymentID int64
|
|
Key int64
|
|
Value []byte
|
|
}
|
|
|
|
type PaymentHopCustomRecord struct {
|
|
ID int64
|
|
HopID int64
|
|
Key int64
|
|
Value []byte
|
|
}
|
|
|
|
type PaymentHtlcAttempt struct {
|
|
ID int64
|
|
AttemptIndex int64
|
|
PaymentID int64
|
|
SessionKey []byte
|
|
AttemptTime time.Time
|
|
PaymentHash []byte
|
|
FirstHopAmountMsat int64
|
|
RouteTotalTimeLock int32
|
|
RouteTotalAmount int64
|
|
RouteSourceKey []byte
|
|
}
|
|
|
|
type PaymentHtlcAttemptResolution struct {
|
|
AttemptIndex int64
|
|
ResolutionTime time.Time
|
|
ResolutionType int32
|
|
SettlePreimage []byte
|
|
FailureSourceIndex sql.NullInt32
|
|
HtlcFailReason sql.NullInt32
|
|
FailureMsg []byte
|
|
}
|
|
|
|
type PaymentIntent struct {
|
|
ID int64
|
|
PaymentID int64
|
|
IntentType int16
|
|
IntentPayload []byte
|
|
}
|
|
|
|
type PaymentRouteHop struct {
|
|
ID int64
|
|
HtlcAttemptIndex int64
|
|
HopIndex int32
|
|
PubKey []byte
|
|
Scid string
|
|
OutgoingTimeLock int32
|
|
AmtToForward int64
|
|
MetaData []byte
|
|
}
|
|
|
|
type PaymentRouteHopAmp struct {
|
|
HopID int64
|
|
RootShare []byte
|
|
SetID []byte
|
|
ChildIndex int32
|
|
}
|
|
|
|
type PaymentRouteHopBlinded struct {
|
|
HopID int64
|
|
EncryptedData []byte
|
|
BlindingPoint []byte
|
|
BlindedPathTotalAmt sql.NullInt64
|
|
}
|
|
|
|
type PaymentRouteHopMpp struct {
|
|
HopID int64
|
|
PaymentAddr []byte
|
|
TotalMsat int64
|
|
}
|