// Code generated by ent, DO NOT EDIT.

package migrate

import (
	"entgo.io/ent/dialect/entsql"
	"entgo.io/ent/dialect/sql/schema"
	"entgo.io/ent/schema/field"
)

var (
	// BlockHeightsColumns holds the columns for the "block_heights" table.
	BlockHeightsColumns = []*schema.Column{
		{Name: "id", Type: field.TypeUUID},
		{Name: "create_time", Type: field.TypeTime},
		{Name: "update_time", Type: field.TypeTime},
		{Name: "height", Type: field.TypeInt64},
		{Name: "network", Type: field.TypeEnum, Enums: []string{"UNSPECIFIED", "MAINNET", "REGTEST", "TESTNET", "SIGNET"}},
	}
	// BlockHeightsTable holds the schema information for the "block_heights" table.
	BlockHeightsTable = &schema.Table{
		Name:       "block_heights",
		Columns:    BlockHeightsColumns,
		PrimaryKey: []*schema.Column{BlockHeightsColumns[0]},
	}
	// CooperativeExitsColumns holds the columns for the "cooperative_exits" table.
	CooperativeExitsColumns = []*schema.Column{
		{Name: "id", Type: field.TypeUUID},
		{Name: "create_time", Type: field.TypeTime},
		{Name: "update_time", Type: field.TypeTime},
		{Name: "exit_txid", Type: field.TypeBytes, Unique: true},
		{Name: "confirmation_height", Type: field.TypeInt64, Nullable: true},
		{Name: "cooperative_exit_transfer", Type: field.TypeUUID},
	}
	// CooperativeExitsTable holds the schema information for the "cooperative_exits" table.
	CooperativeExitsTable = &schema.Table{
		Name:       "cooperative_exits",
		Columns:    CooperativeExitsColumns,
		PrimaryKey: []*schema.Column{CooperativeExitsColumns[0]},
		ForeignKeys: []*schema.ForeignKey{
			{
				Symbol:     "cooperative_exits_transfers_transfer",
				Columns:    []*schema.Column{CooperativeExitsColumns[5]},
				RefColumns: []*schema.Column{TransfersColumns[0]},
				OnDelete:   schema.NoAction,
			},
		},
		Indexes: []*schema.Index{
			{
				Name:    "cooperativeexit_cooperative_exit_transfer",
				Unique:  false,
				Columns: []*schema.Column{CooperativeExitsColumns[5]},
			},
		},
	}
	// DepositAddressesColumns holds the columns for the "deposit_addresses" table.
	DepositAddressesColumns = []*schema.Column{
		{Name: "id", Type: field.TypeUUID},
		{Name: "create_time", Type: field.TypeTime},
		{Name: "update_time", Type: field.TypeTime},
		{Name: "address", Type: field.TypeString, Unique: true},
		{Name: "network", Type: field.TypeEnum, Nullable: true, Enums: []string{"UNSPECIFIED", "MAINNET", "REGTEST", "TESTNET", "SIGNET"}},
		{Name: "owner_identity_pubkey", Type: field.TypeBytes},
		{Name: "owner_signing_pubkey", Type: field.TypeBytes},
		{Name: "confirmation_height", Type: field.TypeInt64, Nullable: true},
		{Name: "confirmation_txid", Type: field.TypeString, Nullable: true},
		{Name: "address_signatures", Type: field.TypeJSON, Nullable: true},
		{Name: "possession_signature", Type: field.TypeBytes, Nullable: true},
		{Name: "node_id", Type: field.TypeUUID, Nullable: true},
		{Name: "is_static", Type: field.TypeBool, Default: false},
		{Name: "is_default", Type: field.TypeBool, Default: true},
		{Name: "deposit_address_signing_keyshare", Type: field.TypeUUID},
	}
	// DepositAddressesTable holds the schema information for the "deposit_addresses" table.
	DepositAddressesTable = &schema.Table{
		Name:       "deposit_addresses",
		Columns:    DepositAddressesColumns,
		PrimaryKey: []*schema.Column{DepositAddressesColumns[0]},
		ForeignKeys: []*schema.ForeignKey{
			{
				Symbol:     "deposit_addresses_signing_keyshares_signing_keyshare",
				Columns:    []*schema.Column{DepositAddressesColumns[14]},
				RefColumns: []*schema.Column{SigningKeysharesColumns[0]},
				OnDelete:   schema.NoAction,
			},
		},
		Indexes: []*schema.Index{
			{
				Name:    "depositaddress_address",
				Unique:  false,
				Columns: []*schema.Column{DepositAddressesColumns[3]},
			},
			{
				Name:    "depositaddress_owner_identity_pubkey",
				Unique:  false,
				Columns: []*schema.Column{DepositAddressesColumns[5]},
			},
			{
				Name:    "depositaddress_owner_signing_pubkey",
				Unique:  false,
				Columns: []*schema.Column{DepositAddressesColumns[6]},
			},
			{
				Name:    "depositaddress_deposit_address_signing_keyshare",
				Unique:  false,
				Columns: []*schema.Column{DepositAddressesColumns[14]},
			},
			{
				Name:    "depositaddress_network_owner_identity_pubkey",
				Unique:  true,
				Columns: []*schema.Column{DepositAddressesColumns[4], DepositAddressesColumns[5]},
				Annotation: &entsql.IndexAnnotation{
					Where: "is_static = true and is_default = true",
				},
			},
		},
	}
	// EntityDkgKeysColumns holds the columns for the "entity_dkg_keys" table.
	EntityDkgKeysColumns = []*schema.Column{
		{Name: "id", Type: field.TypeUUID},
		{Name: "create_time", Type: field.TypeTime},
		{Name: "update_time", Type: field.TypeTime},
		{Name: "key_type", Type: field.TypeString, Default: "initial_entity_dkg_key"},
		{Name: "entity_dkg_key_signing_keyshare", Type: field.TypeUUID},
	}
	// EntityDkgKeysTable holds the schema information for the "entity_dkg_keys" table.
	EntityDkgKeysTable = &schema.Table{
		Name:       "entity_dkg_keys",
		Columns:    EntityDkgKeysColumns,
		PrimaryKey: []*schema.Column{EntityDkgKeysColumns[0]},
		ForeignKeys: []*schema.ForeignKey{
			{
				Symbol:     "entity_dkg_keys_signing_keyshares_signing_keyshare",
				Columns:    []*schema.Column{EntityDkgKeysColumns[4]},
				RefColumns: []*schema.Column{SigningKeysharesColumns[0]},
				OnDelete:   schema.NoAction,
			},
		},
		Indexes: []*schema.Index{
			{
				Name:    "entitydkgkey_key_type",
				Unique:  true,
				Columns: []*schema.Column{EntityDkgKeysColumns[3]},
			},
		},
	}
	// GossipsColumns holds the columns for the "gossips" table.
	GossipsColumns = []*schema.Column{
		{Name: "id", Type: field.TypeUUID},
		{Name: "create_time", Type: field.TypeTime},
		{Name: "update_time", Type: field.TypeTime},
		{Name: "participants", Type: field.TypeJSON},
		{Name: "message", Type: field.TypeBytes},
		{Name: "receipts", Type: field.TypeBytes},
		{Name: "status", Type: field.TypeEnum, Enums: []string{"PENDING", "DELIVERED"}, Default: "PENDING"},
	}
	// GossipsTable holds the schema information for the "gossips" table.
	GossipsTable = &schema.Table{
		Name:       "gossips",
		Columns:    GossipsColumns,
		PrimaryKey: []*schema.Column{GossipsColumns[0]},
		Indexes: []*schema.Index{
			{
				Name:    "gossip_status",
				Unique:  false,
				Columns: []*schema.Column{GossipsColumns[6]},
			},
		},
	}
	// L1tokenCreatesColumns holds the columns for the "l1token_creates" table.
	L1tokenCreatesColumns = []*schema.Column{
		{Name: "id", Type: field.TypeUUID},
		{Name: "create_time", Type: field.TypeTime},
		{Name: "update_time", Type: field.TypeTime},
		{Name: "issuer_public_key", Type: field.TypeBytes},
		{Name: "token_name", Type: field.TypeString},
		{Name: "token_ticker", Type: field.TypeString},
		{Name: "decimals", Type: field.TypeUint8},
		{Name: "max_supply", Type: field.TypeBytes},
		{Name: "is_freezable", Type: field.TypeBool},
		{Name: "network", Type: field.TypeEnum, Enums: []string{"UNSPECIFIED", "MAINNET", "REGTEST", "TESTNET", "SIGNET"}},
		{Name: "token_identifier", Type: field.TypeBytes, Unique: true},
		{Name: "transaction_id", Type: field.TypeBytes, Unique: true},
	}
	// L1tokenCreatesTable holds the schema information for the "l1token_creates" table.
	L1tokenCreatesTable = &schema.Table{
		Name:       "l1token_creates",
		Columns:    L1tokenCreatesColumns,
		PrimaryKey: []*schema.Column{L1tokenCreatesColumns[0]},
		Indexes: []*schema.Index{
			{
				Name:    "l1tokencreate_issuer_public_key",
				Unique:  false,
				Columns: []*schema.Column{L1tokenCreatesColumns[3]},
			},
		},
	}
	// PaymentIntentsColumns holds the columns for the "payment_intents" table.
	PaymentIntentsColumns = []*schema.Column{
		{Name: "id", Type: field.TypeUUID},
		{Name: "create_time", Type: field.TypeTime},
		{Name: "update_time", Type: field.TypeTime},
		{Name: "payment_intent", Type: field.TypeString},
	}
	// PaymentIntentsTable holds the schema information for the "payment_intents" table.
	PaymentIntentsTable = &schema.Table{
		Name:       "payment_intents",
		Columns:    PaymentIntentsColumns,
		PrimaryKey: []*schema.Column{PaymentIntentsColumns[0]},
	}
	// PendingSendTransfersColumns holds the columns for the "pending_send_transfers" table.
	PendingSendTransfersColumns = []*schema.Column{
		{Name: "id", Type: field.TypeUUID},
		{Name: "create_time", Type: field.TypeTime},
		{Name: "update_time", Type: field.TypeTime},
		{Name: "transfer_id", Type: field.TypeUUID, Unique: true},
		{Name: "status", Type: field.TypeEnum, Enums: []string{"STARTED", "FINISHED"}, Default: "STARTED"},
	}
	// PendingSendTransfersTable holds the schema information for the "pending_send_transfers" table.
	PendingSendTransfersTable = &schema.Table{
		Name:       "pending_send_transfers",
		Columns:    PendingSendTransfersColumns,
		PrimaryKey: []*schema.Column{PendingSendTransfersColumns[0]},
		Indexes: []*schema.Index{
			{
				Name:    "pendingsendtransfer_transfer_id",
				Unique:  true,
				Columns: []*schema.Column{PendingSendTransfersColumns[3]},
			},
			{
				Name:    "pendingsendtransfer_status",
				Unique:  false,
				Columns: []*schema.Column{PendingSendTransfersColumns[4]},
			},
		},
	}
	// PreimageRequestsColumns holds the columns for the "preimage_requests" table.
	PreimageRequestsColumns = []*schema.Column{
		{Name: "id", Type: field.TypeUUID},
		{Name: "create_time", Type: field.TypeTime},
		{Name: "update_time", Type: field.TypeTime},
		{Name: "payment_hash", Type: field.TypeBytes},
		{Name: "status", Type: field.TypeEnum, Enums: []string{"WAITING_FOR_PREIMAGE", "PREIMAGE_SHARED", "RETURNED"}},
		{Name: "receiver_identity_pubkey", Type: field.TypeBytes, Nullable: true},
		{Name: "preimage", Type: field.TypeBytes, Nullable: true},
		{Name: "preimage_request_transfers", Type: field.TypeUUID, Nullable: true},
	}
	// PreimageRequestsTable holds the schema information for the "preimage_requests" table.
	PreimageRequestsTable = &schema.Table{
		Name:       "preimage_requests",
		Columns:    PreimageRequestsColumns,
		PrimaryKey: []*schema.Column{PreimageRequestsColumns[0]},
		ForeignKeys: []*schema.ForeignKey{
			{
				Symbol:     "preimage_requests_transfers_transfers",
				Columns:    []*schema.Column{PreimageRequestsColumns[7]},
				RefColumns: []*schema.Column{TransfersColumns[0]},
				OnDelete:   schema.SetNull,
			},
		},
		Indexes: []*schema.Index{
			{
				Name:    "preimagerequest_payment_hash_receiver_identity_pubkey",
				Unique:  false,
				Columns: []*schema.Column{PreimageRequestsColumns[3], PreimageRequestsColumns[5]},
			},
			{
				Name:    "preimagerequest_preimage_request_transfers",
				Unique:  false,
				Columns: []*schema.Column{PreimageRequestsColumns[7]},
			},
		},
	}
	// PreimageSharesColumns holds the columns for the "preimage_shares" table.
	PreimageSharesColumns = []*schema.Column{
		{Name: "id", Type: field.TypeUUID},
		{Name: "create_time", Type: field.TypeTime},
		{Name: "update_time", Type: field.TypeTime},
		{Name: "payment_hash", Type: field.TypeBytes, Unique: true},
		{Name: "preimage_share", Type: field.TypeBytes},
		{Name: "threshold", Type: field.TypeInt32},
		{Name: "owner_identity_pubkey", Type: field.TypeBytes},
		{Name: "invoice_string", Type: field.TypeString},
		{Name: "preimage_request_preimage_shares", Type: field.TypeUUID, Unique: true, Nullable: true},
	}
	// PreimageSharesTable holds the schema information for the "preimage_shares" table.
	PreimageSharesTable = &schema.Table{
		Name:       "preimage_shares",
		Columns:    PreimageSharesColumns,
		PrimaryKey: []*schema.Column{PreimageSharesColumns[0]},
		ForeignKeys: []*schema.ForeignKey{
			{
				Symbol:     "preimage_shares_preimage_requests_preimage_shares",
				Columns:    []*schema.Column{PreimageSharesColumns[8]},
				RefColumns: []*schema.Column{PreimageRequestsColumns[0]},
				OnDelete:   schema.SetNull,
			},
		},
		Indexes: []*schema.Index{
			{
				Name:    "preimageshare_payment_hash",
				Unique:  false,
				Columns: []*schema.Column{PreimageSharesColumns[3]},
			},
		},
	}
	// SigningCommitmentsColumns holds the columns for the "signing_commitments" table.
	SigningCommitmentsColumns = []*schema.Column{
		{Name: "id", Type: field.TypeUUID},
		{Name: "create_time", Type: field.TypeTime},
		{Name: "update_time", Type: field.TypeTime},
		{Name: "operator_index", Type: field.TypeUint},
		{Name: "status", Type: field.TypeEnum, Enums: []string{"AVAILABLE", "USED"}},
		{Name: "nonce_commitment", Type: field.TypeBytes, Unique: true},
	}
	// SigningCommitmentsTable holds the schema information for the "signing_commitments" table.
	SigningCommitmentsTable = &schema.Table{
		Name:       "signing_commitments",
		Columns:    SigningCommitmentsColumns,
		PrimaryKey: []*schema.Column{SigningCommitmentsColumns[0]},
		Indexes: []*schema.Index{
			{
				Name:    "signingcommitment_operator_index_status",
				Unique:  false,
				Columns: []*schema.Column{SigningCommitmentsColumns[3], SigningCommitmentsColumns[4]},
			},
		},
	}
	// SigningKeysharesColumns holds the columns for the "signing_keyshares" table.
	SigningKeysharesColumns = []*schema.Column{
		{Name: "id", Type: field.TypeUUID},
		{Name: "create_time", Type: field.TypeTime},
		{Name: "update_time", Type: field.TypeTime},
		{Name: "status", Type: field.TypeEnum, Enums: []string{"AVAILABLE", "IN_USE"}},
		{Name: "secret_share", Type: field.TypeBytes},
		{Name: "public_shares", Type: field.TypeJSON},
		{Name: "public_key", Type: field.TypeBytes, Unique: true},
		{Name: "min_signers", Type: field.TypeInt32},
		{Name: "coordinator_index", Type: field.TypeUint64},
	}
	// SigningKeysharesTable holds the schema information for the "signing_keyshares" table.
	SigningKeysharesTable = &schema.Table{
		Name:       "signing_keyshares",
		Columns:    SigningKeysharesColumns,
		PrimaryKey: []*schema.Column{SigningKeysharesColumns[0]},
		Indexes: []*schema.Index{
			{
				Name:    "signingkeyshare_coordinator_index",
				Unique:  false,
				Columns: []*schema.Column{SigningKeysharesColumns[8]},
			},
			{
				Name:    "idx_signing_keyshares_coordinator_available",
				Unique:  false,
				Columns: []*schema.Column{SigningKeysharesColumns[8]},
				Annotation: &entsql.IndexAnnotation{
					Where: "status = 'AVAILABLE'",
				},
			},
		},
	}
	// SigningNoncesColumns holds the columns for the "signing_nonces" table.
	SigningNoncesColumns = []*schema.Column{
		{Name: "id", Type: field.TypeUUID},
		{Name: "create_time", Type: field.TypeTime},
		{Name: "update_time", Type: field.TypeTime},
		{Name: "nonce", Type: field.TypeBytes},
		{Name: "nonce_commitment", Type: field.TypeBytes},
		{Name: "message", Type: field.TypeBytes, Nullable: true},
		{Name: "retry_fingerprint", Type: field.TypeBytes, Nullable: true},
	}
	// SigningNoncesTable holds the schema information for the "signing_nonces" table.
	SigningNoncesTable = &schema.Table{
		Name:       "signing_nonces",
		Columns:    SigningNoncesColumns,
		PrimaryKey: []*schema.Column{SigningNoncesColumns[0]},
		Indexes: []*schema.Index{
			{
				Name:    "signingnonce_nonce_commitment",
				Unique:  false,
				Columns: []*schema.Column{SigningNoncesColumns[4]},
			},
		},
	}
	// SparkInvoicesColumns holds the columns for the "spark_invoices" table.
	SparkInvoicesColumns = []*schema.Column{
		{Name: "id", Type: field.TypeUUID},
		{Name: "create_time", Type: field.TypeTime},
		{Name: "update_time", Type: field.TypeTime},
		{Name: "spark_invoice", Type: field.TypeString, Unique: true},
		{Name: "expiry_time", Type: field.TypeTime, Nullable: true},
		{Name: "receiver_public_key", Type: field.TypeBytes},
	}
	// SparkInvoicesTable holds the schema information for the "spark_invoices" table.
	SparkInvoicesTable = &schema.Table{
		Name:       "spark_invoices",
		Columns:    SparkInvoicesColumns,
		PrimaryKey: []*schema.Column{SparkInvoicesColumns[0]},
	}
	// TokenCreatesColumns holds the columns for the "token_creates" table.
	TokenCreatesColumns = []*schema.Column{
		{Name: "id", Type: field.TypeUUID},
		{Name: "create_time", Type: field.TypeTime},
		{Name: "update_time", Type: field.TypeTime},
		{Name: "issuer_public_key", Type: field.TypeBytes},
		{Name: "token_name", Type: field.TypeString},
		{Name: "token_ticker", Type: field.TypeString},
		{Name: "decimals", Type: field.TypeUint8},
		{Name: "max_supply", Type: field.TypeBytes},
		{Name: "is_freezable", Type: field.TypeBool},
		{Name: "network", Type: field.TypeEnum, Enums: []string{"UNSPECIFIED", "MAINNET", "REGTEST", "TESTNET", "SIGNET"}},
		{Name: "token_identifier", Type: field.TypeBytes, Unique: true},
		{Name: "issuer_signature", Type: field.TypeBytes, Unique: true, Nullable: true},
		{Name: "operator_specific_issuer_signature", Type: field.TypeBytes, Unique: true, Nullable: true},
		{Name: "creation_entity_public_key", Type: field.TypeBytes},
		{Name: "wallet_provided_timestamp", Type: field.TypeUint64, Nullable: true},
		{Name: "token_create_l1_token_create", Type: field.TypeUUID, Nullable: true},
	}
	// TokenCreatesTable holds the schema information for the "token_creates" table.
	TokenCreatesTable = &schema.Table{
		Name:       "token_creates",
		Columns:    TokenCreatesColumns,
		PrimaryKey: []*schema.Column{TokenCreatesColumns[0]},
		ForeignKeys: []*schema.ForeignKey{
			{
				Symbol:     "token_creates_l1token_creates_l1_token_create",
				Columns:    []*schema.Column{TokenCreatesColumns[15]},
				RefColumns: []*schema.Column{L1tokenCreatesColumns[0]},
				OnDelete:   schema.SetNull,
			},
		},
		Indexes: []*schema.Index{
			{
				Name:    "tokencreate_issuer_public_key",
				Unique:  false,
				Columns: []*schema.Column{TokenCreatesColumns[3]},
			},
		},
	}
	// TokenFreezesColumns holds the columns for the "token_freezes" table.
	TokenFreezesColumns = []*schema.Column{
		{Name: "id", Type: field.TypeUUID},
		{Name: "create_time", Type: field.TypeTime},
		{Name: "update_time", Type: field.TypeTime},
		{Name: "status", Type: field.TypeEnum, Enums: []string{"FROZEN", "THAWED"}},
		{Name: "owner_public_key", Type: field.TypeBytes},
		{Name: "token_public_key", Type: field.TypeBytes, Nullable: true},
		{Name: "issuer_signature", Type: field.TypeBytes, Unique: true},
		{Name: "wallet_provided_freeze_timestamp", Type: field.TypeUint64},
		{Name: "wallet_provided_thaw_timestamp", Type: field.TypeUint64, Nullable: true},
		{Name: "token_create_id", Type: field.TypeUUID},
	}
	// TokenFreezesTable holds the schema information for the "token_freezes" table.
	TokenFreezesTable = &schema.Table{
		Name:       "token_freezes",
		Columns:    TokenFreezesColumns,
		PrimaryKey: []*schema.Column{TokenFreezesColumns[0]},
		ForeignKeys: []*schema.ForeignKey{
			{
				Symbol:     "token_freezes_token_creates_token_freeze",
				Columns:    []*schema.Column{TokenFreezesColumns[9]},
				RefColumns: []*schema.Column{TokenCreatesColumns[0]},
				OnDelete:   schema.NoAction,
			},
		},
		Indexes: []*schema.Index{
			{
				Name:    "tokenfreeze_owner_public_key_token_public_key_wallet_provided_f",
				Unique:  true,
				Columns: []*schema.Column{TokenFreezesColumns[4], TokenFreezesColumns[5], TokenFreezesColumns[7]},
			},
			{
				Name:    "tokenfreeze_owner_public_key_token_public_key_wallet_provided_t",
				Unique:  true,
				Columns: []*schema.Column{TokenFreezesColumns[4], TokenFreezesColumns[5], TokenFreezesColumns[8]},
			},
			{
				Name:    "tokenfreeze_owner_public_key_token_create_id_wallet_provided_f",
				Unique:  true,
				Columns: []*schema.Column{TokenFreezesColumns[4], TokenFreezesColumns[9], TokenFreezesColumns[7]},
			},
			{
				Name:    "tokenfreeze_owner_public_key_token_create_id_wallet_provided_t",
				Unique:  true,
				Columns: []*schema.Column{TokenFreezesColumns[4], TokenFreezesColumns[9], TokenFreezesColumns[8]},
			},
		},
	}
	// TokenMintsColumns holds the columns for the "token_mints" table.
	TokenMintsColumns = []*schema.Column{
		{Name: "id", Type: field.TypeUUID},
		{Name: "create_time", Type: field.TypeTime},
		{Name: "update_time", Type: field.TypeTime},
		{Name: "issuer_public_key", Type: field.TypeBytes},
		{Name: "wallet_provided_timestamp", Type: field.TypeUint64},
		{Name: "issuer_signature", Type: field.TypeBytes},
		{Name: "operator_specific_issuer_signature", Type: field.TypeBytes, Unique: true, Nullable: true},
		{Name: "token_identifier", Type: field.TypeBytes, Nullable: true},
	}
	// TokenMintsTable holds the schema information for the "token_mints" table.
	TokenMintsTable = &schema.Table{
		Name:       "token_mints",
		Columns:    TokenMintsColumns,
		PrimaryKey: []*schema.Column{TokenMintsColumns[0]},
		Indexes: []*schema.Index{
			{
				Name:    "tokenmint_issuer_public_key",
				Unique:  false,
				Columns: []*schema.Column{TokenMintsColumns[3]},
			},
			{
				Name:    "tokenmint_token_identifier",
				Unique:  false,
				Columns: []*schema.Column{TokenMintsColumns[7]},
			},
		},
	}
	// TokenOutputsColumns holds the columns for the "token_outputs" table.
	TokenOutputsColumns = []*schema.Column{
		{Name: "id", Type: field.TypeUUID},
		{Name: "create_time", Type: field.TypeTime},
		{Name: "update_time", Type: field.TypeTime},
		{Name: "status", Type: field.TypeEnum, Enums: []string{"CREATED_STARTED", "CREATED_STARTED_CANCELLED", "CREATED_SIGNED", "CREATED_SIGNED_CANCELLED", "CREATED_FINALIZED", "SPENT_STARTED", "SPENT_SIGNED", "SPENT_FINALIZED"}},
		{Name: "owner_public_key", Type: field.TypeBytes},
		{Name: "withdraw_bond_sats", Type: field.TypeUint64},
		{Name: "withdraw_relative_block_locktime", Type: field.TypeUint64},
		{Name: "withdraw_revocation_commitment", Type: field.TypeBytes},
		{Name: "token_public_key", Type: field.TypeBytes, Nullable: true},
		{Name: "token_amount", Type: field.TypeBytes},
		{Name: "created_transaction_output_vout", Type: field.TypeInt32},
		{Name: "spent_ownership_signature", Type: field.TypeBytes, Nullable: true},
		{Name: "spent_operator_specific_ownership_signature", Type: field.TypeBytes, Nullable: true},
		{Name: "spent_transaction_input_vout", Type: field.TypeInt32, Nullable: true},
		{Name: "spent_revocation_secret", Type: field.TypeBytes, Nullable: true},
		{Name: "confirmed_withdraw_block_hash", Type: field.TypeBytes, Nullable: true},
		{Name: "network", Type: field.TypeEnum, Nullable: true, Enums: []string{"UNSPECIFIED", "MAINNET", "REGTEST", "TESTNET", "SIGNET"}},
		{Name: "token_identifier", Type: field.TypeBytes},
		{Name: "token_create_id", Type: field.TypeUUID},
		{Name: "token_output_revocation_keyshare", Type: field.TypeUUID},
		{Name: "token_output_output_created_token_transaction", Type: field.TypeUUID, Nullable: true},
		{Name: "token_output_output_spent_token_transaction", Type: field.TypeUUID, Nullable: true},
	}
	// TokenOutputsTable holds the schema information for the "token_outputs" table.
	TokenOutputsTable = &schema.Table{
		Name:       "token_outputs",
		Columns:    TokenOutputsColumns,
		PrimaryKey: []*schema.Column{TokenOutputsColumns[0]},
		ForeignKeys: []*schema.ForeignKey{
			{
				Symbol:     "token_outputs_token_creates_token_output",
				Columns:    []*schema.Column{TokenOutputsColumns[18]},
				RefColumns: []*schema.Column{TokenCreatesColumns[0]},
				OnDelete:   schema.NoAction,
			},
			{
				Symbol:     "token_outputs_signing_keyshares_revocation_keyshare",
				Columns:    []*schema.Column{TokenOutputsColumns[19]},
				RefColumns: []*schema.Column{SigningKeysharesColumns[0]},
				OnDelete:   schema.NoAction,
			},
			{
				Symbol:     "token_outputs_token_transactions_output_created_token_transaction",
				Columns:    []*schema.Column{TokenOutputsColumns[20]},
				RefColumns: []*schema.Column{TokenTransactionsColumns[0]},
				OnDelete:   schema.SetNull,
			},
			{
				Symbol:     "token_outputs_token_transactions_output_spent_token_transaction",
				Columns:    []*schema.Column{TokenOutputsColumns[21]},
				RefColumns: []*schema.Column{TokenTransactionsColumns[0]},
				OnDelete:   schema.SetNull,
			},
		},
		Indexes: []*schema.Index{
			{
				Name:    "tokenoutput_owner_public_key_status_network",
				Unique:  false,
				Columns: []*schema.Column{TokenOutputsColumns[4], TokenOutputsColumns[3], TokenOutputsColumns[16]},
			},
			{
				Name:    "tokenoutput_token_identifier_status",
				Unique:  false,
				Columns: []*schema.Column{TokenOutputsColumns[17], TokenOutputsColumns[3]},
			},
			{
				Name:    "tokenoutput_confirmed_withdraw_block_hash",
				Unique:  false,
				Columns: []*schema.Column{TokenOutputsColumns[15]},
			},
			{
				Name:    "tokenoutput_token_output_output_spent_token_transaction",
				Unique:  false,
				Columns: []*schema.Column{TokenOutputsColumns[21]},
			},
			{
				Name:    "tokenoutput_token_output_output_created_token_transaction",
				Unique:  false,
				Columns: []*schema.Column{TokenOutputsColumns[20]},
			},
			{
				Name:    "tokenoutput_created_transaction_output_vout_token_output_output_created_token_transaction",
				Unique:  true,
				Columns: []*schema.Column{TokenOutputsColumns[10], TokenOutputsColumns[20]},
			},
			{
				Name:    "tokenoutput_token_create_id",
				Unique:  false,
				Columns: []*schema.Column{TokenOutputsColumns[18]},
			},
		},
	}
	// TokenPartialRevocationSecretSharesColumns holds the columns for the "token_partial_revocation_secret_shares" table.
	TokenPartialRevocationSecretSharesColumns = []*schema.Column{
		{Name: "id", Type: field.TypeUUID},
		{Name: "create_time", Type: field.TypeTime},
		{Name: "update_time", Type: field.TypeTime},
		{Name: "operator_identity_public_key", Type: field.TypeBytes},
		{Name: "secret_share", Type: field.TypeBytes},
		{Name: "token_output_token_partial_revocation_secret_shares", Type: field.TypeUUID},
	}
	// TokenPartialRevocationSecretSharesTable holds the schema information for the "token_partial_revocation_secret_shares" table.
	TokenPartialRevocationSecretSharesTable = &schema.Table{
		Name:       "token_partial_revocation_secret_shares",
		Columns:    TokenPartialRevocationSecretSharesColumns,
		PrimaryKey: []*schema.Column{TokenPartialRevocationSecretSharesColumns[0]},
		ForeignKeys: []*schema.ForeignKey{
			{
				Symbol:     "token_partial_revocation_secret_shares_token_outputs_token_partial_revocation_secret_shares",
				Columns:    []*schema.Column{TokenPartialRevocationSecretSharesColumns[5]},
				RefColumns: []*schema.Column{TokenOutputsColumns[0]},
				OnDelete:   schema.NoAction,
			},
		},
		Indexes: []*schema.Index{
			{
				Name:    "tokenpartialrevocationsecretshare_token_output_token_partial_revocation_secret_shares",
				Unique:  false,
				Columns: []*schema.Column{TokenPartialRevocationSecretSharesColumns[5]},
			},
			{
				Name:    "tokenpartialrevocationsecretshare_operator_identity_public_key_token_output_token_partial_revocation_secret_shares",
				Unique:  true,
				Columns: []*schema.Column{TokenPartialRevocationSecretSharesColumns[3], TokenPartialRevocationSecretSharesColumns[5]},
			},
		},
	}
	// TokenTransactionsColumns holds the columns for the "token_transactions" table.
	TokenTransactionsColumns = []*schema.Column{
		{Name: "id", Type: field.TypeUUID},
		{Name: "create_time", Type: field.TypeTime},
		{Name: "update_time", Type: field.TypeTime},
		{Name: "partial_token_transaction_hash", Type: field.TypeBytes},
		{Name: "finalized_token_transaction_hash", Type: field.TypeBytes, Unique: true},
		{Name: "operator_signature", Type: field.TypeBytes, Unique: true, Nullable: true},
		{Name: "status", Type: field.TypeEnum, Nullable: true, Enums: []string{"STARTED", "STARTED_CANCELLED", "SIGNED", "REVEALED", "SIGNED_CANCELLED", "FINALIZED"}},
		{Name: "expiry_time", Type: field.TypeTime, Nullable: true},
		{Name: "coordinator_public_key", Type: field.TypeBytes, Nullable: true},
		{Name: "client_created_timestamp", Type: field.TypeTime, Nullable: true},
		{Name: "version", Type: field.TypeInt, Default: 0},
		{Name: "token_transaction_mint", Type: field.TypeUUID, Nullable: true},
		{Name: "token_transaction_create", Type: field.TypeUUID, Nullable: true},
		{Name: "token_transaction_payment_intent", Type: field.TypeUUID, Nullable: true},
	}
	// TokenTransactionsTable holds the schema information for the "token_transactions" table.
	TokenTransactionsTable = &schema.Table{
		Name:       "token_transactions",
		Columns:    TokenTransactionsColumns,
		PrimaryKey: []*schema.Column{TokenTransactionsColumns[0]},
		ForeignKeys: []*schema.ForeignKey{
			{
				Symbol:     "token_transactions_token_mints_mint",
				Columns:    []*schema.Column{TokenTransactionsColumns[11]},
				RefColumns: []*schema.Column{TokenMintsColumns[0]},
				OnDelete:   schema.SetNull,
			},
			{
				Symbol:     "token_transactions_token_creates_create",
				Columns:    []*schema.Column{TokenTransactionsColumns[12]},
				RefColumns: []*schema.Column{TokenCreatesColumns[0]},
				OnDelete:   schema.SetNull,
			},
			{
				Symbol:     "token_transactions_payment_intents_payment_intent",
				Columns:    []*schema.Column{TokenTransactionsColumns[13]},
				RefColumns: []*schema.Column{PaymentIntentsColumns[0]},
				OnDelete:   schema.SetNull,
			},
		},
		Indexes: []*schema.Index{
			{
				Name:    "tokentransaction_finalized_token_transaction_hash",
				Unique:  false,
				Columns: []*schema.Column{TokenTransactionsColumns[4]},
			},
			{
				Name:    "tokentransaction_partial_token_transaction_hash",
				Unique:  false,
				Columns: []*schema.Column{TokenTransactionsColumns[3]},
			},
			{
				Name:    "tokentransaction_expiry_time_status",
				Unique:  false,
				Columns: []*schema.Column{TokenTransactionsColumns[7], TokenTransactionsColumns[6]},
			},
			{
				Name:    "tokentransaction_update_time",
				Unique:  false,
				Columns: []*schema.Column{TokenTransactionsColumns[2]},
			},
		},
	}
	// TokenTransactionPeerSignaturesColumns holds the columns for the "token_transaction_peer_signatures" table.
	TokenTransactionPeerSignaturesColumns = []*schema.Column{
		{Name: "id", Type: field.TypeUUID},
		{Name: "create_time", Type: field.TypeTime},
		{Name: "update_time", Type: field.TypeTime},
		{Name: "operator_identity_public_key", Type: field.TypeBytes},
		{Name: "signature", Type: field.TypeBytes},
		{Name: "token_transaction_peer_signatures", Type: field.TypeUUID},
	}
	// TokenTransactionPeerSignaturesTable holds the schema information for the "token_transaction_peer_signatures" table.
	TokenTransactionPeerSignaturesTable = &schema.Table{
		Name:       "token_transaction_peer_signatures",
		Columns:    TokenTransactionPeerSignaturesColumns,
		PrimaryKey: []*schema.Column{TokenTransactionPeerSignaturesColumns[0]},
		ForeignKeys: []*schema.ForeignKey{
			{
				Symbol:     "token_transaction_peer_signatures_token_transactions_peer_signatures",
				Columns:    []*schema.Column{TokenTransactionPeerSignaturesColumns[5]},
				RefColumns: []*schema.Column{TokenTransactionsColumns[0]},
				OnDelete:   schema.NoAction,
			},
		},
		Indexes: []*schema.Index{
			{
				Name:    "tokentransactionpeersignature_token_transaction_peer_signatures",
				Unique:  false,
				Columns: []*schema.Column{TokenTransactionPeerSignaturesColumns[5]},
			},
			{
				Name:    "tokentransactionpeersignature_operator_identity_public_key_token_transaction_peer_signatures",
				Unique:  true,
				Columns: []*schema.Column{TokenTransactionPeerSignaturesColumns[3], TokenTransactionPeerSignaturesColumns[5]},
			},
		},
	}
	// TransfersColumns holds the columns for the "transfers" table.
	TransfersColumns = []*schema.Column{
		{Name: "id", Type: field.TypeUUID},
		{Name: "create_time", Type: field.TypeTime},
		{Name: "update_time", Type: field.TypeTime},
		{Name: "sender_identity_pubkey", Type: field.TypeBytes},
		{Name: "receiver_identity_pubkey", Type: field.TypeBytes},
		{Name: "total_value", Type: field.TypeUint64},
		{Name: "status", Type: field.TypeEnum, Enums: []string{"SENDER_INITIATED", "SENDER_INITIATED_COORDINATOR", "SENDER_KEY_TWEAK_PENDING", "SENDER_KEY_TWEAKED", "RECEIVER_KEY_TWEAKED", "RECEIVER_KEY_TWEAK_LOCKED", "RECEIVER_REFUND_SIGNED", "COMPLETED", "EXPIRED", "RETURNED", "RECEIVER_KEY_TWEAK_APPLIED"}},
		{Name: "type", Type: field.TypeEnum, Enums: []string{"PREIMAGE_SWAP", "COOPERATIVE_EXIT", "TRANSFER", "SWAP", "COUNTER_SWAP", "UTXO_SWAP"}},
		{Name: "expiry_time", Type: field.TypeTime},
		{Name: "completion_time", Type: field.TypeTime, Nullable: true},
		{Name: "transfer_payment_intent", Type: field.TypeUUID, Nullable: true},
		{Name: "spark_invoice_id", Type: field.TypeUUID, Nullable: true},
		{Name: "transfer_counter_swap_transfer", Type: field.TypeUUID, Nullable: true},
	}
	// TransfersTable holds the schema information for the "transfers" table.
	TransfersTable = &schema.Table{
		Name:       "transfers",
		Columns:    TransfersColumns,
		PrimaryKey: []*schema.Column{TransfersColumns[0]},
		ForeignKeys: []*schema.ForeignKey{
			{
				Symbol:     "transfers_payment_intents_payment_intent",
				Columns:    []*schema.Column{TransfersColumns[10]},
				RefColumns: []*schema.Column{PaymentIntentsColumns[0]},
				OnDelete:   schema.SetNull,
			},
			{
				Symbol:     "transfers_spark_invoices_spark_invoice",
				Columns:    []*schema.Column{TransfersColumns[11]},
				RefColumns: []*schema.Column{SparkInvoicesColumns[0]},
				OnDelete:   schema.SetNull,
			},
			{
				Symbol:     "transfers_transfers_counter_swap_transfer",
				Columns:    []*schema.Column{TransfersColumns[12]},
				RefColumns: []*schema.Column{TransfersColumns[0]},
				OnDelete:   schema.SetNull,
			},
		},
		Indexes: []*schema.Index{
			{
				Name:    "transfer_sender_identity_pubkey",
				Unique:  false,
				Columns: []*schema.Column{TransfersColumns[3]},
			},
			{
				Name:    "transfer_receiver_identity_pubkey",
				Unique:  false,
				Columns: []*schema.Column{TransfersColumns[4]},
			},
			{
				Name:    "transfer_status",
				Unique:  false,
				Columns: []*schema.Column{TransfersColumns[6]},
			},
			{
				Name:    "transfer_update_time",
				Unique:  false,
				Columns: []*schema.Column{TransfersColumns[2]},
			},
			{
				Name:    "idx_transfers_spark_invoice_pending",
				Unique:  true,
				Columns: []*schema.Column{TransfersColumns[11]},
				Annotation: &entsql.IndexAnnotation{
					Where: "CAST(status AS TEXT) IN ('SENDER_KEY_TWEAK_PENDING', 'SENDER_INITIATED_COORDINATOR')",
				},
			},
			{
				Name:    "idx_transfers_spark_invoice_completed",
				Unique:  true,
				Columns: []*schema.Column{TransfersColumns[11]},
				Annotation: &entsql.IndexAnnotation{
					Where: "CAST(status AS TEXT) IN ('SENDER_KEY_TWEAKED', 'RECEIVER_KEY_TWEAKED', 'RECEIVER_KEY_TWEAK_LOCKED', 'RECEIVER_KEY_TWEAK_APPLIED', 'RECEIVER_REFUND_SIGNED', 'COMPLETED')",
				},
			},
		},
	}
	// TransferLeafsColumns holds the columns for the "transfer_leafs" table.
	TransferLeafsColumns = []*schema.Column{
		{Name: "id", Type: field.TypeUUID},
		{Name: "create_time", Type: field.TypeTime},
		{Name: "update_time", Type: field.TypeTime},
		{Name: "secret_cipher", Type: field.TypeBytes, Nullable: true},
		{Name: "signature", Type: field.TypeBytes, Nullable: true},
		{Name: "previous_refund_tx", Type: field.TypeBytes},
		{Name: "previous_direct_refund_tx", Type: field.TypeBytes, Nullable: true},
		{Name: "previous_direct_from_cpfp_refund_tx", Type: field.TypeBytes, Nullable: true},
		{Name: "intermediate_refund_tx", Type: field.TypeBytes},
		{Name: "intermediate_direct_refund_tx", Type: field.TypeBytes, Nullable: true},
		{Name: "intermediate_direct_from_cpfp_refund_tx", Type: field.TypeBytes, Nullable: true},
		{Name: "key_tweak", Type: field.TypeBytes, Nullable: true},
		{Name: "sender_key_tweak_proof", Type: field.TypeBytes, Nullable: true},
		{Name: "receiver_key_tweak", Type: field.TypeBytes, Nullable: true},
		{Name: "transfer_leaf_transfer", Type: field.TypeUUID},
		{Name: "transfer_leaf_leaf", Type: field.TypeUUID},
	}
	// TransferLeafsTable holds the schema information for the "transfer_leafs" table.
	TransferLeafsTable = &schema.Table{
		Name:       "transfer_leafs",
		Columns:    TransferLeafsColumns,
		PrimaryKey: []*schema.Column{TransferLeafsColumns[0]},
		ForeignKeys: []*schema.ForeignKey{
			{
				Symbol:     "transfer_leafs_transfers_transfer",
				Columns:    []*schema.Column{TransferLeafsColumns[14]},
				RefColumns: []*schema.Column{TransfersColumns[0]},
				OnDelete:   schema.NoAction,
			},
			{
				Symbol:     "transfer_leafs_tree_nodes_leaf",
				Columns:    []*schema.Column{TransferLeafsColumns[15]},
				RefColumns: []*schema.Column{TreeNodesColumns[0]},
				OnDelete:   schema.NoAction,
			},
		},
		Indexes: []*schema.Index{
			{
				Name:    "transferleaf_transfer_leaf_transfer",
				Unique:  false,
				Columns: []*schema.Column{TransferLeafsColumns[14]},
			},
			{
				Name:    "transferleaf_transfer_leaf_leaf",
				Unique:  false,
				Columns: []*schema.Column{TransferLeafsColumns[15]},
			},
		},
	}
	// TreesColumns holds the columns for the "trees" table.
	TreesColumns = []*schema.Column{
		{Name: "id", Type: field.TypeUUID},
		{Name: "create_time", Type: field.TypeTime},
		{Name: "update_time", Type: field.TypeTime},
		{Name: "owner_identity_pubkey", Type: field.TypeBytes},
		{Name: "status", Type: field.TypeEnum, Enums: []string{"PENDING", "AVAILABLE", "EXITED"}},
		{Name: "network", Type: field.TypeEnum, Enums: []string{"UNSPECIFIED", "MAINNET", "REGTEST", "TESTNET", "SIGNET"}},
		{Name: "base_txid", Type: field.TypeBytes},
		{Name: "vout", Type: field.TypeInt16},
		{Name: "deposit_address_tree", Type: field.TypeUUID, Unique: true, Nullable: true},
		{Name: "tree_root", Type: field.TypeUUID, Nullable: true},
	}
	// TreesTable holds the schema information for the "trees" table.
	TreesTable = &schema.Table{
		Name:       "trees",
		Columns:    TreesColumns,
		PrimaryKey: []*schema.Column{TreesColumns[0]},
		ForeignKeys: []*schema.ForeignKey{
			{
				Symbol:     "trees_deposit_addresses_tree",
				Columns:    []*schema.Column{TreesColumns[8]},
				RefColumns: []*schema.Column{DepositAddressesColumns[0]},
				OnDelete:   schema.SetNull,
			},
			{
				Symbol:     "trees_tree_nodes_root",
				Columns:    []*schema.Column{TreesColumns[9]},
				RefColumns: []*schema.Column{TreeNodesColumns[0]},
				OnDelete:   schema.SetNull,
			},
		},
		Indexes: []*schema.Index{
			{
				Name:    "tree_status",
				Unique:  false,
				Columns: []*schema.Column{TreesColumns[4]},
			},
			{
				Name:    "tree_network",
				Unique:  false,
				Columns: []*schema.Column{TreesColumns[5]},
			},
			{
				Name:    "tree_base_txid_vout",
				Unique:  true,
				Columns: []*schema.Column{TreesColumns[6], TreesColumns[7]},
			},
		},
	}
	// TreeNodesColumns holds the columns for the "tree_nodes" table.
	TreeNodesColumns = []*schema.Column{
		{Name: "id", Type: field.TypeUUID},
		{Name: "create_time", Type: field.TypeTime},
		{Name: "update_time", Type: field.TypeTime},
		{Name: "value", Type: field.TypeUint64},
		{Name: "status", Type: field.TypeEnum, Enums: []string{"CREATING", "AVAILABLE", "FROZEN_BY_ISSUER", "TRANSFER_LOCKED", "SPLIT_LOCKED", "SPLITTED", "AGGREGATED", "ON_CHAIN", "AGGREGATE_LOCK", "EXITED", "INVESTIGATION", "LOST", "REIMBURSED"}},
		{Name: "verifying_pubkey", Type: field.TypeBytes},
		{Name: "owner_identity_pubkey", Type: field.TypeBytes},
		{Name: "owner_signing_pubkey", Type: field.TypeBytes},
		{Name: "vout", Type: field.TypeInt16},
		{Name: "node_confirmation_height", Type: field.TypeUint64, Nullable: true},
		{Name: "refund_confirmation_height", Type: field.TypeUint64, Nullable: true},
		{Name: "raw_tx", Type: field.TypeBytes},
		{Name: "direct_tx", Type: field.TypeBytes, Nullable: true},
		{Name: "direct_from_cpfp_refund_tx", Type: field.TypeBytes, Nullable: true},
		{Name: "raw_txid", Type: field.TypeBytes, Nullable: true},
		{Name: "direct_txid", Type: field.TypeBytes, Nullable: true},
		{Name: "direct_from_cpfp_refund_txid", Type: field.TypeBytes, Nullable: true},
		{Name: "raw_refund_tx", Type: field.TypeBytes, Nullable: true},
		{Name: "direct_refund_tx", Type: field.TypeBytes, Nullable: true},
		{Name: "raw_refund_txid", Type: field.TypeBytes, Nullable: true},
		{Name: "direct_refund_txid", Type: field.TypeBytes, Nullable: true},
		{Name: "tree_node_tree", Type: field.TypeUUID},
		{Name: "tree_node_parent", Type: field.TypeUUID, Nullable: true},
		{Name: "tree_node_signing_keyshare", Type: field.TypeUUID},
	}
	// TreeNodesTable holds the schema information for the "tree_nodes" table.
	TreeNodesTable = &schema.Table{
		Name:       "tree_nodes",
		Columns:    TreeNodesColumns,
		PrimaryKey: []*schema.Column{TreeNodesColumns[0]},
		ForeignKeys: []*schema.ForeignKey{
			{
				Symbol:     "tree_nodes_trees_tree",
				Columns:    []*schema.Column{TreeNodesColumns[21]},
				RefColumns: []*schema.Column{TreesColumns[0]},
				OnDelete:   schema.NoAction,
			},
			{
				Symbol:     "tree_nodes_tree_nodes_parent",
				Columns:    []*schema.Column{TreeNodesColumns[22]},
				RefColumns: []*schema.Column{TreeNodesColumns[0]},
				OnDelete:   schema.SetNull,
			},
			{
				Symbol:     "tree_nodes_signing_keyshares_signing_keyshare",
				Columns:    []*schema.Column{TreeNodesColumns[23]},
				RefColumns: []*schema.Column{SigningKeysharesColumns[0]},
				OnDelete:   schema.NoAction,
			},
		},
		Indexes: []*schema.Index{
			{
				Name:    "treenode_tree_node_parent",
				Unique:  false,
				Columns: []*schema.Column{TreeNodesColumns[22]},
			},
			{
				Name:    "treenode_tree_node_tree",
				Unique:  false,
				Columns: []*schema.Column{TreeNodesColumns[21]},
			},
			{
				Name:    "treenode_tree_node_signing_keyshare",
				Unique:  false,
				Columns: []*schema.Column{TreeNodesColumns[23]},
			},
			{
				Name:    "treenode_owner_identity_pubkey",
				Unique:  false,
				Columns: []*schema.Column{TreeNodesColumns[6]},
			},
			{
				Name:    "treenode_owner_identity_pubkey_status",
				Unique:  false,
				Columns: []*schema.Column{TreeNodesColumns[6], TreeNodesColumns[4]},
			},
			{
				Name:    "treenode_node_confirmation_height",
				Unique:  false,
				Columns: []*schema.Column{TreeNodesColumns[9]},
			},
			{
				Name:    "treenode_refund_confirmation_height",
				Unique:  false,
				Columns: []*schema.Column{TreeNodesColumns[10]},
			},
			{
				Name:    "treenode_update_time",
				Unique:  false,
				Columns: []*schema.Column{TreeNodesColumns[2]},
			},
			{
				Name:    "treenode_raw_txid",
				Unique:  false,
				Columns: []*schema.Column{TreeNodesColumns[14]},
				Annotation: &entsql.IndexAnnotation{
					Where: "raw_txid is not null",
				},
			},
			{
				Name:    "treenode_direct_txid",
				Unique:  false,
				Columns: []*schema.Column{TreeNodesColumns[15]},
				Annotation: &entsql.IndexAnnotation{
					Where: "direct_txid is not null",
				},
			},
			{
				Name:    "treenode_direct_from_cpfp_refund_txid",
				Unique:  false,
				Columns: []*schema.Column{TreeNodesColumns[16]},
				Annotation: &entsql.IndexAnnotation{
					Where: "direct_from_cpfp_refund_txid is not null",
				},
			},
			{
				Name:    "treenode_raw_refund_txid",
				Unique:  false,
				Columns: []*schema.Column{TreeNodesColumns[19]},
				Annotation: &entsql.IndexAnnotation{
					Where: "raw_refund_txid is not null",
				},
			},
			{
				Name:    "treenode_direct_refund_txid",
				Unique:  false,
				Columns: []*schema.Column{TreeNodesColumns[20]},
				Annotation: &entsql.IndexAnnotation{
					Where: "direct_refund_txid is not null",
				},
			},
		},
	}
	// UserSignedTransactionsColumns holds the columns for the "user_signed_transactions" table.
	UserSignedTransactionsColumns = []*schema.Column{
		{Name: "id", Type: field.TypeUUID},
		{Name: "create_time", Type: field.TypeTime},
		{Name: "update_time", Type: field.TypeTime},
		{Name: "transaction", Type: field.TypeBytes},
		{Name: "user_signature", Type: field.TypeBytes},
		{Name: "signing_commitments", Type: field.TypeBytes},
		{Name: "user_signature_commitment", Type: field.TypeBytes},
		{Name: "user_signed_transaction_tree_node", Type: field.TypeUUID},
		{Name: "user_signed_transaction_preimage_request", Type: field.TypeUUID},
	}
	// UserSignedTransactionsTable holds the schema information for the "user_signed_transactions" table.
	UserSignedTransactionsTable = &schema.Table{
		Name:       "user_signed_transactions",
		Columns:    UserSignedTransactionsColumns,
		PrimaryKey: []*schema.Column{UserSignedTransactionsColumns[0]},
		ForeignKeys: []*schema.ForeignKey{
			{
				Symbol:     "user_signed_transactions_tree_nodes_tree_node",
				Columns:    []*schema.Column{UserSignedTransactionsColumns[7]},
				RefColumns: []*schema.Column{TreeNodesColumns[0]},
				OnDelete:   schema.NoAction,
			},
			{
				Symbol:     "user_signed_transactions_preimage_requests_preimage_request",
				Columns:    []*schema.Column{UserSignedTransactionsColumns[8]},
				RefColumns: []*schema.Column{PreimageRequestsColumns[0]},
				OnDelete:   schema.NoAction,
			},
		},
	}
	// UtxosColumns holds the columns for the "utxos" table.
	UtxosColumns = []*schema.Column{
		{Name: "id", Type: field.TypeUUID},
		{Name: "create_time", Type: field.TypeTime},
		{Name: "update_time", Type: field.TypeTime},
		{Name: "block_height", Type: field.TypeInt64},
		{Name: "txid", Type: field.TypeBytes},
		{Name: "vout", Type: field.TypeUint32},
		{Name: "amount", Type: field.TypeUint64},
		{Name: "network", Type: field.TypeEnum, Enums: []string{"UNSPECIFIED", "MAINNET", "REGTEST", "TESTNET", "SIGNET"}},
		{Name: "pk_script", Type: field.TypeBytes},
		{Name: "deposit_address_utxo", Type: field.TypeUUID},
	}
	// UtxosTable holds the schema information for the "utxos" table.
	UtxosTable = &schema.Table{
		Name:       "utxos",
		Columns:    UtxosColumns,
		PrimaryKey: []*schema.Column{UtxosColumns[0]},
		ForeignKeys: []*schema.ForeignKey{
			{
				Symbol:     "utxos_deposit_addresses_utxo",
				Columns:    []*schema.Column{UtxosColumns[9]},
				RefColumns: []*schema.Column{DepositAddressesColumns[0]},
				OnDelete:   schema.NoAction,
			},
		},
		Indexes: []*schema.Index{
			{
				Name:    "utxo_network_txid_vout",
				Unique:  true,
				Columns: []*schema.Column{UtxosColumns[7], UtxosColumns[4], UtxosColumns[5]},
			},
		},
	}
	// UtxoSwapsColumns holds the columns for the "utxo_swaps" table.
	UtxoSwapsColumns = []*schema.Column{
		{Name: "id", Type: field.TypeUUID},
		{Name: "create_time", Type: field.TypeTime},
		{Name: "update_time", Type: field.TypeTime},
		{Name: "status", Type: field.TypeEnum, Enums: []string{"CREATED", "COMPLETED", "CANCELLED"}},
		{Name: "request_type", Type: field.TypeEnum, Enums: []string{"FIXED_AMOUNT", "MAX_FEE", "REFUND"}},
		{Name: "credit_amount_sats", Type: field.TypeUint64, Nullable: true},
		{Name: "max_fee_sats", Type: field.TypeUint64, Nullable: true},
		{Name: "ssp_signature", Type: field.TypeBytes, Nullable: true},
		{Name: "ssp_identity_public_key", Type: field.TypeBytes, Nullable: true},
		{Name: "user_signature", Type: field.TypeBytes, Nullable: true},
		{Name: "user_identity_public_key", Type: field.TypeBytes, Nullable: true},
		{Name: "coordinator_identity_public_key", Type: field.TypeBytes},
		{Name: "requested_transfer_id", Type: field.TypeUUID, Nullable: true},
		{Name: "spend_tx_signing_result", Type: field.TypeBytes, Nullable: true},
		{Name: "deposit_address_utxoswaps", Type: field.TypeUUID, Nullable: true},
		{Name: "utxo_swap_utxo", Type: field.TypeUUID},
		{Name: "utxo_swap_transfer", Type: field.TypeUUID, Nullable: true},
	}
	// UtxoSwapsTable holds the schema information for the "utxo_swaps" table.
	UtxoSwapsTable = &schema.Table{
		Name:       "utxo_swaps",
		Columns:    UtxoSwapsColumns,
		PrimaryKey: []*schema.Column{UtxoSwapsColumns[0]},
		ForeignKeys: []*schema.ForeignKey{
			{
				Symbol:     "utxo_swaps_deposit_addresses_utxoswaps",
				Columns:    []*schema.Column{UtxoSwapsColumns[14]},
				RefColumns: []*schema.Column{DepositAddressesColumns[0]},
				OnDelete:   schema.SetNull,
			},
			{
				Symbol:     "utxo_swaps_utxos_utxo",
				Columns:    []*schema.Column{UtxoSwapsColumns[15]},
				RefColumns: []*schema.Column{UtxosColumns[0]},
				OnDelete:   schema.NoAction,
			},
			{
				Symbol:     "utxo_swaps_transfers_transfer",
				Columns:    []*schema.Column{UtxoSwapsColumns[16]},
				RefColumns: []*schema.Column{TransfersColumns[0]},
				OnDelete:   schema.SetNull,
			},
		},
		Indexes: []*schema.Index{
			{
				Name:    "utxoswap_utxo_swap_utxo",
				Unique:  true,
				Columns: []*schema.Column{UtxoSwapsColumns[15]},
				Annotation: &entsql.IndexAnnotation{
					Where: "status != 'CANCELLED'",
				},
			},
		},
	}
	// TokenOutputOutputSpentStartedTokenTransactionsColumns holds the columns for the "token_output_output_spent_started_token_transactions" table.
	TokenOutputOutputSpentStartedTokenTransactionsColumns = []*schema.Column{
		{Name: "token_output_id", Type: field.TypeUUID},
		{Name: "token_transaction_id", Type: field.TypeUUID},
	}
	// TokenOutputOutputSpentStartedTokenTransactionsTable holds the schema information for the "token_output_output_spent_started_token_transactions" table.
	TokenOutputOutputSpentStartedTokenTransactionsTable = &schema.Table{
		Name:       "token_output_output_spent_started_token_transactions",
		Columns:    TokenOutputOutputSpentStartedTokenTransactionsColumns,
		PrimaryKey: []*schema.Column{TokenOutputOutputSpentStartedTokenTransactionsColumns[0], TokenOutputOutputSpentStartedTokenTransactionsColumns[1]},
		ForeignKeys: []*schema.ForeignKey{
			{
				Symbol:     "token_output_output_spent_started_token_transactions_token_output_id",
				Columns:    []*schema.Column{TokenOutputOutputSpentStartedTokenTransactionsColumns[0]},
				RefColumns: []*schema.Column{TokenOutputsColumns[0]},
				OnDelete:   schema.Cascade,
			},
			{
				Symbol:     "token_output_output_spent_started_token_transactions_token_transaction_id",
				Columns:    []*schema.Column{TokenOutputOutputSpentStartedTokenTransactionsColumns[1]},
				RefColumns: []*schema.Column{TokenTransactionsColumns[0]},
				OnDelete:   schema.Cascade,
			},
		},
	}
	// TokenTransactionSparkInvoiceColumns holds the columns for the "token_transaction_spark_invoice" table.
	TokenTransactionSparkInvoiceColumns = []*schema.Column{
		{Name: "token_transaction_id", Type: field.TypeUUID},
		{Name: "spark_invoice_id", Type: field.TypeUUID},
	}
	// TokenTransactionSparkInvoiceTable holds the schema information for the "token_transaction_spark_invoice" table.
	TokenTransactionSparkInvoiceTable = &schema.Table{
		Name:       "token_transaction_spark_invoice",
		Columns:    TokenTransactionSparkInvoiceColumns,
		PrimaryKey: []*schema.Column{TokenTransactionSparkInvoiceColumns[0], TokenTransactionSparkInvoiceColumns[1]},
		ForeignKeys: []*schema.ForeignKey{
			{
				Symbol:     "token_transaction_spark_invoice_token_transaction_id",
				Columns:    []*schema.Column{TokenTransactionSparkInvoiceColumns[0]},
				RefColumns: []*schema.Column{TokenTransactionsColumns[0]},
				OnDelete:   schema.Cascade,
			},
			{
				Symbol:     "token_transaction_spark_invoice_spark_invoice_id",
				Columns:    []*schema.Column{TokenTransactionSparkInvoiceColumns[1]},
				RefColumns: []*schema.Column{SparkInvoicesColumns[0]},
				OnDelete:   schema.Cascade,
			},
		},
	}
	// Tables holds all the tables in the schema.
	Tables = []*schema.Table{
		BlockHeightsTable,
		CooperativeExitsTable,
		DepositAddressesTable,
		EntityDkgKeysTable,
		GossipsTable,
		L1tokenCreatesTable,
		PaymentIntentsTable,
		PendingSendTransfersTable,
		PreimageRequestsTable,
		PreimageSharesTable,
		SigningCommitmentsTable,
		SigningKeysharesTable,
		SigningNoncesTable,
		SparkInvoicesTable,
		TokenCreatesTable,
		TokenFreezesTable,
		TokenMintsTable,
		TokenOutputsTable,
		TokenPartialRevocationSecretSharesTable,
		TokenTransactionsTable,
		TokenTransactionPeerSignaturesTable,
		TransfersTable,
		TransferLeafsTable,
		TreesTable,
		TreeNodesTable,
		UserSignedTransactionsTable,
		UtxosTable,
		UtxoSwapsTable,
		TokenOutputOutputSpentStartedTokenTransactionsTable,
		TokenTransactionSparkInvoiceTable,
	}
)

func init() {
	CooperativeExitsTable.ForeignKeys[0].RefTable = TransfersTable
	DepositAddressesTable.ForeignKeys[0].RefTable = SigningKeysharesTable
	EntityDkgKeysTable.ForeignKeys[0].RefTable = SigningKeysharesTable
	PreimageRequestsTable.ForeignKeys[0].RefTable = TransfersTable
	PreimageSharesTable.ForeignKeys[0].RefTable = PreimageRequestsTable
	TokenCreatesTable.ForeignKeys[0].RefTable = L1tokenCreatesTable
	TokenFreezesTable.ForeignKeys[0].RefTable = TokenCreatesTable
	TokenOutputsTable.ForeignKeys[0].RefTable = TokenCreatesTable
	TokenOutputsTable.ForeignKeys[1].RefTable = SigningKeysharesTable
	TokenOutputsTable.ForeignKeys[2].RefTable = TokenTransactionsTable
	TokenOutputsTable.ForeignKeys[3].RefTable = TokenTransactionsTable
	TokenPartialRevocationSecretSharesTable.ForeignKeys[0].RefTable = TokenOutputsTable
	TokenTransactionsTable.ForeignKeys[0].RefTable = TokenMintsTable
	TokenTransactionsTable.ForeignKeys[1].RefTable = TokenCreatesTable
	TokenTransactionsTable.ForeignKeys[2].RefTable = PaymentIntentsTable
	TokenTransactionPeerSignaturesTable.ForeignKeys[0].RefTable = TokenTransactionsTable
	TransfersTable.ForeignKeys[0].RefTable = PaymentIntentsTable
	TransfersTable.ForeignKeys[1].RefTable = SparkInvoicesTable
	TransfersTable.ForeignKeys[2].RefTable = TransfersTable
	TransferLeafsTable.ForeignKeys[0].RefTable = TransfersTable
	TransferLeafsTable.ForeignKeys[1].RefTable = TreeNodesTable
	TreesTable.ForeignKeys[0].RefTable = DepositAddressesTable
	TreesTable.ForeignKeys[1].RefTable = TreeNodesTable
	TreeNodesTable.ForeignKeys[0].RefTable = TreesTable
	TreeNodesTable.ForeignKeys[1].RefTable = TreeNodesTable
	TreeNodesTable.ForeignKeys[2].RefTable = SigningKeysharesTable
	UserSignedTransactionsTable.ForeignKeys[0].RefTable = TreeNodesTable
	UserSignedTransactionsTable.ForeignKeys[1].RefTable = PreimageRequestsTable
	UtxosTable.ForeignKeys[0].RefTable = DepositAddressesTable
	UtxoSwapsTable.ForeignKeys[0].RefTable = DepositAddressesTable
	UtxoSwapsTable.ForeignKeys[1].RefTable = UtxosTable
	UtxoSwapsTable.ForeignKeys[2].RefTable = TransfersTable
	TokenOutputOutputSpentStartedTokenTransactionsTable.ForeignKeys[0].RefTable = TokenOutputsTable
	TokenOutputOutputSpentStartedTokenTransactionsTable.ForeignKeys[1].RefTable = TokenTransactionsTable
	TokenTransactionSparkInvoiceTable.ForeignKeys[0].RefTable = TokenTransactionsTable
	TokenTransactionSparkInvoiceTable.ForeignKeys[1].RefTable = SparkInvoicesTable
}
