diff --git a/Tzkt.Data/Migrations/20201028165049_Triggers.Designer.cs b/Tzkt.Data/Migrations/20201028165049_Triggers.Designer.cs
new file mode 100644
index 000000000..91f8d81b7
--- /dev/null
+++ b/Tzkt.Data/Migrations/20201028165049_Triggers.Designer.cs
@@ -0,0 +1,2334 @@
+//
+using System;
+using System.Collections.Generic;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
+using Tzkt.Data;
+using Tzkt.Data.Models;
+
+namespace Tzkt.Data.Migrations
+{
+ [DbContext(typeof(TzktContext))]
+ [Migration("20201028165049_Triggers")]
+ partial class Triggers
+ {
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn)
+ .HasAnnotation("ProductVersion", "3.1.7")
+ .HasAnnotation("Relational:MaxIdentifierLength", 63);
+
+ modelBuilder.Entity("Tzkt.Data.Models.Account", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
+
+ b.Property("Address")
+ .IsRequired()
+ .HasColumnType("character(36)")
+ .IsFixedLength(true)
+ .HasMaxLength(36);
+
+ b.Property("Balance")
+ .HasColumnType("bigint");
+
+ b.Property("ContractsCount")
+ .HasColumnType("integer");
+
+ b.Property("Counter")
+ .HasColumnType("bigint");
+
+ b.Property("DelegateId")
+ .HasColumnType("integer");
+
+ b.Property("DelegationLevel")
+ .HasColumnType("integer");
+
+ b.Property("DelegationsCount")
+ .HasColumnType("integer");
+
+ b.Property("FirstLevel")
+ .HasColumnType("integer");
+
+ b.Property("LastLevel")
+ .HasColumnType("integer");
+
+ b.Property("MigrationsCount")
+ .HasColumnType("integer");
+
+ b.Property("OriginationsCount")
+ .HasColumnType("integer");
+
+ b.Property("RevealsCount")
+ .HasColumnType("integer");
+
+ b.Property("Staked")
+ .HasColumnType("boolean");
+
+ b.Property("TransactionsCount")
+ .HasColumnType("integer");
+
+ b.Property("Type")
+ .HasColumnType("smallint");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Address")
+ .IsUnique();
+
+ b.HasIndex("DelegateId");
+
+ b.HasIndex("FirstLevel");
+
+ b.HasIndex("Id")
+ .IsUnique();
+
+ b.HasIndex("Staked");
+
+ b.HasIndex("Type");
+
+ b.ToTable("Accounts");
+
+ b.HasDiscriminator("Type");
+ });
+
+ modelBuilder.Entity("Tzkt.Data.Models.ActivationOperation", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
+
+ b.Property("AccountId")
+ .HasColumnType("integer");
+
+ b.Property("Balance")
+ .HasColumnType("bigint");
+
+ b.Property("Level")
+ .HasColumnType("integer");
+
+ b.Property("OpHash")
+ .IsRequired()
+ .HasColumnType("character(51)")
+ .IsFixedLength(true)
+ .HasMaxLength(51);
+
+ b.Property("Timestamp")
+ .HasColumnType("timestamp without time zone");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AccountId")
+ .IsUnique();
+
+ b.HasIndex("Level");
+
+ b.HasIndex("OpHash");
+
+ b.ToTable("ActivationOps");
+ });
+
+ modelBuilder.Entity("Tzkt.Data.Models.AppState", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
+
+ b.Property("AccountCounter")
+ .HasColumnType("integer");
+
+ b.Property("AccountsCount")
+ .HasColumnType("integer");
+
+ b.Property("ActivationOpsCount")
+ .HasColumnType("integer");
+
+ b.Property("BallotOpsCount")
+ .HasColumnType("integer");
+
+ b.Property("BlocksCount")
+ .HasColumnType("integer");
+
+ b.Property("CommitmentsCount")
+ .HasColumnType("integer");
+
+ b.Property("CyclesCount")
+ .HasColumnType("integer");
+
+ b.Property("DelegationOpsCount")
+ .HasColumnType("integer");
+
+ b.Property("DoubleBakingOpsCount")
+ .HasColumnType("integer");
+
+ b.Property("DoubleEndorsingOpsCount")
+ .HasColumnType("integer");
+
+ b.Property("EndorsementOpsCount")
+ .HasColumnType("integer");
+
+ b.Property("Hash")
+ .HasColumnType("text");
+
+ b.Property("KnownHead")
+ .HasColumnType("integer");
+
+ b.Property("LastSync")
+ .HasColumnType("timestamp without time zone");
+
+ b.Property("Level")
+ .HasColumnType("integer");
+
+ b.Property("ManagerCounter")
+ .HasColumnType("integer");
+
+ b.Property("MigrationOpsCount")
+ .HasColumnType("integer");
+
+ b.Property("NextProtocol")
+ .HasColumnType("text");
+
+ b.Property("NonceRevelationOpsCount")
+ .HasColumnType("integer");
+
+ b.Property("OperationCounter")
+ .HasColumnType("integer");
+
+ b.Property("OriginationOpsCount")
+ .HasColumnType("integer");
+
+ b.Property("ProposalOpsCount")
+ .HasColumnType("integer");
+
+ b.Property("ProposalsCount")
+ .HasColumnType("integer");
+
+ b.Property("Protocol")
+ .HasColumnType("text");
+
+ b.Property("ProtocolsCount")
+ .HasColumnType("integer");
+
+ b.Property("QuoteBtc")
+ .HasColumnType("double precision");
+
+ b.Property("QuoteCny")
+ .HasColumnType("double precision");
+
+ b.Property("QuoteEur")
+ .HasColumnType("double precision");
+
+ b.Property("QuoteJpy")
+ .HasColumnType("double precision");
+
+ b.Property("QuoteKrw")
+ .HasColumnType("double precision");
+
+ b.Property("QuoteLevel")
+ .HasColumnType("integer");
+
+ b.Property("QuoteUsd")
+ .HasColumnType("double precision");
+
+ b.Property("RevealOpsCount")
+ .HasColumnType("integer");
+
+ b.Property("RevelationPenaltyOpsCount")
+ .HasColumnType("integer");
+
+ b.Property("Timestamp")
+ .HasColumnType("timestamp without time zone");
+
+ b.Property("TransactionOpsCount")
+ .HasColumnType("integer");
+
+ b.HasKey("Id");
+
+ b.ToTable("AppState");
+
+ b.HasData(
+ new
+ {
+ Id = -1,
+ AccountCounter = 0,
+ AccountsCount = 0,
+ ActivationOpsCount = 0,
+ BallotOpsCount = 0,
+ BlocksCount = 0,
+ CommitmentsCount = 0,
+ CyclesCount = 0,
+ DelegationOpsCount = 0,
+ DoubleBakingOpsCount = 0,
+ DoubleEndorsingOpsCount = 0,
+ EndorsementOpsCount = 0,
+ Hash = "",
+ KnownHead = 0,
+ LastSync = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
+ Level = -1,
+ ManagerCounter = 0,
+ MigrationOpsCount = 0,
+ NextProtocol = "",
+ NonceRevelationOpsCount = 0,
+ OperationCounter = 0,
+ OriginationOpsCount = 0,
+ ProposalOpsCount = 0,
+ ProposalsCount = 0,
+ Protocol = "",
+ ProtocolsCount = 0,
+ QuoteBtc = 0.0,
+ QuoteCny = 0.0,
+ QuoteEur = 0.0,
+ QuoteJpy = 0.0,
+ QuoteKrw = 0.0,
+ QuoteLevel = -1,
+ QuoteUsd = 0.0,
+ RevealOpsCount = 0,
+ RevelationPenaltyOpsCount = 0,
+ Timestamp = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
+ TransactionOpsCount = 0
+ });
+ });
+
+ modelBuilder.Entity("Tzkt.Data.Models.BakerCycle", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
+
+ b.Property("BakerId")
+ .HasColumnType("integer");
+
+ b.Property("BlockDeposits")
+ .HasColumnType("bigint");
+
+ b.Property("Cycle")
+ .HasColumnType("integer");
+
+ b.Property("DelegatedBalance")
+ .HasColumnType("bigint");
+
+ b.Property("DelegatorsCount")
+ .HasColumnType("integer");
+
+ b.Property("DoubleBakingLostDeposits")
+ .HasColumnType("bigint");
+
+ b.Property("DoubleBakingLostFees")
+ .HasColumnType("bigint");
+
+ b.Property("DoubleBakingLostRewards")
+ .HasColumnType("bigint");
+
+ b.Property("DoubleBakingRewards")
+ .HasColumnType("bigint");
+
+ b.Property("DoubleEndorsingLostDeposits")
+ .HasColumnType("bigint");
+
+ b.Property("DoubleEndorsingLostFees")
+ .HasColumnType("bigint");
+
+ b.Property("DoubleEndorsingLostRewards")
+ .HasColumnType("bigint");
+
+ b.Property("DoubleEndorsingRewards")
+ .HasColumnType("bigint");
+
+ b.Property("EndorsementDeposits")
+ .HasColumnType("bigint");
+
+ b.Property("EndorsementRewards")
+ .HasColumnType("bigint");
+
+ b.Property("Endorsements")
+ .HasColumnType("integer");
+
+ b.Property("ExpectedBlocks")
+ .HasColumnType("double precision");
+
+ b.Property("ExpectedEndorsements")
+ .HasColumnType("double precision");
+
+ b.Property("ExtraBlockFees")
+ .HasColumnType("bigint");
+
+ b.Property("ExtraBlockRewards")
+ .HasColumnType("bigint");
+
+ b.Property("ExtraBlocks")
+ .HasColumnType("integer");
+
+ b.Property("FutureBlockDeposits")
+ .HasColumnType("bigint");
+
+ b.Property("FutureBlockRewards")
+ .HasColumnType("bigint");
+
+ b.Property("FutureBlocks")
+ .HasColumnType("integer");
+
+ b.Property("FutureEndorsementDeposits")
+ .HasColumnType("bigint");
+
+ b.Property("FutureEndorsementRewards")
+ .HasColumnType("bigint");
+
+ b.Property("FutureEndorsements")
+ .HasColumnType("integer");
+
+ b.Property("MissedEndorsementRewards")
+ .HasColumnType("bigint");
+
+ b.Property("MissedEndorsements")
+ .HasColumnType("integer");
+
+ b.Property("MissedExtraBlockFees")
+ .HasColumnType("bigint");
+
+ b.Property("MissedExtraBlockRewards")
+ .HasColumnType("bigint");
+
+ b.Property("MissedExtraBlocks")
+ .HasColumnType("integer");
+
+ b.Property("MissedOwnBlockFees")
+ .HasColumnType("bigint");
+
+ b.Property("MissedOwnBlockRewards")
+ .HasColumnType("bigint");
+
+ b.Property("MissedOwnBlocks")
+ .HasColumnType("integer");
+
+ b.Property("OwnBlockFees")
+ .HasColumnType("bigint");
+
+ b.Property("OwnBlockRewards")
+ .HasColumnType("bigint");
+
+ b.Property("OwnBlocks")
+ .HasColumnType("integer");
+
+ b.Property("RevelationLostFees")
+ .HasColumnType("bigint");
+
+ b.Property("RevelationLostRewards")
+ .HasColumnType("bigint");
+
+ b.Property("RevelationRewards")
+ .HasColumnType("bigint");
+
+ b.Property("Rolls")
+ .HasColumnType("integer");
+
+ b.Property("StakingBalance")
+ .HasColumnType("bigint");
+
+ b.Property("UncoveredEndorsementRewards")
+ .HasColumnType("bigint");
+
+ b.Property("UncoveredEndorsements")
+ .HasColumnType("integer");
+
+ b.Property("UncoveredExtraBlockFees")
+ .HasColumnType("bigint");
+
+ b.Property("UncoveredExtraBlockRewards")
+ .HasColumnType("bigint");
+
+ b.Property("UncoveredExtraBlocks")
+ .HasColumnType("integer");
+
+ b.Property("UncoveredOwnBlockFees")
+ .HasColumnType("bigint");
+
+ b.Property("UncoveredOwnBlockRewards")
+ .HasColumnType("bigint");
+
+ b.Property("UncoveredOwnBlocks")
+ .HasColumnType("integer");
+
+ b.HasKey("Id");
+
+ b.HasIndex("BakerId");
+
+ b.HasIndex("Cycle");
+
+ b.HasIndex("Id")
+ .IsUnique();
+
+ b.HasIndex("Cycle", "BakerId")
+ .IsUnique();
+
+ b.ToTable("BakerCycles");
+ });
+
+ modelBuilder.Entity("Tzkt.Data.Models.BakingRight", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
+
+ b.Property("BakerId")
+ .HasColumnType("integer");
+
+ b.Property("Cycle")
+ .HasColumnType("integer");
+
+ b.Property("Level")
+ .HasColumnType("integer");
+
+ b.Property("Priority")
+ .HasColumnType("integer");
+
+ b.Property("Slots")
+ .HasColumnType("integer");
+
+ b.Property("Status")
+ .HasColumnType("smallint");
+
+ b.Property("Type")
+ .HasColumnType("smallint");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Cycle");
+
+ b.HasIndex("Level");
+
+ b.HasIndex("Cycle", "BakerId");
+
+ b.ToTable("BakingRights");
+ });
+
+ modelBuilder.Entity("Tzkt.Data.Models.BallotOperation", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
+
+ b.Property("Level")
+ .HasColumnType("integer");
+
+ b.Property("OpHash")
+ .IsRequired()
+ .HasColumnType("character(51)")
+ .IsFixedLength(true)
+ .HasMaxLength(51);
+
+ b.Property("PeriodId")
+ .HasColumnType("integer");
+
+ b.Property("ProposalId")
+ .HasColumnType("integer");
+
+ b.Property("Rolls")
+ .HasColumnType("integer");
+
+ b.Property("SenderId")
+ .HasColumnType("integer");
+
+ b.Property("Timestamp")
+ .HasColumnType("timestamp without time zone");
+
+ b.Property("Vote")
+ .HasColumnType("integer");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Level");
+
+ b.HasIndex("OpHash");
+
+ b.HasIndex("PeriodId");
+
+ b.HasIndex("ProposalId");
+
+ b.HasIndex("SenderId");
+
+ b.ToTable("BallotOps");
+ });
+
+ modelBuilder.Entity("Tzkt.Data.Models.Block", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
+
+ b.Property("BakerId")
+ .HasColumnType("integer");
+
+ b.Property("Events")
+ .HasColumnType("integer");
+
+ b.Property("Fees")
+ .HasColumnType("bigint");
+
+ b.Property("Hash")
+ .IsRequired()
+ .HasColumnType("character(51)")
+ .IsFixedLength(true)
+ .HasMaxLength(51);
+
+ b.Property("Level")
+ .HasColumnType("integer");
+
+ b.Property("Operations")
+ .HasColumnType("integer");
+
+ b.Property("Priority")
+ .HasColumnType("integer");
+
+ b.Property("ProtoCode")
+ .HasColumnType("integer");
+
+ b.Property("ResetDeactivation")
+ .HasColumnType("integer");
+
+ b.Property("RevelationId")
+ .HasColumnType("integer");
+
+ b.Property("Reward")
+ .HasColumnType("bigint");
+
+ b.Property("SoftwareId")
+ .HasColumnType("integer");
+
+ b.Property("Timestamp")
+ .HasColumnType("timestamp without time zone");
+
+ b.Property("Validations")
+ .HasColumnType("integer");
+
+ b.HasKey("Id");
+
+ b.HasIndex("BakerId");
+
+ b.HasIndex("Hash")
+ .IsUnique();
+
+ b.HasIndex("Level")
+ .IsUnique();
+
+ b.HasIndex("ProtoCode");
+
+ b.HasIndex("RevelationId")
+ .IsUnique();
+
+ b.HasIndex("SoftwareId");
+
+ b.ToTable("Blocks");
+ });
+
+ modelBuilder.Entity("Tzkt.Data.Models.Commitment", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
+
+ b.Property("AccountId")
+ .HasColumnType("integer");
+
+ b.Property("Address")
+ .IsRequired()
+ .HasColumnType("character(37)")
+ .IsFixedLength(true)
+ .HasMaxLength(37);
+
+ b.Property("Balance")
+ .HasColumnType("bigint");
+
+ b.Property("Level")
+ .HasColumnType("integer");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Address")
+ .IsUnique();
+
+ b.HasIndex("Id")
+ .IsUnique();
+
+ b.ToTable("Commitments");
+ });
+
+ modelBuilder.Entity("Tzkt.Data.Models.Cycle", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
+
+ b.Property("Index")
+ .HasColumnType("integer");
+
+ b.Property("Seed")
+ .IsRequired()
+ .HasColumnType("character(64)")
+ .IsFixedLength(true)
+ .HasMaxLength(64);
+
+ b.Property("SnapshotIndex")
+ .HasColumnType("integer");
+
+ b.Property("SnapshotLevel")
+ .HasColumnType("integer");
+
+ b.Property("TotalBakers")
+ .HasColumnType("integer");
+
+ b.Property("TotalDelegated")
+ .HasColumnType("bigint");
+
+ b.Property("TotalDelegators")
+ .HasColumnType("integer");
+
+ b.Property("TotalRolls")
+ .HasColumnType("integer");
+
+ b.Property("TotalStaking")
+ .HasColumnType("bigint");
+
+ b.HasKey("Id");
+
+ b.HasAlternateKey("Index");
+
+ b.HasIndex("Index")
+ .IsUnique();
+
+ b.ToTable("Cycles");
+ });
+
+ modelBuilder.Entity("Tzkt.Data.Models.DelegationOperation", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
+
+ b.Property("AllocationFee")
+ .HasColumnType("bigint");
+
+ b.Property("Amount")
+ .HasColumnType("bigint");
+
+ b.Property("BakerFee")
+ .HasColumnType("bigint");
+
+ b.Property("Counter")
+ .HasColumnType("integer");
+
+ b.Property("DelegateId")
+ .HasColumnType("integer");
+
+ b.Property("Errors")
+ .HasColumnType("text");
+
+ b.Property("GasLimit")
+ .HasColumnType("integer");
+
+ b.Property("GasUsed")
+ .HasColumnType("integer");
+
+ b.Property("InitiatorId")
+ .HasColumnType("integer");
+
+ b.Property("Level")
+ .HasColumnType("integer");
+
+ b.Property("Nonce")
+ .HasColumnType("integer");
+
+ b.Property("OpHash")
+ .IsRequired()
+ .HasColumnType("character(51)")
+ .IsFixedLength(true)
+ .HasMaxLength(51);
+
+ b.Property("PrevDelegateId")
+ .HasColumnType("integer");
+
+ b.Property("ResetDeactivation")
+ .HasColumnType("integer");
+
+ b.Property("SenderId")
+ .HasColumnType("integer");
+
+ b.Property("Status")
+ .HasColumnType("smallint");
+
+ b.Property("StorageFee")
+ .HasColumnType("bigint");
+
+ b.Property("StorageLimit")
+ .HasColumnType("integer");
+
+ b.Property("StorageUsed")
+ .HasColumnType("integer");
+
+ b.Property("Timestamp")
+ .HasColumnType("timestamp without time zone");
+
+ b.HasKey("Id");
+
+ b.HasIndex("DelegateId");
+
+ b.HasIndex("InitiatorId");
+
+ b.HasIndex("Level");
+
+ b.HasIndex("OpHash");
+
+ b.HasIndex("PrevDelegateId");
+
+ b.HasIndex("SenderId");
+
+ b.ToTable("DelegationOps");
+ });
+
+ modelBuilder.Entity("Tzkt.Data.Models.DelegatorCycle", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
+
+ b.Property("BakerId")
+ .HasColumnType("integer");
+
+ b.Property("Balance")
+ .HasColumnType("bigint");
+
+ b.Property("Cycle")
+ .HasColumnType("integer");
+
+ b.Property("DelegatorId")
+ .HasColumnType("integer");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Cycle");
+
+ b.HasIndex("DelegatorId");
+
+ b.HasIndex("Cycle", "BakerId");
+
+ b.HasIndex("Cycle", "DelegatorId")
+ .IsUnique();
+
+ b.ToTable("DelegatorCycles");
+ });
+
+ modelBuilder.Entity("Tzkt.Data.Models.DoubleBakingOperation", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
+
+ b.Property("AccusedLevel")
+ .HasColumnType("integer");
+
+ b.Property("AccuserId")
+ .HasColumnType("integer");
+
+ b.Property("AccuserReward")
+ .HasColumnType("bigint");
+
+ b.Property("Level")
+ .HasColumnType("integer");
+
+ b.Property("OffenderId")
+ .HasColumnType("integer");
+
+ b.Property("OffenderLostDeposit")
+ .HasColumnType("bigint");
+
+ b.Property("OffenderLostFee")
+ .HasColumnType("bigint");
+
+ b.Property("OffenderLostReward")
+ .HasColumnType("bigint");
+
+ b.Property("OpHash")
+ .IsRequired()
+ .HasColumnType("character(51)")
+ .IsFixedLength(true)
+ .HasMaxLength(51);
+
+ b.Property("Timestamp")
+ .HasColumnType("timestamp without time zone");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AccuserId");
+
+ b.HasIndex("Level");
+
+ b.HasIndex("OffenderId");
+
+ b.HasIndex("OpHash");
+
+ b.ToTable("DoubleBakingOps");
+ });
+
+ modelBuilder.Entity("Tzkt.Data.Models.DoubleEndorsingOperation", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
+
+ b.Property("AccusedLevel")
+ .HasColumnType("integer");
+
+ b.Property("AccuserId")
+ .HasColumnType("integer");
+
+ b.Property("AccuserReward")
+ .HasColumnType("bigint");
+
+ b.Property("Level")
+ .HasColumnType("integer");
+
+ b.Property("OffenderId")
+ .HasColumnType("integer");
+
+ b.Property("OffenderLostDeposit")
+ .HasColumnType("bigint");
+
+ b.Property("OffenderLostFee")
+ .HasColumnType("bigint");
+
+ b.Property("OffenderLostReward")
+ .HasColumnType("bigint");
+
+ b.Property("OpHash")
+ .IsRequired()
+ .HasColumnType("character(51)")
+ .IsFixedLength(true)
+ .HasMaxLength(51);
+
+ b.Property("Timestamp")
+ .HasColumnType("timestamp without time zone");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AccuserId");
+
+ b.HasIndex("Level");
+
+ b.HasIndex("OffenderId");
+
+ b.HasIndex("OpHash");
+
+ b.ToTable("DoubleEndorsingOps");
+ });
+
+ modelBuilder.Entity("Tzkt.Data.Models.EndorsementOperation", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
+
+ b.Property("DelegateId")
+ .HasColumnType("integer");
+
+ b.Property("Level")
+ .HasColumnType("integer");
+
+ b.Property("OpHash")
+ .IsRequired()
+ .HasColumnType("character(51)")
+ .IsFixedLength(true)
+ .HasMaxLength(51);
+
+ b.Property("ResetDeactivation")
+ .HasColumnType("integer");
+
+ b.Property("Reward")
+ .HasColumnType("bigint");
+
+ b.Property("Slots")
+ .HasColumnType("integer");
+
+ b.Property("Timestamp")
+ .HasColumnType("timestamp without time zone");
+
+ b.HasKey("Id");
+
+ b.HasIndex("DelegateId");
+
+ b.HasIndex("Level");
+
+ b.HasIndex("OpHash");
+
+ b.ToTable("EndorsementOps");
+ });
+
+ modelBuilder.Entity("Tzkt.Data.Models.MigrationOperation", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
+
+ b.Property("AccountId")
+ .HasColumnType("integer");
+
+ b.Property("BalanceChange")
+ .HasColumnType("bigint");
+
+ b.Property("Kind")
+ .HasColumnType("integer");
+
+ b.Property("Level")
+ .HasColumnType("integer");
+
+ b.Property("Timestamp")
+ .HasColumnType("timestamp without time zone");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AccountId");
+
+ b.HasIndex("Level");
+
+ b.ToTable("MigrationOps");
+ });
+
+ modelBuilder.Entity("Tzkt.Data.Models.NonceRevelationOperation", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
+
+ b.Property("BakerId")
+ .HasColumnType("integer");
+
+ b.Property("Level")
+ .HasColumnType("integer");
+
+ b.Property("OpHash")
+ .IsRequired()
+ .HasColumnType("character(51)")
+ .IsFixedLength(true)
+ .HasMaxLength(51);
+
+ b.Property("RevealedLevel")
+ .HasColumnType("integer");
+
+ b.Property("SenderId")
+ .HasColumnType("integer");
+
+ b.Property("Timestamp")
+ .HasColumnType("timestamp without time zone");
+
+ b.HasKey("Id");
+
+ b.HasIndex("BakerId");
+
+ b.HasIndex("Level");
+
+ b.HasIndex("OpHash");
+
+ b.HasIndex("SenderId");
+
+ b.ToTable("NonceRevelationOps");
+ });
+
+ modelBuilder.Entity("Tzkt.Data.Models.OriginationOperation", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
+
+ b.Property("AllocationFee")
+ .HasColumnType("bigint");
+
+ b.Property("BakerFee")
+ .HasColumnType("bigint");
+
+ b.Property("Balance")
+ .HasColumnType("bigint");
+
+ b.Property("ContractId")
+ .HasColumnType("integer");
+
+ b.Property("Counter")
+ .HasColumnType("integer");
+
+ b.Property("DelegateId")
+ .HasColumnType("integer");
+
+ b.Property("Errors")
+ .HasColumnType("text");
+
+ b.Property("GasLimit")
+ .HasColumnType("integer");
+
+ b.Property("GasUsed")
+ .HasColumnType("integer");
+
+ b.Property("InitiatorId")
+ .HasColumnType("integer");
+
+ b.Property("Level")
+ .HasColumnType("integer");
+
+ b.Property("ManagerId")
+ .HasColumnType("integer");
+
+ b.Property("Nonce")
+ .HasColumnType("integer");
+
+ b.Property("OpHash")
+ .IsRequired()
+ .HasColumnType("character(51)")
+ .IsFixedLength(true)
+ .HasMaxLength(51);
+
+ b.Property("SenderId")
+ .HasColumnType("integer");
+
+ b.Property("Status")
+ .HasColumnType("smallint");
+
+ b.Property("StorageFee")
+ .HasColumnType("bigint");
+
+ b.Property("StorageLimit")
+ .HasColumnType("integer");
+
+ b.Property("StorageUsed")
+ .HasColumnType("integer");
+
+ b.Property("Timestamp")
+ .HasColumnType("timestamp without time zone");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ContractId");
+
+ b.HasIndex("DelegateId");
+
+ b.HasIndex("InitiatorId");
+
+ b.HasIndex("Level");
+
+ b.HasIndex("ManagerId");
+
+ b.HasIndex("OpHash");
+
+ b.HasIndex("SenderId");
+
+ b.ToTable("OriginationOps");
+ });
+
+ modelBuilder.Entity("Tzkt.Data.Models.Proposal", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
+
+ b.Property("ExplorationPeriodId")
+ .HasColumnType("integer");
+
+ b.Property("Hash")
+ .HasColumnType("character(51)")
+ .IsFixedLength(true)
+ .HasMaxLength(51);
+
+ b.Property("InitiatorId")
+ .HasColumnType("integer");
+
+ b.Property("PromotionPeriodId")
+ .HasColumnType("integer");
+
+ b.Property