< Summary - Combined Code Coverage

Line coverage
0%
Covered lines: 0
Uncovered lines: 656
Coverable lines: 656
Total lines: 737
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
File 1: Up(...)100%210%
File 1: Down(...)100%210%
File 2: BuildTargetModel(...)100%210%

File(s)

/home/runner/work/NLightning/NLightning/src/NLightning.Infrastructure.Persistence.Postgres/Migrations/20251106194247_AddFieldsForChannelOpen.cs

#LineLine coverage
 1using Microsoft.EntityFrameworkCore.Migrations;
 2
 3#nullable disable
 4
 5namespace NLightning.Infrastructure.Persistence.Postgres.Migrations
 6{
 7    /// <inheritdoc />
 8    public partial class AddFieldsForChannelOpen : Migration
 9    {
 10        /// <inheritdoc />
 11        protected override void Up(MigrationBuilder migrationBuilder)
 12        {
 013            migrationBuilder.AddColumn<string>(
 014                name: "type",
 015                table: "peers",
 016                type: "text",
 017                nullable: false,
 018                defaultValue: "");
 19
 020            migrationBuilder.AddColumn<byte>(
 021                name: "change_address_address_type",
 022                table: "channels",
 023                type: "smallint",
 024                nullable: true);
 25
 026            migrationBuilder.AddColumn<long>(
 027                name: "change_address_index",
 028                table: "channels",
 029                type: "bigint",
 030                nullable: true);
 31
 032            migrationBuilder.AddColumn<bool>(
 033                name: "change_address_is_change",
 034                table: "channels",
 035                type: "boolean",
 036                nullable: true);
 37
 038            migrationBuilder.AddColumn<byte>(
 039                name: "change_address_type",
 040                table: "channels",
 041                type: "smallint",
 042                nullable: true);
 43
 044            migrationBuilder.CreateTable(
 045                name: "wallet_addresses",
 046                columns: table => new
 047                {
 048                    index = table.Column<long>(type: "bigint", nullable: false),
 049                    is_change = table.Column<bool>(type: "boolean", nullable: false),
 050                    address_type = table.Column<byte>(type: "smallint", nullable: false),
 051                    address = table.Column<string>(type: "text", nullable: false)
 052                },
 053                constraints: table =>
 054                {
 055                    table.PrimaryKey("pk_wallet_addresses", x => new { x.index, x.is_change, x.address_type });
 056                });
 57
 058            migrationBuilder.CreateTable(
 059                name: "utxos",
 060                columns: table => new
 061                {
 062                    transaction_id = table.Column<byte[]>(type: "bytea", nullable: false),
 063                    index = table.Column<long>(type: "bigint", nullable: false),
 064                    amount_sats = table.Column<long>(type: "bigint", nullable: false),
 065                    block_height = table.Column<long>(type: "bigint", nullable: false),
 066                    address_index = table.Column<long>(type: "bigint", nullable: false),
 067                    is_address_change = table.Column<bool>(type: "boolean", nullable: false),
 068                    address_type = table.Column<byte>(type: "smallint", nullable: false),
 069                    locked_to_channel_id = table.Column<byte[]>(type: "bytea", nullable: true),
 070                    used_in_transaction_id = table.Column<byte[]>(type: "bytea", nullable: true)
 071                },
 072                constraints: table =>
 073                {
 074                    table.PrimaryKey("pk_utxos", x => new { x.transaction_id, x.index });
 075                    table.ForeignKey(
 076                        name: "fk_utxos_wallet_addresses_address_index_is_address_change_addr",
 077                        columns: x => new { x.address_index, x.is_address_change, x.address_type },
 078                        principalTable: "wallet_addresses",
 079                        principalColumns: new[] { "index", "is_change", "address_type" },
 080                        onDelete: ReferentialAction.Cascade);
 081                });
 82
 083            migrationBuilder.CreateIndex(
 084                name: "ix_channels_change_address_index_change_address_is_change_chan",
 085                table: "channels",
 086                columns: new[] { "change_address_index", "change_address_is_change", "change_address_address_type" });
 87
 088            migrationBuilder.CreateIndex(
 089                name: "ix_utxos_address_index_is_address_change_address_type",
 090                table: "utxos",
 091                columns: new[] { "address_index", "is_address_change", "address_type" })
 092                .Annotation("Npgsql:CreatedConcurrently", true);
 93
 094            migrationBuilder.CreateIndex(
 095                name: "ix_utxos_address_type",
 096                table: "utxos",
 097                column: "address_type")
 098                .Annotation("Npgsql:CreatedConcurrently", true);
 99
 0100            migrationBuilder.CreateIndex(
 0101                name: "ix_utxos_locked_to_channel_id",
 0102                table: "utxos",
 0103                column: "locked_to_channel_id")
 0104                .Annotation("Npgsql:CreatedConcurrently", true);
 105
 0106            migrationBuilder.CreateIndex(
 0107                name: "ix_utxos_used_in_transaction_id",
 0108                table: "utxos",
 0109                column: "used_in_transaction_id")
 0110                .Annotation("Npgsql:CreatedConcurrently", true);
 111
 0112            migrationBuilder.AddForeignKey(
 0113                name: "fk_channels_wallet_addresses_change_address_index_change_addre",
 0114                table: "channels",
 0115                columns: new[] { "change_address_index", "change_address_is_change", "change_address_address_type" },
 0116                principalTable: "wallet_addresses",
 0117                principalColumns: new[] { "index", "is_change", "address_type" });
 0118        }
 119
 120        /// <inheritdoc />
 121        protected override void Down(MigrationBuilder migrationBuilder)
 122        {
 0123            migrationBuilder.DropForeignKey(
 0124                name: "fk_channels_wallet_addresses_change_address_index_change_addre",
 0125                table: "channels");
 126
 0127            migrationBuilder.DropTable(
 0128                name: "utxos");
 129
 0130            migrationBuilder.DropTable(
 0131                name: "wallet_addresses");
 132
 0133            migrationBuilder.DropIndex(
 0134                name: "ix_channels_change_address_index_change_address_is_change_chan",
 0135                table: "channels");
 136
 0137            migrationBuilder.DropColumn(
 0138                name: "type",
 0139                table: "peers");
 140
 0141            migrationBuilder.DropColumn(
 0142                name: "change_address_address_type",
 0143                table: "channels");
 144
 0145            migrationBuilder.DropColumn(
 0146                name: "change_address_index",
 0147                table: "channels");
 148
 0149            migrationBuilder.DropColumn(
 0150                name: "change_address_is_change",
 0151                table: "channels");
 152
 0153            migrationBuilder.DropColumn(
 0154                name: "change_address_type",
 0155                table: "channels");
 0156        }
 157    }
 158}

/home/runner/work/NLightning/NLightning/src/NLightning.Infrastructure.Persistence.Postgres/Migrations/20251106194247_AddFieldsForChannelOpen.Designer.cs

#LineLine coverage
 1// <auto-generated />
 2using System;
 3using Microsoft.EntityFrameworkCore;
 4using Microsoft.EntityFrameworkCore.Infrastructure;
 5using Microsoft.EntityFrameworkCore.Migrations;
 6using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
 7using NLightning.Infrastructure.Persistence.Contexts;
 8using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
 9
 10#nullable disable
 11
 12namespace NLightning.Infrastructure.Persistence.Postgres.Migrations
 13{
 14    [DbContext(typeof(NLightningDbContext))]
 15    [Migration("20251106194247_AddFieldsForChannelOpen")]
 16    partial class AddFieldsForChannelOpen
 17    {
 18        /// <inheritdoc />
 19        protected override void BuildTargetModel(ModelBuilder modelBuilder)
 20        {
 21#pragma warning disable 612, 618
 022            modelBuilder
 023                .HasAnnotation("ProductVersion", "9.0.9")
 024                .HasAnnotation("Relational:MaxIdentifierLength", 63);
 25
 026            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
 27
 028            modelBuilder.Entity("NLightning.Infrastructure.Persistence.Entities.Bitcoin.BlockchainStateEntity", b =>
 029                {
 030                    b.Property<Guid>("Id")
 031                        .ValueGeneratedOnAdd()
 032                        .HasColumnType("uuid")
 033                        .HasColumnName("id");
 034
 035                    b.Property<DateTime>("LastProcessedAt")
 036                        .HasColumnType("timestamp with time zone")
 037                        .HasColumnName("last_processed_at");
 038
 039                    b.Property<byte[]>("LastProcessedBlockHash")
 040                        .IsRequired()
 041                        .HasColumnType("bytea")
 042                        .HasColumnName("last_processed_block_hash");
 043
 044                    b.Property<long>("LastProcessedHeight")
 045                        .HasColumnType("bigint")
 046                        .HasColumnName("last_processed_height");
 047
 048                    b.HasKey("Id")
 049                        .HasName("pk_blockchain_states");
 050
 051                    b.ToTable("blockchain_states", (string)null);
 052                });
 53
 054            modelBuilder.Entity("NLightning.Infrastructure.Persistence.Entities.Bitcoin.UtxoEntity", b =>
 055                {
 056                    b.Property<byte[]>("TransactionId")
 057                        .HasColumnType("bytea")
 058                        .HasColumnName("transaction_id");
 059
 060                    b.Property<long>("Index")
 061                        .HasColumnType("bigint")
 062                        .HasColumnName("index");
 063
 064                    b.Property<long>("AddressIndex")
 065                        .HasColumnType("bigint")
 066                        .HasColumnName("address_index");
 067
 068                    b.Property<byte>("AddressType")
 069                        .HasColumnType("smallint")
 070                        .HasColumnName("address_type");
 071
 072                    b.Property<long>("AmountSats")
 073                        .HasColumnType("bigint")
 074                        .HasColumnName("amount_sats");
 075
 076                    b.Property<long>("BlockHeight")
 077                        .HasColumnType("bigint")
 078                        .HasColumnName("block_height");
 079
 080                    b.Property<bool>("IsAddressChange")
 081                        .HasColumnType("boolean")
 082                        .HasColumnName("is_address_change");
 083
 084                    b.Property<byte[]>("LockedToChannelId")
 085                        .HasColumnType("bytea")
 086                        .HasColumnName("locked_to_channel_id");
 087
 088                    b.Property<byte[]>("UsedInTransactionId")
 089                        .HasColumnType("bytea")
 090                        .HasColumnName("used_in_transaction_id");
 091
 092                    b.HasKey("TransactionId", "Index")
 093                        .HasName("pk_utxos");
 094
 095                    b.HasIndex("AddressType")
 096                        .HasDatabaseName("ix_utxos_address_type")
 097                        .HasAnnotation("Npgsql:CreatedConcurrently", true);
 098
 099                    b.HasIndex("LockedToChannelId")
 0100                        .HasDatabaseName("ix_utxos_locked_to_channel_id")
 0101                        .HasAnnotation("Npgsql:CreatedConcurrently", true);
 0102
 0103                    b.HasIndex("UsedInTransactionId")
 0104                        .HasDatabaseName("ix_utxos_used_in_transaction_id")
 0105                        .HasAnnotation("Npgsql:CreatedConcurrently", true);
 0106
 0107                    b.HasIndex("AddressIndex", "IsAddressChange", "AddressType")
 0108                        .HasDatabaseName("ix_utxos_address_index_is_address_change_address_type")
 0109                        .HasAnnotation("Npgsql:CreatedConcurrently", true);
 0110
 0111                    b.ToTable("utxos", (string)null);
 0112                });
 113
 0114            modelBuilder.Entity("NLightning.Infrastructure.Persistence.Entities.Bitcoin.WalletAddressEntity", b =>
 0115                {
 0116                    b.Property<long>("Index")
 0117                        .HasColumnType("bigint")
 0118                        .HasColumnName("index");
 0119
 0120                    b.Property<bool>("IsChange")
 0121                        .HasColumnType("boolean")
 0122                        .HasColumnName("is_change");
 0123
 0124                    b.Property<byte>("AddressType")
 0125                        .HasColumnType("smallint")
 0126                        .HasColumnName("address_type");
 0127
 0128                    b.Property<string>("Address")
 0129                        .IsRequired()
 0130                        .HasColumnType("text")
 0131                        .HasColumnName("address");
 0132
 0133                    b.HasKey("Index", "IsChange", "AddressType")
 0134                        .HasName("pk_wallet_addresses");
 0135
 0136                    b.ToTable("wallet_addresses", (string)null);
 0137                });
 138
 0139            modelBuilder.Entity("NLightning.Infrastructure.Persistence.Entities.Bitcoin.WatchedTransactionEntity", b =>
 0140                {
 0141                    b.Property<byte[]>("TransactionId")
 0142                        .HasColumnType("bytea")
 0143                        .HasColumnName("transaction_id");
 0144
 0145                    b.Property<byte[]>("ChannelId")
 0146                        .IsRequired()
 0147                        .HasColumnType("bytea")
 0148                        .HasColumnName("channel_id");
 0149
 0150                    b.Property<DateTime?>("CompletedAt")
 0151                        .HasColumnType("timestamp with time zone")
 0152                        .HasColumnName("completed_at");
 0153
 0154                    b.Property<DateTime>("CreatedAt")
 0155                        .HasColumnType("timestamp with time zone")
 0156                        .HasColumnName("created_at");
 0157
 0158                    b.Property<long?>("FirstSeenAtHeight")
 0159                        .HasColumnType("bigint")
 0160                        .HasColumnName("first_seen_at_height");
 0161
 0162                    b.Property<long>("RequiredDepth")
 0163                        .HasColumnType("bigint")
 0164                        .HasColumnName("required_depth");
 0165
 0166                    b.Property<int?>("TransactionIndex")
 0167                        .HasColumnType("integer")
 0168                        .HasColumnName("transaction_index");
 0169
 0170                    b.HasKey("TransactionId")
 0171                        .HasName("pk_watched_transactions");
 0172
 0173                    b.HasIndex("ChannelId")
 0174                        .HasDatabaseName("ix_watched_transactions_channel_id");
 0175
 0176                    b.ToTable("watched_transactions", (string)null);
 0177                });
 178
 0179            modelBuilder.Entity("NLightning.Infrastructure.Persistence.Entities.Channel.ChannelConfigEntity", b =>
 0180                {
 0181                    b.Property<byte[]>("ChannelId")
 0182                        .HasColumnType("bytea")
 0183                        .HasColumnName("channel_id");
 0184
 0185                    b.Property<long?>("ChannelReserveAmountSats")
 0186                        .HasColumnType("bigint")
 0187                        .HasColumnName("channel_reserve_amount_sats");
 0188
 0189                    b.Property<long>("FeeRatePerKwSatoshis")
 0190                        .HasColumnType("bigint")
 0191                        .HasColumnName("fee_rate_per_kw_satoshis");
 0192
 0193                    b.Property<decimal>("HtlcMinimumMsat")
 0194                        .HasColumnType("numeric(20,0)")
 0195                        .HasColumnName("htlc_minimum_msat");
 0196
 0197                    b.Property<long>("LocalDustLimitAmountSats")
 0198                        .HasColumnType("bigint")
 0199                        .HasColumnName("local_dust_limit_amount_sats");
 0200
 0201                    b.Property<byte[]>("LocalUpfrontShutdownScript")
 0202                        .HasColumnType("bytea")
 0203                        .HasColumnName("local_upfront_shutdown_script");
 0204
 0205                    b.Property<int>("MaxAcceptedHtlcs")
 0206                        .HasColumnType("integer")
 0207                        .HasColumnName("max_accepted_htlcs");
 0208
 0209                    b.Property<decimal>("MaxHtlcAmountInFlight")
 0210                        .HasColumnType("numeric(20,0)")
 0211                        .HasColumnName("max_htlc_amount_in_flight");
 0212
 0213                    b.Property<long>("MinimumDepth")
 0214                        .HasColumnType("bigint")
 0215                        .HasColumnName("minimum_depth");
 0216
 0217                    b.Property<bool>("OptionAnchorOutputs")
 0218                        .HasColumnType("boolean")
 0219                        .HasColumnName("option_anchor_outputs");
 0220
 0221                    b.Property<long>("RemoteDustLimitAmountSats")
 0222                        .HasColumnType("bigint")
 0223                        .HasColumnName("remote_dust_limit_amount_sats");
 0224
 0225                    b.Property<byte[]>("RemoteUpfrontShutdownScript")
 0226                        .HasColumnType("bytea")
 0227                        .HasColumnName("remote_upfront_shutdown_script");
 0228
 0229                    b.Property<int>("ToSelfDelay")
 0230                        .HasColumnType("integer")
 0231                        .HasColumnName("to_self_delay");
 0232
 0233                    b.Property<byte>("UseScidAlias")
 0234                        .HasColumnType("smallint")
 0235                        .HasColumnName("use_scid_alias");
 0236
 0237                    b.HasKey("ChannelId")
 0238                        .HasName("pk_channel_configs");
 0239
 0240                    b.ToTable("channel_configs", (string)null);
 0241                });
 242
 0243            modelBuilder.Entity("NLightning.Infrastructure.Persistence.Entities.Channel.ChannelEntity", b =>
 0244                {
 0245                    b.Property<byte[]>("ChannelId")
 0246                        .HasColumnType("bytea")
 0247                        .HasColumnName("channel_id");
 0248
 0249                    b.Property<byte?>("ChangeAddressAddressType")
 0250                        .HasColumnType("smallint")
 0251                        .HasColumnName("change_address_address_type");
 0252
 0253                    b.Property<long?>("ChangeAddressIndex")
 0254                        .HasColumnType("bigint")
 0255                        .HasColumnName("change_address_index");
 0256
 0257                    b.Property<bool?>("ChangeAddressIsChange")
 0258                        .HasColumnType("boolean")
 0259                        .HasColumnName("change_address_is_change");
 0260
 0261                    b.Property<byte?>("ChangeAddressType")
 0262                        .HasColumnType("smallint")
 0263                        .HasColumnName("change_address_type");
 0264
 0265                    b.Property<long>("FundingAmountSatoshis")
 0266                        .HasColumnType("bigint")
 0267                        .HasColumnName("funding_amount_satoshis");
 0268
 0269                    b.Property<long>("FundingCreatedAtBlockHeight")
 0270                        .HasColumnType("bigint")
 0271                        .HasColumnName("funding_created_at_block_height");
 0272
 0273                    b.Property<int>("FundingOutputIndex")
 0274                        .HasColumnType("integer")
 0275                        .HasColumnName("funding_output_index");
 0276
 0277                    b.Property<byte[]>("FundingTxId")
 0278                        .IsRequired()
 0279                        .HasColumnType("bytea")
 0280                        .HasColumnName("funding_tx_id");
 0281
 0282                    b.Property<bool>("IsInitiator")
 0283                        .HasColumnType("boolean")
 0284                        .HasColumnName("is_initiator");
 0285
 0286                    b.Property<byte[]>("LastReceivedSignature")
 0287                        .HasColumnType("bytea")
 0288                        .HasColumnName("last_received_signature");
 0289
 0290                    b.Property<byte[]>("LastSentSignature")
 0291                        .HasColumnType("bytea")
 0292                        .HasColumnName("last_sent_signature");
 0293
 0294                    b.Property<decimal>("LocalBalanceSatoshis")
 0295                        .HasColumnType("numeric")
 0296                        .HasColumnName("local_balance_satoshis");
 0297
 0298                    b.Property<decimal>("LocalNextHtlcId")
 0299                        .HasColumnType("numeric(20,0)")
 0300                        .HasColumnName("local_next_htlc_id");
 0301
 0302                    b.Property<decimal>("LocalRevocationNumber")
 0303                        .HasColumnType("numeric(20,0)")
 0304                        .HasColumnName("local_revocation_number");
 0305
 0306                    b.Property<byte[]>("PeerEntityNodeId")
 0307                        .HasColumnType("bytea")
 0308                        .HasColumnName("peer_entity_node_id");
 0309
 0310                    b.Property<decimal>("RemoteBalanceSatoshis")
 0311                        .HasColumnType("numeric")
 0312                        .HasColumnName("remote_balance_satoshis");
 0313
 0314                    b.Property<decimal>("RemoteNextHtlcId")
 0315                        .HasColumnType("numeric(20,0)")
 0316                        .HasColumnName("remote_next_htlc_id");
 0317
 0318                    b.Property<byte[]>("RemoteNodeId")
 0319                        .IsRequired()
 0320                        .HasColumnType("bytea")
 0321                        .HasColumnName("remote_node_id");
 0322
 0323                    b.Property<decimal>("RemoteRevocationNumber")
 0324                        .HasColumnType("numeric(20,0)")
 0325                        .HasColumnName("remote_revocation_number");
 0326
 0327                    b.Property<byte>("State")
 0328                        .HasColumnType("smallint")
 0329                        .HasColumnName("state");
 0330
 0331                    b.Property<byte>("Version")
 0332                        .HasColumnType("smallint")
 0333                        .HasColumnName("version");
 0334
 0335                    b.HasKey("ChannelId")
 0336                        .HasName("pk_channels");
 0337
 0338                    b.HasIndex("PeerEntityNodeId")
 0339                        .HasDatabaseName("ix_channels_peer_entity_node_id");
 0340
 0341                    b.HasIndex("ChangeAddressIndex", "ChangeAddressIsChange", "ChangeAddressAddressType")
 0342                        .HasDatabaseName("ix_channels_change_address_index_change_address_is_change_chan");
 0343
 0344                    b.ToTable("channels", (string)null);
 0345                });
 346
 0347            modelBuilder.Entity("NLightning.Infrastructure.Persistence.Entities.Channel.ChannelKeySetEntity", b =>
 0348                {
 0349                    b.Property<byte[]>("ChannelId")
 0350                        .HasColumnType("bytea")
 0351                        .HasColumnName("channel_id");
 0352
 0353                    b.Property<bool>("IsLocal")
 0354                        .HasColumnType("boolean")
 0355                        .HasColumnName("is_local");
 0356
 0357                    b.Property<decimal>("CurrentPerCommitmentIndex")
 0358                        .HasColumnType("numeric(20,0)")
 0359                        .HasColumnName("current_per_commitment_index");
 0360
 0361                    b.Property<byte[]>("CurrentPerCommitmentPoint")
 0362                        .IsRequired()
 0363                        .HasColumnType("bytea")
 0364                        .HasColumnName("current_per_commitment_point");
 0365
 0366                    b.Property<byte[]>("DelayedPaymentBasepoint")
 0367                        .IsRequired()
 0368                        .HasColumnType("bytea")
 0369                        .HasColumnName("delayed_payment_basepoint");
 0370
 0371                    b.Property<byte[]>("FundingPubKey")
 0372                        .IsRequired()
 0373                        .HasColumnType("bytea")
 0374                        .HasColumnName("funding_pub_key");
 0375
 0376                    b.Property<byte[]>("HtlcBasepoint")
 0377                        .IsRequired()
 0378                        .HasColumnType("bytea")
 0379                        .HasColumnName("htlc_basepoint");
 0380
 0381                    b.Property<long>("KeyIndex")
 0382                        .HasColumnType("bigint")
 0383                        .HasColumnName("key_index");
 0384
 0385                    b.Property<byte[]>("LastRevealedPerCommitmentSecret")
 0386                        .HasColumnType("bytea")
 0387                        .HasColumnName("last_revealed_per_commitment_secret");
 0388
 0389                    b.Property<byte[]>("PaymentBasepoint")
 0390                        .IsRequired()
 0391                        .HasColumnType("bytea")
 0392                        .HasColumnName("payment_basepoint");
 0393
 0394                    b.Property<byte[]>("RevocationBasepoint")
 0395                        .IsRequired()
 0396                        .HasColumnType("bytea")
 0397                        .HasColumnName("revocation_basepoint");
 0398
 0399                    b.HasKey("ChannelId", "IsLocal")
 0400                        .HasName("pk_channel_key_sets");
 0401
 0402                    b.ToTable("channel_key_sets", (string)null);
 0403                });
 404
 0405            modelBuilder.Entity("NLightning.Infrastructure.Persistence.Entities.Channel.HtlcEntity", b =>
 0406                {
 0407                    b.Property<byte[]>("ChannelId")
 0408                        .HasColumnType("bytea")
 0409                        .HasColumnName("channel_id");
 0410
 0411                    b.Property<decimal>("HtlcId")
 0412                        .HasColumnType("numeric(20,0)")
 0413                        .HasColumnName("htlc_id");
 0414
 0415                    b.Property<byte>("Direction")
 0416                        .HasColumnType("smallint")
 0417                        .HasColumnName("direction");
 0418
 0419                    b.Property<byte[]>("AddMessageBytes")
 0420                        .IsRequired()
 0421                        .HasColumnType("bytea")
 0422                        .HasColumnName("add_message_bytes");
 0423
 0424                    b.Property<decimal>("AmountMsat")
 0425                        .HasColumnType("numeric(20,0)")
 0426                        .HasColumnName("amount_msat");
 0427
 0428                    b.Property<long>("CltvExpiry")
 0429                        .HasColumnType("bigint")
 0430                        .HasColumnName("cltv_expiry");
 0431
 0432                    b.Property<decimal>("ObscuredCommitmentNumber")
 0433                        .HasColumnType("numeric(20,0)")
 0434                        .HasColumnName("obscured_commitment_number");
 0435
 0436                    b.Property<byte[]>("PaymentHash")
 0437                        .IsRequired()
 0438                        .HasColumnType("bytea")
 0439                        .HasColumnName("payment_hash");
 0440
 0441                    b.Property<byte[]>("PaymentPreimage")
 0442                        .HasColumnType("bytea")
 0443                        .HasColumnName("payment_preimage");
 0444
 0445                    b.Property<byte[]>("Signature")
 0446                        .HasColumnType("bytea")
 0447                        .HasColumnName("signature");
 0448
 0449                    b.Property<byte>("State")
 0450                        .HasColumnType("smallint")
 0451                        .HasColumnName("state");
 0452
 0453                    b.HasKey("ChannelId", "HtlcId", "Direction")
 0454                        .HasName("pk_htlcs");
 0455
 0456                    b.ToTable("htlcs", (string)null);
 0457                });
 458
 0459            modelBuilder.Entity("NLightning.Infrastructure.Persistence.Entities.Node.PeerEntity", b =>
 0460                {
 0461                    b.Property<byte[]>("NodeId")
 0462                        .HasColumnType("bytea")
 0463                        .HasColumnName("node_id");
 0464
 0465                    b.Property<string>("Host")
 0466                        .IsRequired()
 0467                        .HasColumnType("text")
 0468                        .HasColumnName("host");
 0469
 0470                    b.Property<DateTime>("LastSeenAt")
 0471                        .HasColumnType("timestamp with time zone")
 0472                        .HasColumnName("last_seen_at");
 0473
 0474                    b.Property<long>("Port")
 0475                        .HasColumnType("bigint")
 0476                        .HasColumnName("port");
 0477
 0478                    b.Property<string>("Type")
 0479                        .IsRequired()
 0480                        .HasColumnType("text")
 0481                        .HasColumnName("type");
 0482
 0483                    b.HasKey("NodeId")
 0484                        .HasName("pk_peers");
 0485
 0486                    b.ToTable("peers", (string)null);
 0487                });
 488
 0489            modelBuilder.Entity("NLightning.Infrastructure.Persistence.Entities.Bitcoin.UtxoEntity", b =>
 0490                {
 0491                    b.HasOne("NLightning.Infrastructure.Persistence.Entities.Bitcoin.WalletAddressEntity", "WalletAddres
 0492                        .WithMany("Utxos")
 0493                        .HasForeignKey("AddressIndex", "IsAddressChange", "AddressType")
 0494                        .OnDelete(DeleteBehavior.Cascade)
 0495                        .IsRequired()
 0496                        .HasConstraintName("fk_utxos_wallet_addresses_address_index_is_address_change_addr");
 0497
 0498                    b.Navigation("WalletAddress");
 0499                });
 500
 0501            modelBuilder.Entity("NLightning.Infrastructure.Persistence.Entities.Bitcoin.WatchedTransactionEntity", b =>
 0502                {
 0503                    b.HasOne("NLightning.Infrastructure.Persistence.Entities.Channel.ChannelEntity", null)
 0504                        .WithMany("WatchedTransactions")
 0505                        .HasForeignKey("ChannelId")
 0506                        .OnDelete(DeleteBehavior.Cascade)
 0507                        .IsRequired()
 0508                        .HasConstraintName("fk_watched_transactions_channels_channel_id");
 0509                });
 510
 0511            modelBuilder.Entity("NLightning.Infrastructure.Persistence.Entities.Channel.ChannelConfigEntity", b =>
 0512                {
 0513                    b.HasOne("NLightning.Infrastructure.Persistence.Entities.Channel.ChannelEntity", null)
 0514                        .WithOne("Config")
 0515                        .HasForeignKey("NLightning.Infrastructure.Persistence.Entities.Channel.ChannelConfigEntity", "Ch
 0516                        .OnDelete(DeleteBehavior.Cascade)
 0517                        .IsRequired()
 0518                        .HasConstraintName("fk_channel_configs_channels_channel_id");
 0519                });
 520
 0521            modelBuilder.Entity("NLightning.Infrastructure.Persistence.Entities.Channel.ChannelEntity", b =>
 0522                {
 0523                    b.HasOne("NLightning.Infrastructure.Persistence.Entities.Node.PeerEntity", null)
 0524                        .WithMany("Channels")
 0525                        .HasForeignKey("PeerEntityNodeId")
 0526                        .HasConstraintName("fk_channels_peers_peer_entity_node_id");
 0527
 0528                    b.HasOne("NLightning.Infrastructure.Persistence.Entities.Bitcoin.WalletAddressEntity", "ChangeAddres
 0529                        .WithMany()
 0530                        .HasForeignKey("ChangeAddressIndex", "ChangeAddressIsChange", "ChangeAddressAddressType")
 0531                        .HasConstraintName("fk_channels_wallet_addresses_change_address_index_change_addre");
 0532
 0533                    b.Navigation("ChangeAddress");
 0534                });
 535
 0536            modelBuilder.Entity("NLightning.Infrastructure.Persistence.Entities.Channel.ChannelKeySetEntity", b =>
 0537                {
 0538                    b.HasOne("NLightning.Infrastructure.Persistence.Entities.Channel.ChannelEntity", null)
 0539                        .WithMany("KeySets")
 0540                        .HasForeignKey("ChannelId")
 0541                        .OnDelete(DeleteBehavior.Cascade)
 0542                        .IsRequired()
 0543                        .HasConstraintName("fk_channel_key_sets_channels_channel_id");
 0544                });
 545
 0546            modelBuilder.Entity("NLightning.Infrastructure.Persistence.Entities.Channel.HtlcEntity", b =>
 0547                {
 0548                    b.HasOne("NLightning.Infrastructure.Persistence.Entities.Channel.ChannelEntity", null)
 0549                        .WithMany("Htlcs")
 0550                        .HasForeignKey("ChannelId")
 0551                        .OnDelete(DeleteBehavior.Cascade)
 0552                        .IsRequired()
 0553                        .HasConstraintName("fk_htlcs_channels_channel_id");
 0554                });
 555
 0556            modelBuilder.Entity("NLightning.Infrastructure.Persistence.Entities.Bitcoin.WalletAddressEntity", b =>
 0557                {
 0558                    b.Navigation("Utxos");
 0559                });
 560
 0561            modelBuilder.Entity("NLightning.Infrastructure.Persistence.Entities.Channel.ChannelEntity", b =>
 0562                {
 0563                    b.Navigation("Config");
 0564
 0565                    b.Navigation("Htlcs");
 0566
 0567                    b.Navigation("KeySets");
 0568
 0569                    b.Navigation("WatchedTransactions");
 0570                });
 571
 0572            modelBuilder.Entity("NLightning.Infrastructure.Persistence.Entities.Node.PeerEntity", b =>
 0573                {
 0574                    b.Navigation("Channels");
 0575                });
 576#pragma warning restore 612, 618
 0577        }
 578    }
 579}