| | 1 | | // <auto-generated /> |
| | 2 | | using System; |
| | 3 | | using Microsoft.EntityFrameworkCore; |
| | 4 | | using Microsoft.EntityFrameworkCore.Infrastructure; |
| | 5 | | using Microsoft.EntityFrameworkCore.Migrations; |
| | 6 | | using Microsoft.EntityFrameworkCore.Storage.ValueConversion; |
| | 7 | | using NLightning.Infrastructure.Persistence.Contexts; |
| | 8 | | using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; |
| | 9 | |
|
| | 10 | | #nullable disable |
| | 11 | |
|
| | 12 | | namespace NLightning.Infrastructure.Persistence.Postgres.Migrations |
| | 13 | | { |
| | 14 | | [DbContext(typeof(NLightningDbContext))] |
| | 15 | | [Migration("20250606153442_Initial")] |
| | 16 | | partial class Initial |
| | 17 | | { |
| | 18 | | /// <inheritdoc /> |
| | 19 | | protected override void BuildTargetModel(ModelBuilder modelBuilder) |
| | 20 | | { |
| | 21 | | #pragma warning disable 612, 618 |
| 0 | 22 | | modelBuilder |
| 0 | 23 | | .HasAnnotation("ProductVersion", "8.0.12") |
| 0 | 24 | | .HasAnnotation("Relational:MaxIdentifierLength", 63); |
| | 25 | |
|
| 0 | 26 | | NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); |
| | 27 | |
|
| 0 | 28 | | modelBuilder.Entity("NLightning.Infrastructure.Persistence.Entities.ChannelConfigEntity", b => |
| 0 | 29 | | { |
| 0 | 30 | | b.Property<byte[]>("ChannelId") |
| 0 | 31 | | .HasColumnType("bytea") |
| 0 | 32 | | .HasColumnName("channel_id"); |
| 0 | 33 | |
|
| 0 | 34 | | b.Property<long?>("ChannelReserveAmountSats") |
| 0 | 35 | | .HasColumnType("bigint") |
| 0 | 36 | | .HasColumnName("channel_reserve_amount_sats"); |
| 0 | 37 | |
|
| 0 | 38 | | b.Property<long>("FeeRatePerKwSatoshis") |
| 0 | 39 | | .HasColumnType("bigint") |
| 0 | 40 | | .HasColumnName("fee_rate_per_kw_satoshis"); |
| 0 | 41 | |
|
| 0 | 42 | | b.Property<decimal>("HtlcMinimumMsat") |
| 0 | 43 | | .HasColumnType("numeric(20,0)") |
| 0 | 44 | | .HasColumnName("htlc_minimum_msat"); |
| 0 | 45 | |
|
| 0 | 46 | | b.Property<long>("LocalDustLimitAmountSats") |
| 0 | 47 | | .HasColumnType("bigint") |
| 0 | 48 | | .HasColumnName("local_dust_limit_amount_sats"); |
| 0 | 49 | |
|
| 0 | 50 | | b.Property<byte[]>("LocalUpfrontShutdownScript") |
| 0 | 51 | | .HasColumnType("bytea") |
| 0 | 52 | | .HasColumnName("local_upfront_shutdown_script"); |
| 0 | 53 | |
|
| 0 | 54 | | b.Property<int>("MaxAcceptedHtlcs") |
| 0 | 55 | | .HasColumnType("integer") |
| 0 | 56 | | .HasColumnName("max_accepted_htlcs"); |
| 0 | 57 | |
|
| 0 | 58 | | b.Property<decimal>("MaxHtlcAmountInFlight") |
| 0 | 59 | | .HasColumnType("numeric(20,0)") |
| 0 | 60 | | .HasColumnName("max_htlc_amount_in_flight"); |
| 0 | 61 | |
|
| 0 | 62 | | b.Property<long>("MinimumDepth") |
| 0 | 63 | | .HasColumnType("bigint") |
| 0 | 64 | | .HasColumnName("minimum_depth"); |
| 0 | 65 | |
|
| 0 | 66 | | b.Property<bool>("OptionAnchorOutputs") |
| 0 | 67 | | .HasColumnType("boolean") |
| 0 | 68 | | .HasColumnName("option_anchor_outputs"); |
| 0 | 69 | |
|
| 0 | 70 | | b.Property<long>("RemoteDustLimitAmountSats") |
| 0 | 71 | | .HasColumnType("bigint") |
| 0 | 72 | | .HasColumnName("remote_dust_limit_amount_sats"); |
| 0 | 73 | |
|
| 0 | 74 | | b.Property<byte[]>("RemoteUpfrontShutdownScript") |
| 0 | 75 | | .HasColumnType("bytea") |
| 0 | 76 | | .HasColumnName("remote_upfront_shutdown_script"); |
| 0 | 77 | |
|
| 0 | 78 | | b.Property<int>("ToSelfDelay") |
| 0 | 79 | | .HasColumnType("integer") |
| 0 | 80 | | .HasColumnName("to_self_delay"); |
| 0 | 81 | |
|
| 0 | 82 | | b.Property<byte>("UseScidAlias") |
| 0 | 83 | | .HasColumnType("smallint") |
| 0 | 84 | | .HasColumnName("use_scid_alias"); |
| 0 | 85 | |
|
| 0 | 86 | | b.HasKey("ChannelId") |
| 0 | 87 | | .HasName("pk_channel_configs"); |
| 0 | 88 | |
|
| 0 | 89 | | b.ToTable("channel_configs", (string)null); |
| 0 | 90 | | }); |
| | 91 | |
|
| 0 | 92 | | modelBuilder.Entity("NLightning.Infrastructure.Persistence.Entities.ChannelEntity", b => |
| 0 | 93 | | { |
| 0 | 94 | | b.Property<byte[]>("ChannelId") |
| 0 | 95 | | .HasColumnType("bytea") |
| 0 | 96 | | .HasColumnName("channel_id"); |
| 0 | 97 | |
|
| 0 | 98 | | b.Property<long>("FundingAmountSatoshis") |
| 0 | 99 | | .HasColumnType("bigint") |
| 0 | 100 | | .HasColumnName("funding_amount_satoshis"); |
| 0 | 101 | |
|
| 0 | 102 | | b.Property<long>("FundingCreatedAtBlockHeight") |
| 0 | 103 | | .HasColumnType("bigint") |
| 0 | 104 | | .HasColumnName("funding_created_at_block_height"); |
| 0 | 105 | |
|
| 0 | 106 | | b.Property<long>("FundingOutputIndex") |
| 0 | 107 | | .HasColumnType("bigint") |
| 0 | 108 | | .HasColumnName("funding_output_index"); |
| 0 | 109 | |
|
| 0 | 110 | | b.Property<byte[]>("FundingTxId") |
| 0 | 111 | | .IsRequired() |
| 0 | 112 | | .HasColumnType("bytea") |
| 0 | 113 | | .HasColumnName("funding_tx_id"); |
| 0 | 114 | |
|
| 0 | 115 | | b.Property<bool>("IsInitiator") |
| 0 | 116 | | .HasColumnType("boolean") |
| 0 | 117 | | .HasColumnName("is_initiator"); |
| 0 | 118 | |
|
| 0 | 119 | | b.Property<byte[]>("LastReceivedSignature") |
| 0 | 120 | | .HasColumnType("bytea") |
| 0 | 121 | | .HasColumnName("last_received_signature"); |
| 0 | 122 | |
|
| 0 | 123 | | b.Property<byte[]>("LastSentSignature") |
| 0 | 124 | | .HasColumnType("bytea") |
| 0 | 125 | | .HasColumnName("last_sent_signature"); |
| 0 | 126 | |
|
| 0 | 127 | | b.Property<decimal>("LocalBalanceSatoshis") |
| 0 | 128 | | .HasColumnType("numeric") |
| 0 | 129 | | .HasColumnName("local_balance_satoshis"); |
| 0 | 130 | |
|
| 0 | 131 | | b.Property<decimal>("LocalNextHtlcId") |
| 0 | 132 | | .HasColumnType("numeric(20,0)") |
| 0 | 133 | | .HasColumnName("local_next_htlc_id"); |
| 0 | 134 | |
|
| 0 | 135 | | b.Property<decimal>("LocalRevocationNumber") |
| 0 | 136 | | .HasColumnType("numeric(20,0)") |
| 0 | 137 | | .HasColumnName("local_revocation_number"); |
| 0 | 138 | |
|
| 0 | 139 | | b.Property<decimal>("RemoteBalanceSatoshis") |
| 0 | 140 | | .HasColumnType("numeric") |
| 0 | 141 | | .HasColumnName("remote_balance_satoshis"); |
| 0 | 142 | |
|
| 0 | 143 | | b.Property<decimal>("RemoteNextHtlcId") |
| 0 | 144 | | .HasColumnType("numeric(20,0)") |
| 0 | 145 | | .HasColumnName("remote_next_htlc_id"); |
| 0 | 146 | |
|
| 0 | 147 | | b.Property<byte[]>("RemoteNodeId") |
| 0 | 148 | | .IsRequired() |
| 0 | 149 | | .HasColumnType("bytea") |
| 0 | 150 | | .HasColumnName("remote_node_id"); |
| 0 | 151 | |
|
| 0 | 152 | | b.Property<decimal>("RemoteRevocationNumber") |
| 0 | 153 | | .HasColumnType("numeric(20,0)") |
| 0 | 154 | | .HasColumnName("remote_revocation_number"); |
| 0 | 155 | |
|
| 0 | 156 | | b.Property<byte>("State") |
| 0 | 157 | | .HasColumnType("smallint") |
| 0 | 158 | | .HasColumnName("state"); |
| 0 | 159 | |
|
| 0 | 160 | | b.Property<byte>("Version") |
| 0 | 161 | | .HasColumnType("smallint") |
| 0 | 162 | | .HasColumnName("version"); |
| 0 | 163 | |
|
| 0 | 164 | | b.HasKey("ChannelId") |
| 0 | 165 | | .HasName("pk_channels"); |
| 0 | 166 | |
|
| 0 | 167 | | b.ToTable("channels", (string)null); |
| 0 | 168 | | }); |
| | 169 | |
|
| 0 | 170 | | modelBuilder.Entity("NLightning.Infrastructure.Persistence.Entities.ChannelKeySetEntity", b => |
| 0 | 171 | | { |
| 0 | 172 | | b.Property<byte[]>("ChannelId") |
| 0 | 173 | | .HasColumnType("bytea") |
| 0 | 174 | | .HasColumnName("channel_id"); |
| 0 | 175 | |
|
| 0 | 176 | | b.Property<bool>("IsLocal") |
| 0 | 177 | | .HasColumnType("boolean") |
| 0 | 178 | | .HasColumnName("is_local"); |
| 0 | 179 | |
|
| 0 | 180 | | b.Property<decimal>("CurrentPerCommitmentIndex") |
| 0 | 181 | | .HasColumnType("numeric(20,0)") |
| 0 | 182 | | .HasColumnName("current_per_commitment_index"); |
| 0 | 183 | |
|
| 0 | 184 | | b.Property<byte[]>("CurrentPerCommitmentPoint") |
| 0 | 185 | | .IsRequired() |
| 0 | 186 | | .HasColumnType("bytea") |
| 0 | 187 | | .HasColumnName("current_per_commitment_point"); |
| 0 | 188 | |
|
| 0 | 189 | | b.Property<byte[]>("DelayedPaymentBasepoint") |
| 0 | 190 | | .IsRequired() |
| 0 | 191 | | .HasColumnType("bytea") |
| 0 | 192 | | .HasColumnName("delayed_payment_basepoint"); |
| 0 | 193 | |
|
| 0 | 194 | | b.Property<byte[]>("FundingPubKey") |
| 0 | 195 | | .IsRequired() |
| 0 | 196 | | .HasColumnType("bytea") |
| 0 | 197 | | .HasColumnName("funding_pub_key"); |
| 0 | 198 | |
|
| 0 | 199 | | b.Property<byte[]>("HtlcBasepoint") |
| 0 | 200 | | .IsRequired() |
| 0 | 201 | | .HasColumnType("bytea") |
| 0 | 202 | | .HasColumnName("htlc_basepoint"); |
| 0 | 203 | |
|
| 0 | 204 | | b.Property<long>("KeyIndex") |
| 0 | 205 | | .HasColumnType("bigint") |
| 0 | 206 | | .HasColumnName("key_index"); |
| 0 | 207 | |
|
| 0 | 208 | | b.Property<byte[]>("LastRevealedPerCommitmentSecret") |
| 0 | 209 | | .HasColumnType("bytea") |
| 0 | 210 | | .HasColumnName("last_revealed_per_commitment_secret"); |
| 0 | 211 | |
|
| 0 | 212 | | b.Property<byte[]>("PaymentBasepoint") |
| 0 | 213 | | .IsRequired() |
| 0 | 214 | | .HasColumnType("bytea") |
| 0 | 215 | | .HasColumnName("payment_basepoint"); |
| 0 | 216 | |
|
| 0 | 217 | | b.Property<byte[]>("RevocationBasepoint") |
| 0 | 218 | | .IsRequired() |
| 0 | 219 | | .HasColumnType("bytea") |
| 0 | 220 | | .HasColumnName("revocation_basepoint"); |
| 0 | 221 | |
|
| 0 | 222 | | b.HasKey("ChannelId", "IsLocal") |
| 0 | 223 | | .HasName("pk_channel_key_sets"); |
| 0 | 224 | |
|
| 0 | 225 | | b.ToTable("channel_key_sets", (string)null); |
| 0 | 226 | | }); |
| | 227 | |
|
| 0 | 228 | | modelBuilder.Entity("NLightning.Infrastructure.Persistence.Entities.HtlcEntity", b => |
| 0 | 229 | | { |
| 0 | 230 | | b.Property<byte[]>("ChannelId") |
| 0 | 231 | | .HasColumnType("bytea") |
| 0 | 232 | | .HasColumnName("channel_id"); |
| 0 | 233 | |
|
| 0 | 234 | | b.Property<decimal>("HtlcId") |
| 0 | 235 | | .HasColumnType("numeric(20,0)") |
| 0 | 236 | | .HasColumnName("htlc_id"); |
| 0 | 237 | |
|
| 0 | 238 | | b.Property<byte>("Direction") |
| 0 | 239 | | .HasColumnType("smallint") |
| 0 | 240 | | .HasColumnName("direction"); |
| 0 | 241 | |
|
| 0 | 242 | | b.Property<byte[]>("AddMessageBytes") |
| 0 | 243 | | .IsRequired() |
| 0 | 244 | | .HasColumnType("bytea") |
| 0 | 245 | | .HasColumnName("add_message_bytes"); |
| 0 | 246 | |
|
| 0 | 247 | | b.Property<decimal>("AmountMsat") |
| 0 | 248 | | .HasColumnType("numeric(20,0)") |
| 0 | 249 | | .HasColumnName("amount_msat"); |
| 0 | 250 | |
|
| 0 | 251 | | b.Property<long>("CltvExpiry") |
| 0 | 252 | | .HasColumnType("bigint") |
| 0 | 253 | | .HasColumnName("cltv_expiry"); |
| 0 | 254 | |
|
| 0 | 255 | | b.Property<decimal>("ObscuredCommitmentNumber") |
| 0 | 256 | | .HasColumnType("numeric(20,0)") |
| 0 | 257 | | .HasColumnName("obscured_commitment_number"); |
| 0 | 258 | |
|
| 0 | 259 | | b.Property<byte[]>("PaymentHash") |
| 0 | 260 | | .IsRequired() |
| 0 | 261 | | .HasColumnType("bytea") |
| 0 | 262 | | .HasColumnName("payment_hash"); |
| 0 | 263 | |
|
| 0 | 264 | | b.Property<byte[]>("PaymentPreimage") |
| 0 | 265 | | .HasColumnType("bytea") |
| 0 | 266 | | .HasColumnName("payment_preimage"); |
| 0 | 267 | |
|
| 0 | 268 | | b.Property<byte[]>("Signature") |
| 0 | 269 | | .HasColumnType("bytea") |
| 0 | 270 | | .HasColumnName("signature"); |
| 0 | 271 | |
|
| 0 | 272 | | b.Property<byte>("State") |
| 0 | 273 | | .HasColumnType("smallint") |
| 0 | 274 | | .HasColumnName("state"); |
| 0 | 275 | |
|
| 0 | 276 | | b.HasKey("ChannelId", "HtlcId", "Direction") |
| 0 | 277 | | .HasName("pk_htlcs"); |
| 0 | 278 | |
|
| 0 | 279 | | b.ToTable("htlcs", (string)null); |
| 0 | 280 | | }); |
| | 281 | |
|
| 0 | 282 | | modelBuilder.Entity("NLightning.Infrastructure.Persistence.Entities.ChannelConfigEntity", b => |
| 0 | 283 | | { |
| 0 | 284 | | b.HasOne("NLightning.Infrastructure.Persistence.Entities.ChannelEntity", null) |
| 0 | 285 | | .WithOne("Config") |
| 0 | 286 | | .HasForeignKey("NLightning.Infrastructure.Persistence.Entities.ChannelConfigEntity", "ChannelId" |
| 0 | 287 | | .OnDelete(DeleteBehavior.Cascade) |
| 0 | 288 | | .IsRequired() |
| 0 | 289 | | .HasConstraintName("fk_channel_configs_channels_channel_id"); |
| 0 | 290 | | }); |
| | 291 | |
|
| 0 | 292 | | modelBuilder.Entity("NLightning.Infrastructure.Persistence.Entities.ChannelKeySetEntity", b => |
| 0 | 293 | | { |
| 0 | 294 | | b.HasOne("NLightning.Infrastructure.Persistence.Entities.ChannelEntity", null) |
| 0 | 295 | | .WithMany("KeySets") |
| 0 | 296 | | .HasForeignKey("ChannelId") |
| 0 | 297 | | .OnDelete(DeleteBehavior.Cascade) |
| 0 | 298 | | .IsRequired() |
| 0 | 299 | | .HasConstraintName("fk_channel_key_sets_channels_channel_id"); |
| 0 | 300 | | }); |
| | 301 | |
|
| 0 | 302 | | modelBuilder.Entity("NLightning.Infrastructure.Persistence.Entities.HtlcEntity", b => |
| 0 | 303 | | { |
| 0 | 304 | | b.HasOne("NLightning.Infrastructure.Persistence.Entities.ChannelEntity", null) |
| 0 | 305 | | .WithMany("Htlcs") |
| 0 | 306 | | .HasForeignKey("ChannelId") |
| 0 | 307 | | .OnDelete(DeleteBehavior.Cascade) |
| 0 | 308 | | .IsRequired() |
| 0 | 309 | | .HasConstraintName("fk_htlcs_channels_channel_id"); |
| 0 | 310 | | }); |
| | 311 | |
|
| 0 | 312 | | modelBuilder.Entity("NLightning.Infrastructure.Persistence.Entities.ChannelEntity", b => |
| 0 | 313 | | { |
| 0 | 314 | | b.Navigation("Config"); |
| 0 | 315 | |
|
| 0 | 316 | | b.Navigation("Htlcs"); |
| 0 | 317 | |
|
| 0 | 318 | | b.Navigation("KeySets"); |
| 0 | 319 | | }); |
| | 320 | | #pragma warning restore 612, 618 |
| 0 | 321 | | } |
| | 322 | | } |
| | 323 | | } |