From 2dc1217b249ea2e40cbf56ae7fe2eb61fc799c02 Mon Sep 17 00:00:00 2001 From: SandyTAP Date: Tue, 20 Oct 2026 22:03:33 +0300 Subject: [PATCH] chore(sqlc): regenerate generated store code The committed generated code lagged behind the migration series: tables added after 0131 were never regenerated. Regenerate so the models match the schema again. The diff is mechanical, new tables and columns only. --- internal/store/postgres/sqlcgen/bot.sql.go | 3 +- internal/store/postgres/sqlcgen/models.go | 1240 ++++++++++++++++++- internal/store/postgres/sqlcgen/user.sql.go | 57 +- 3 files changed, 1234 insertions(+), 66 deletions(-) diff --git a/internal/store/postgres/sqlcgen/bot.sql.go b/internal/store/postgres/sqlcgen/bot.sql.go index d2584dfc..239aa3f0 100644 --- a/internal/store/postgres/sqlcgen/bot.sql.go +++ b/internal/store/postgres/sqlcgen/bot.sql.go @@ -167,7 +167,7 @@ func (q *Queries) InsertBot(ctx context.Context, arg InsertBotParams) error { const insertBotUser = `-- name: InsertBotUser :one INSERT INTO users (access_hash, phone, first_name, last_name, username, country_code, is_bot, bot_info_version) VALUES ($1, '', $2, '', $3, '', TRUE, 1) -RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, scam, fake +RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, scam, fake, premium_updated_at ` type InsertBotUserParams struct { @@ -218,6 +218,7 @@ func (q *Queries) InsertBotUser(ctx context.Context, arg InsertBotUserParams) (U &i.LinkedCommunityID, &i.Scam, &i.Fake, + &i.PremiumUpdatedAt, ) return i, err } diff --git a/internal/store/postgres/sqlcgen/models.go b/internal/store/postgres/sqlcgen/models.go index 4148ee27..222e602b 100644 --- a/internal/store/postgres/sqlcgen/models.go +++ b/internal/store/postgres/sqlcgen/models.go @@ -34,6 +34,21 @@ type AccountDeletionRequest struct { UpdatedAt pgtype.Timestamptz } +type AccountFreezeNotification struct { + ID int64 + TargetUserID int64 + FrozenUserID int64 + Version int64 + Frozen bool + Status string + Attempts int32 + NextAttemptAt pgtype.Timestamptz + LeaseUntil pgtype.Timestamptz + LastError string + CreatedAt pgtype.Timestamptz + UpdatedAt pgtype.Timestamptz +} + type AccountPassword struct { UserID int64 HasRecovery bool @@ -64,6 +79,34 @@ type AccountPrivacyRule struct { UpdatedAt pgtype.Timestamptz } +type AccountRating struct { + UserID int64 + Level int32 + Stars int64 + CurrentLevelStars int64 + NextLevelStars *int64 + StarsComponent int64 + ActivityComponent int64 + PenaltyComponent int64 + ManualComponent int64 + PendingStars int64 + PendingDate pgtype.Timestamptz + ComputedAt pgtype.Timestamptz + UpdatedAt pgtype.Timestamptz + Version int64 +} + +type AccountRatingEvent struct { + ID int64 + UserID int64 + Kind string + Amount int64 + Reason string + Actor string + CommandKey *string + CreatedAt pgtype.Timestamptz +} + type AccountReactionSetting struct { UserID int64 MessagesNotifyFrom string @@ -88,6 +131,7 @@ type AccountRestriction struct { FrozenSince pgtype.Timestamptz FrozenUntil pgtype.Timestamptz AppealUrl string + Version int64 } type AccountSetting struct { @@ -103,6 +147,11 @@ type AccountSetting struct { SensitiveContentEnabled bool ContactSignupSilent bool UpdatedAt pgtype.Timestamptz + DisallowUnlimitedStargifts bool + DisallowLimitedStargifts bool + DisallowUniqueStargifts bool + DisallowPremiumGifts bool + DisallowStargiftsFromChannels bool } type AdminAuditLog struct { @@ -139,6 +188,18 @@ type AdminCommand struct { CompletedAt pgtype.Timestamptz } +type AdminConsoleUser struct { + ID int64 + Username string + PasswordHash string + Permissions []string + Enabled bool + TokenEpoch int32 + CreatedAt pgtype.Timestamptz + UpdatedAt pgtype.Timestamptz + LastLoginAt pgtype.Timestamptz +} + type AiComposeTone struct { ID int64 AccessHash int64 @@ -202,6 +263,21 @@ type AttachMenuUserState struct { UpdatedAt pgtype.Timestamptz } +type AuthDeliveryReport struct { + ID int64 + AuthKeyID []byte + SessionID int64 + ClientType string + PhoneHash []byte + CodeHash []byte + IssuedUserID int64 + DeliveryID string + Channel string + Mnc string + Fingerprint []byte + CreatedAt pgtype.Timestamptz +} + type AuthKey struct { AuthKeyID int64 Body []byte @@ -310,6 +386,7 @@ type BotApiUpdate struct { CallbackInlineMessageID int32 CallbackInlineAccessHash int64 EphemeralPayload []byte + PreCheckoutPayload []byte } type BotApiUpdateState struct { @@ -392,6 +469,83 @@ type BotEmojiStatusPermission struct { UpdatedAt pgtype.Timestamptz } +type BotInvoice struct { + ID int64 + BotUserID int64 + ChatID int64 + MessageID int32 + Title string + Description string + Amount int64 + Currency string + Payload string + ChargeID string + PayerUserID int64 + Paid bool + Refunded bool + PaidAt int32 + Date int32 +} + +type BotLoginAllowedUrl struct { + ID int64 + BotUserID int64 + Kind string + NormalizedUrl string + CreatedAt pgtype.Timestamptz +} + +type BotLoginClient struct { + BotUserID int64 + ClientID string + ClientSecretHash []byte + SecretVersion int64 + SigningAlgorithm string + Enabled bool + CreatedAt pgtype.Timestamptz + UpdatedAt pgtype.Timestamptz +} + +type BotLoginNativeApp struct { + ID int64 + BotUserID int64 + Platform string + ApplicationID string + VerificationID string + CallbackUri string + VerifiedDisplayName string + Enabled bool + CreatedAt pgtype.Timestamptz + UpdatedAt pgtype.Timestamptz +} + +type BotStarsBalance struct { + BotUserID int64 + Balance int64 + UpdatedAt pgtype.Timestamptz +} + +type BotStarsPayment struct { + InvoiceKey string + BotUserID int64 + PayerUserID int64 + Amount int64 + BalanceAfter int64 + SettledAt int32 +} + +type BotStarsTransaction struct { + ID int64 + BotUserID int64 + ActorUserID int64 + Amount int64 + Reason string + PeerType string + PeerID int64 + InvoiceKey *string + Date int32 +} + type BotUserPermission struct { BotUserID int64 UserID int64 @@ -400,6 +554,54 @@ type BotUserPermission struct { UpdatedAt pgtype.Timestamptz } +type BotVerifierSetting struct { + BotID int64 + IconDocumentID int64 + CompanyName string + DefaultDescription string + CanModifyCustomDescription bool + Enabled bool + GrantedBy string + GrantReason string + CreatedAt pgtype.Timestamptz + UpdatedAt pgtype.Timestamptz + Version int64 +} + +type Broadcast struct { + ID int64 + Message string + TargetMode string + SnapshotMaxUserID int64 + EnumerationCursorUserID int64 + EnumerationDone bool + TargetCount int64 + MaterializedCount int64 + SentCount int64 + FailedCount int64 + CreatedBy string + CreatedAt pgtype.Timestamptz + Entities []byte +} + +type BroadcastRecipient struct { + ID int64 + BroadcastID int64 + UserID int64 + Status string + Attempts int32 + NextAttemptAt pgtype.Timestamptz + LeaseToken string + LeaseUntil pgtype.Timestamptz + LastError string + PrivateMessageID int64 + MessageBoxID int32 + Pts int32 + SentAt pgtype.Timestamptz + CreatedAt pgtype.Timestamptz + UpdatedAt pgtype.Timestamptz +} + type BusinessAutomationDelivery struct { OwnerUserID int64 PeerUserID int64 @@ -502,6 +704,9 @@ type Channel struct { Wallpaper []byte Verified bool LinkedCommunityID int64 + Scam bool + Fake bool + Gigagroup bool SignatureProfiles bool } @@ -527,6 +732,18 @@ type ChannelAdminLogEvent struct { CreatedAt pgtype.Timestamptz } +type ChannelAntispamDecision struct { + ID int64 + ChannelID int64 + MessageID int32 + AuthorUserID int64 + EvidenceSchemaVersion int16 + Evidence []byte + EvidenceHash []byte + ReportID *int64 + CreatedAt pgtype.Timestamptz +} + type ChannelBoostSlot struct { UserID int64 Slot int32 @@ -639,25 +856,27 @@ type ChannelMediaCategoryCount struct { } type ChannelMember struct { - ChannelID int64 - UserID int64 - InviterUserID int64 - Role string - Status string - JoinedAt int32 - LeftAt int32 - AdminRights []byte - BannedRights []byte - Rank string - AvailableMinID int32 - AvailableMinPts int32 - ReadInboxMaxID int32 - ReadInboxDate int32 - ReadOutboxMaxID int32 - UnreadMark bool - SlowmodeLastSendDate int32 - CreatedAt pgtype.Timestamptz - UpdatedAt pgtype.Timestamptz + ChannelID int64 + UserID int64 + InviterUserID int64 + Role string + Status string + JoinedAt int32 + LeftAt int32 + AdminRights []byte + BannedRights []byte + Rank string + AvailableMinID int32 + AvailableMinPts int32 + ReadInboxMaxID int32 + ReadInboxDate int32 + ReadOutboxMaxID int32 + UnreadMark bool + SlowmodeLastSendDate int32 + CreatedAt pgtype.Timestamptz + UpdatedAt pgtype.Timestamptz + HistoryClearAnchorID int32 + HistoryClearAnchorDate int32 } type ChannelMessage struct { @@ -711,6 +930,7 @@ type ChannelMessage struct { SuggestedPost []byte PaidMessageStars int64 ShowMessageSender bool + Factcheck []byte } type ChannelMessageMedium struct { @@ -721,12 +941,14 @@ type ChannelMessageMedium struct { } type ChannelMessagePaidReaction struct { - ChannelID int64 - MessageID int32 - ReactorUserID int64 - Stars int64 - Anonymous bool - ReactionDate int32 + ChannelID int64 + MessageID int32 + ReactorUserID int64 + Stars int64 + Anonymous bool + ReactionDate int32 + DisplayPeerType string + DisplayPeerID int64 } type ChannelMessageReaction struct { @@ -752,6 +974,61 @@ type ChannelMessageViewer struct { CreatedAt pgtype.Timestamptz } +type ChannelPaidReactionCommand struct { + PayerUserID int64 + RandomID int64 + RequestFingerprint []byte + ChannelID int64 + MessageID int32 + Stars int64 + Anonymous bool + ReactionDate int32 + Completed bool + PayerTransactionID *int64 + ChannelTransactionID *int64 + PayerBalanceAfter *int64 + ChannelBalanceAfter *int64 + ReactorStarsAfter *int64 + TotalStarsAfter *int64 + ResultSnapshot []byte + CreatedAt pgtype.Timestamptz +} + +type ChannelPaidReactionCutover struct { + Singleton bool + CutoverAt int32 + RejectRandomIDThrough int32 + CreatedAt pgtype.Timestamptz +} + +type ChannelPaidReactionLegacyCredit struct { + ChannelID int64 + ReactorUserID int64 + Amount int64 + ReactionRows int32 + ReactionDate int32 + ChannelBalanceAfter int64 + ChannelTransactionID int64 + MigratedAt pgtype.Timestamptz +} + +type ChannelRevenueWithdrawal struct { + ID int64 + TokenDigest []byte + ChannelID int64 + CreatorUserID int64 + Currency string + Amount int64 + Status string + ExpiresAt int32 + CreatedAt int32 + CompletedAt *int32 + ChannelTransactionID *int64 + UserTransactionID *int64 + ChannelBalanceAfter *int64 + UserBalanceAfter *int64 +} + type ChannelStarsBalance struct { ChannelID int64 Balance int64 @@ -861,6 +1138,88 @@ type ChatlistMembership struct { UpdatedAt pgtype.Timestamptz } +type ClientTelemetryEvent struct { + ID int64 + UserID int64 + Kind string + PeerType string + PeerID int64 + SubjectIds []int64 + Payload []byte + Fingerprint []byte + CreatedAt pgtype.Timestamptz +} + +type CollectiblePhone struct { + ID int64 + Phone string + Tier string + Status string + OwnerUserID int64 + PurchaseDate pgtype.Timestamptz + Currency string + Amount int64 + CryptoCurrency string + CryptoAmount int64 + Url string + OriginalOwnerUserID int64 + TransferCount int32 + Version int64 + CreatedAt pgtype.Timestamptz + UpdatedAt pgtype.Timestamptz +} + +type CollectiblePhoneTransfer struct { + ID int64 + CollectibleID int64 + Kind string + FromUserID int64 + ToUserID int64 + Currency string + Amount int64 + Actor string + Reason string + CommandKey *string + CreatedAt pgtype.Timestamptz +} + +type CollectibleUsername struct { + ID int64 + Username string + UsernameLower string + Status string + OwnerPeerType string + OwnerPeerID int64 + PurchaseDate pgtype.Timestamptz + Currency string + Amount int64 + CryptoCurrency string + CryptoAmount int64 + Url string + OriginalOwnerPeerType string + OriginalOwnerPeerID int64 + TransferCount int32 + Version int64 + CreatedAt pgtype.Timestamptz + UpdatedAt pgtype.Timestamptz +} + +type CollectibleUsernameTransfer struct { + ID int64 + CollectibleID int64 + Kind string + FromPeerType string + FromPeerID int64 + ToPeerType string + ToPeerID int64 + Currency string + Amount int64 + Actor string + Reason string + CommandKey *string + CreatedAt pgtype.Timestamptz +} + type Community struct { ID int64 AccessHash int64 @@ -959,6 +1318,41 @@ type CountryCode struct { OrderIndex int32 } +type CustomVerification struct { + ID int64 + VerifierBotID int64 + PeerType string + PeerID int64 + IconDocumentID int64 + Description string + GrantedByUserID int64 + CreatedAt pgtype.Timestamptz + UpdatedAt pgtype.Timestamptz + Version int64 +} + +type CustomVerificationRequest struct { + ID int64 + VerifierBotID int64 + ApplicantUserID int64 + PeerType string + PeerID int64 + PeerTitle string + PeerUsername string + Reason string + RequestedDescription string + Status string + DecidedBy string + DecisionReason string + InternalNote string + CorrelationID string + CreatedAt pgtype.Timestamptz + UpdatedAt pgtype.Timestamptz + ApprovedAt pgtype.Timestamptz + RejectedAt pgtype.Timestamptz + Version int64 +} + type Dialog struct { UserID int64 PeerType string @@ -1048,6 +1442,66 @@ type Document struct { CreatedAt pgtype.Timestamptz } +type DonationAddress struct { + UserID int64 + DerivationIndex int64 + Address string + CreatedAt pgtype.Timestamptz +} + +type DonationChain struct { + ChainKey string + Name string + ChainID int64 + RpcUrl string + WsUrl string + NativeSymbol string + NativeDecimals int32 + ConfirmationsRequired int32 + PriceFeedAddress string + ManualUsdRateMicros int64 + Enabled bool + CreatedAt pgtype.Timestamptz + UpdatedAt pgtype.Timestamptz +} + +type DonationChainCursor struct { + ChainKey string + LastScannedBlock int64 + UpdatedAt pgtype.Timestamptz +} + +type DonationDeposit struct { + ID int64 + UserID int64 + ChainKey string + TokenSymbol string + TxHash string + LogIndex int32 + BlockNumber int64 + AmountRaw pgtype.Numeric + UsdValueMicros int64 + StarsCredited int64 + Status string + Confirmations int32 + DetectedAt pgtype.Timestamptz + CreditedAt pgtype.Timestamptz +} + +type DonationToken struct { + ChainKey string + Symbol string + ContractAddress string + Decimals int32 +} + +type DonationWallet struct { + ID int16 + EncryptedSeed []byte + Nonce []byte + CreatedAt pgtype.Timestamptz +} + type EncryptedFile struct { ID int64 AccessHash int64 @@ -1117,6 +1571,26 @@ type FileBlob struct { CreatedAt pgtype.Timestamptz } +type GifCatalog struct { + ID int64 + Title string + DocumentID int64 + Enabled bool + SortOrder int32 + CreatedBy string + SourceFilename string + SourceSha256 string + CreatedAt pgtype.Timestamptz + UpdatedAt pgtype.Timestamptz + FileName string + CategoryOverride *string +} + +type GifCatalogCapacity struct { + Singleton bool + EntryCount int32 +} + type GroupCall struct { CallID int64 AccessHash int64 @@ -1198,6 +1672,15 @@ type GroupCallScheduleSubscriber struct { UserID int64 } +type ItemPrice struct { + ProductCode string + StarsPrice int32 + Bid int64 + Enabled bool + UpdatedBy string + UpdatedAt pgtype.Timestamptz +} + type LangPack struct { LangPack string LangCode string @@ -1235,6 +1718,8 @@ type LoginCodeMessageDelivery struct { MessageDate int32 CreatedAt pgtype.Timestamptz ExpiresAt pgtype.Timestamptz + // Rendered first-delivery template with {{code}} placeholder, never the secret code; empty means legacy built-in template + Template string } type MessageBox struct { @@ -1295,6 +1780,140 @@ type MessageBoxMedium struct { MessageDate int32 } +type MessageTranscription struct { + DocumentID int64 + TranscriptionID int64 + Status string + Text string + RequestedBy int64 + PeerType string + PeerID int64 + MsgID int32 + Failure string + CreatedAt pgtype.Timestamptz + UpdatedAt pgtype.Timestamptz +} + +type ModerationAction struct { + ID int64 + CaseID int64 + DecisionID int64 + Kind string + Payload []byte + Status string + Attempts int32 + AvailableAt pgtype.Timestamptz + LeaseUntil pgtype.Timestamptz + LastError string + CommandID string + CreatedAt pgtype.Timestamptz + UpdatedAt pgtype.Timestamptz +} + +type ModerationAppeal struct { + ID int64 + CaseID int64 + AppellantUserID int64 + AppealText string + TextHash []byte + Fingerprint []byte + Status string + PreviousCaseStatus string + Reviewer string + ReviewReason string + CreatedAt pgtype.Timestamptz + ReviewedAt pgtype.Timestamptz +} + +type ModerationAppealLink struct { + ID int64 + CaseID int64 + AppellantUserID int64 + TokenHash []byte + ExpiresAt pgtype.Timestamptz + AppealID *int64 + CreatedAt pgtype.Timestamptz + ConsumedAt pgtype.Timestamptz +} + +type ModerationCase struct { + ID int64 + TargetPeerType string + TargetPeerID int64 + Status string + Severity int16 + AssignedTo string + Version int64 + ReportCount int32 + DistinctReporterCount int32 + FirstReportAt pgtype.Timestamptz + LastReportAt pgtype.Timestamptz + CreatedAt pgtype.Timestamptz + UpdatedAt pgtype.Timestamptz +} + +type ModerationCaseReport struct { + CaseID int64 + ReportID int64 + AttachedAt pgtype.Timestamptz +} + +type ModerationDecision struct { + ID int64 + CaseID int64 + AppealID *int64 + Kind string + Actor string + Reason string + CommandID string + Fingerprint []byte + CreatedAt pgtype.Timestamptz +} + +type ModerationLegacyEphemeralMigration struct { + LegacyReportID int64 + ModerationReportID int64 + MigratedAt pgtype.Timestamptz +} + +type ModerationMediaHold struct { + ReportID int64 + ItemOrdinal int16 + MediaKind string + StorageKey string + CreatedAt pgtype.Timestamptz + ReleasedAt pgtype.Timestamptz +} + +type ModerationReport struct { + ID int64 + ReporterUserID int64 + Source string + TargetPeerType string + TargetPeerID int64 + Reason string + ReportOption string + ReportComment string + CommentHash []byte + Fingerprint []byte + TaxonomyVersion int16 + CreatedAt pgtype.Timestamptz +} + +type ModerationReportItem struct { + ReportID int64 + Ordinal int16 + ItemKind string + PeerType string + PeerID int64 + ItemID int64 + SecondaryID int64 + AuthorUserID int64 + EvidenceSchemaVersion int16 + Evidence []byte + EvidenceHash []byte +} + type NotifySetting struct { OwnerUserID int64 ScopeKind string @@ -1349,6 +1968,8 @@ type PeerStarGift struct { CanResellAt int32 DropOriginalDetailsStars int64 CanCraftAt int32 + MessageEntities []byte + PaidStars int64 } type PeerTranslationSetting struct { @@ -1364,6 +1985,11 @@ type PeerUsername struct { PeerType string PeerID int64 UpdatedAt pgtype.Timestamptz + Username string + Active bool + Editable bool + SortOrder int32 + CollectibleID *int64 } type Photo struct { @@ -1403,6 +2029,84 @@ type PollVote struct { CreatedAt pgtype.Timestamptz } +type PremiumAuditEvent struct { + ID int64 + ActorUserID int64 + TargetUserID int64 + PaymentIntentID *int64 + EntitlementID *int64 + Action string + CommandKey string + Reason string + Metadata []byte + CreatedAt pgtype.Timestamptz +} + +type PremiumEntitlement struct { + ID int64 + UserID int64 + Source string + SourceUserID int64 + PaymentIntentID *int64 + TransactionID *int64 + Months int32 + DurationDays int32 + StartsAt pgtype.Timestamptz + ExpiresAt pgtype.Timestamptz + Status string + CommandKey string + RevokedAt pgtype.Timestamptz + RefundedAt pgtype.Timestamptz + Reason string + Metadata []byte + CreatedAt pgtype.Timestamptz + UpdatedAt pgtype.Timestamptz +} + +type PremiumPaymentIntent struct { + ID int64 + FormID int64 + IdempotencyKey string + BuyerUserID int64 + PurchaseKind string + RecipientUserID int64 + Months int32 + DurationDays int32 + AmountStars int64 + Currency string + PlanVersion int64 + GiftMessage string + GiftEntities []byte + Status string + IssuedAt pgtype.Timestamptz + ExpiresAt pgtype.Timestamptz + PaidAt pgtype.Timestamptz + RefundedAt pgtype.Timestamptz + StarsTransactionID *int64 + SenderMessageID *int32 + RecipientMessageID *int32 + CreatedAt pgtype.Timestamptz + UpdatedAt pgtype.Timestamptz + PaymentAmount int64 + DebitStars bool +} + +type PremiumPlan struct { + Months int32 + DurationDays int32 + AmountStars int64 + Enabled bool + SortOrder int32 + Label string + Version int64 + UpdatedAt pgtype.Timestamptz + ManagedBy string + FiatCurrency string + FiatAmount int64 + StoreProduct string + StoreQuantity int32 +} + type PrivateMediaCategoryCount struct { OwnerUserID int64 PeerID int64 @@ -1471,6 +2175,24 @@ type PrivateMessageReaction struct { UpdatedAt pgtype.Timestamptz } +type PrivateNoForwardsChat struct { + UserLowID int64 + UserHighID int64 + EnabledByUserID *int64 + CreatedAt pgtype.Timestamptz + UpdatedAt pgtype.Timestamptz +} + +type PrivateNoForwardsRequest struct { + PrivateMessageSenderUserID int64 + PrivateMessageID int64 + RequesterUserID int64 + ResponderUserID int64 + ExpiresAt int32 + HandledAt int32 + CreatedAt pgtype.Timestamptz +} + type ProfilePhoto struct { OwnerPeerType string OwnerPeerID int64 @@ -1521,6 +2243,16 @@ type SavedDialogPin struct { CreatedAt pgtype.Timestamptz } +type SavedMessageReactionTag struct { + UserID int64 + MessageBoxID int32 + ReactionType string + ReactionValue string + ChosenOrder int32 + CreatedAt pgtype.Timestamptz + UpdatedAt pgtype.Timestamptz +} + type SavedMusic struct { UserID int64 DocumentID int64 @@ -1598,6 +2330,39 @@ type SeedState struct { UpdatedAt pgtype.Timestamptz } +type ShopSetting struct { + Key string + Value int64 + UpdatedBy string + UpdatedAt pgtype.Timestamptz +} + +type SponsoredMessageImpression struct { + ID int64 + UserID int64 + RandomIDHash []byte + TargetPeerType string + TargetPeerID int64 + AuthorUserID int64 + EvidenceSchemaVersion int16 + Evidence []byte + EvidenceHash []byte + ReportID *int64 + CreatedAt pgtype.Timestamptz + ExpiresAt pgtype.Timestamptz +} + +type StarGiftAdminGrantCommand struct { + RecipientUserID int64 + CommandKey string + RequestFingerprint []byte + SenderUserID int64 + GiftID int64 + SavedGiftID int64 + UniqueGiftID int64 + CreatedAt pgtype.Timestamptz +} + type StarGiftAuction struct { GiftID int64 Slug string @@ -1656,6 +2421,14 @@ type StarGiftAuctionBidPayment struct { CreatedAt int32 } +type StarGiftBoxMediaRepair struct { + OwnerUserID int64 + BoxID int32 + PeerType string + PeerID int64 + RepairedMedia []byte +} + type StarGiftCatalog struct { GiftID int64 ActiveRevisionID int64 @@ -1713,6 +2486,44 @@ type StarGiftCatalogRevision struct { BackgroundCenterColor *int32 BackgroundEdgeColor *int32 BackgroundTextColor *int32 + AuctionRoundDuration int32 + SupportOnly bool +} + +// Purchase-time snapshot of per-admin channel gift notification intents; delivery uses deterministic private-message replay. +type StarGiftChannelNotificationJob struct { + SavedGiftID int64 + TargetUserID int64 + GiftDate int32 + Action []byte + Attempts int32 + NextAttemptAt int32 + LeaseUntil int32 + DeliveredAt int32 + MessageID int32 + LastError string + CreatedAt pgtype.Timestamptz + UpdatedAt pgtype.Timestamptz +} + +type StarGiftClaimChallenge struct { + Payload string + UserID int64 + UniqueGiftID int64 + ExpiresAt int32 + ConsumedAt *int32 + CreatedAt pgtype.Timestamptz +} + +type StarGiftClaimHistory struct { + ID int64 + UniqueGiftID int64 + ProfileUserID int64 + WalletAddress string + PreviousWalletAddress string + GiftAddress string + ClaimedAt int32 + ChallengePayload string } type StarGiftCollectibleBackdrop struct { @@ -1770,6 +2581,13 @@ type StarGiftCollectiblePattern struct { OfficialDocumentID *int64 } +type StarGiftCollectiblePreviewRepair struct { + GiftID int64 + CollectibleRevisionID int64 + Reason string + RepairedAt pgtype.Timestamptz +} + type StarGiftCollectibleRevision struct { ID int64 GiftID int64 @@ -1825,6 +2643,16 @@ type StarGiftCraftCommand struct { ChancePermille int32 CreatedAt int32 SourceEditPts []int32 + OutputMedia []byte + OutputFingerprint []byte +} + +type StarGiftCraftMessageRepair struct { + OwnerUserID int64 + BoxID int32 + UniqueGiftID int64 + DesiredCraftChance int32 + DesiredCanCraftAt int32 } type StarGiftDropDetailsCommand struct { @@ -1847,6 +2675,7 @@ type StarGiftListing struct { ListedAt int32 UpdatedAt int32 Version int64 + Suspended bool } type StarGiftNotificationSetting struct { @@ -1887,6 +2716,29 @@ type StarGiftPatternPreviewDocumentRepair struct { RepairedAt pgtype.Timestamptz } +type StarGiftPinRepair struct { + ID int64 + NewOrder int32 +} + +type StarGiftPrepaidMessageAlias struct { + OwnerUserID int64 + BoxID int32 + SavedGiftID int64 + MessageSenderID int64 + PrivateMessageID int64 +} + +type StarGiftPrepaidMessageRepair struct { + OwnerUserID int64 + BoxID int32 + PeerType string + PeerID int64 + MessageSenderID int64 + PrivateMessageID int64 + RepairedMedia []byte +} + type StarGiftPrepaidUpgradeCommand struct { PayerUserID int64 CommandKey string @@ -1923,6 +2775,7 @@ type StarGiftPurchaseForm struct { ChargeStars int64 IssuedAt int32 ExpiresAt int32 + MessageEntities []byte } type StarGiftSale struct { @@ -1966,6 +2819,14 @@ type StarGiftUpgradeCommand struct { SourceEditPts int32 } +// Viewer-local private service-message aliases to saved gift aggregates; the saved gift owner may be that user or an authorized channel. +type StarGiftUserMessageRef struct { + OwnerUserID int64 + MsgID int32 + SavedGiftID int64 + CreatedAt pgtype.Timestamptz +} + type StarGiftUserPurchase struct { UserID int64 GiftID int64 @@ -1973,6 +2834,14 @@ type StarGiftUserPurchase struct { UpdatedAt pgtype.Timestamptz } +type StarGiftUserUniqueMediaRepair struct { + OwnerUserID int64 + BoxID int32 + PeerType string + PeerID int64 + RepairedMedia []byte +} + type StarGiftWithdrawalRequest struct { ID int64 UniqueGiftID int64 @@ -1993,16 +2862,68 @@ type StarsBalance struct { UpdatedAt pgtype.Timestamptz } +type StarsGiveaway struct { + ID int64 + BuyerUserID int64 + FormID int64 + ChannelID int64 + LaunchMessageID int32 + RandomID int64 + Stars int64 + Users int32 + PerUserStars int64 + YearlyBoosts int32 + UntilDate int32 + PurposeJson []byte + State string + CreatedAt int32 +} + +type StarsPurchaseCommand struct { + BuyerUserID int64 + FormID int64 + RequestFingerprint []byte + RecipientUserID *int64 + Stars int64 + Currency string + Amount int64 + BalanceAfter int64 + TransactionID string + CreatedAt int32 + Kind string + SpendPeerType *string + SpendPeerID *int64 + PurposeJson []byte +} + +type StarsPurchaseForm struct { + BuyerUserID int64 + FormID int64 + RecipientUserID *int64 + Stars int64 + Currency string + Amount int64 + IssuedAt int32 + ExpiresAt int32 + Kind string + SpendPeerType *string + SpendPeerID *int64 + PurposeJson []byte +} + type StarsTransaction struct { - ID int64 - UserID int64 - PeerType string - PeerID int64 - Amount int64 - Reason string - Title string - Description string - Date int32 + ID int64 + UserID int64 + PeerType string + PeerID int64 + Amount int64 + Reason string + Title string + Description string + Date int32 + PremiumPaymentIntentID *int64 + PremiumRecipientUserID *int64 + PremiumMonths *int32 } type StickerSet struct { @@ -2102,6 +3023,94 @@ type StoryView struct { UpdatedAt pgtype.Timestamptz } +type SuggestedPostApproval struct { + MonoforumID int64 + SuggestionMessageID int32 + ParentChannelID int64 + ActorUserID int64 + PayerUserID int64 + State string + PriceKind string + PriceAmount int64 + PriceNanos int32 + ScheduleDate int32 + ApprovalServiceMessageID int32 + PublishedMessageID int32 + SettlementDue int32 + FinalServiceMessageID int32 + CreatedAt int32 + UpdatedAt int32 + LifecycleAttempts int32 + NextAttemptAt int32 + LastLifecycleError string +} + +type SuggestedPostLifecycleWakeup struct { + MonoforumID int64 + SuggestionMessageID int32 + CreatedAt int32 +} + +type TelegramLoginCode struct { + ID int64 + RequestID int64 + CodeHash []byte + SealedCode []byte + SealNonce []byte + SealKeyID string + IssuedAt pgtype.Timestamptz + ExpiresAt pgtype.Timestamptz + ConsumedAt pgtype.Timestamptz +} + +type TelegramLoginRequest struct { + ID int64 + RequestTokenHash []byte + BrowserTokenHash []byte + BotUserID int64 + ClientID string + SigningAlgorithm string + Source string + ResponseType string + RedirectUri string + Origin string + Domain string + RequestedScopes []string + OauthState string + Nonce string + CodeChallenge string + CodeChallengeMethod string + Browser string + Platform string + Ip string + Region string + InAppOrigin string + IsApp bool + VerifiedAppName string + MatchCodes []string + MatchCode string + MatchCodesFirst bool + UserIDHint int64 + PeerType string + PeerID int64 + MessageID int32 + ButtonID int32 + Status string + AuthorizedUserID *int64 + ProfileName string + GivenName string + FamilyName string + PreferredUsername string + Picture string + PhoneNumber string + WriteAllowed bool + PhoneShared bool + CreatedAt pgtype.Timestamptz + ExpiresAt pgtype.Timestamptz + ApprovedAt pgtype.Timestamptz + DeclinedAt pgtype.Timestamptz +} + type TelesrvCollectiblePatternCorrectionEvent struct { UserID int64 Pts int32 @@ -2287,6 +3296,7 @@ type User struct { LinkedCommunityID int64 Scam bool Fake bool + PremiumUpdatedAt pgtype.Timestamptz } type UserBusinessProfile struct { @@ -2300,18 +3310,21 @@ type UserBusinessProfile struct { } type UserChannelMemberIndex struct { - UserID int64 - ChannelID int64 - Status string - Megagroup bool - Broadcast bool - Deleted bool - UpdatedAt pgtype.Timestamptz - Role string - LeftAt int32 - Forum bool - PublicUsername bool - CanPinMessages bool + UserID int64 + ChannelID int64 + Status string + Megagroup bool + Broadcast bool + Deleted bool + UpdatedAt pgtype.Timestamptz + Role string + LeftAt int32 + Forum bool + PublicUsername bool + CanPinMessages bool + AvailableMinID int32 + HistoryClearAnchorID int32 + HistoryClearUpdatedAt int32 } type UserRecentReaction struct { @@ -2328,6 +3341,7 @@ type UserSavedReactionTag struct { ReactionType string ReactionValue string Title string + // Legacy unused column; visible counts are aggregated from saved_message_reaction_tags. ReactionCount int32 CreatedAt pgtype.Timestamptz UpdatedAt pgtype.Timestamptz @@ -2405,6 +3419,100 @@ type UserUpdateWatermark struct { UpdatedAt pgtype.Timestamptz } +type VerificationApplication struct { + ID int64 + ApplicantUserID int64 + TargetType string + TargetID int64 + TargetTitle string + TargetUsername string + TargetAccessHash int64 + Category string + Description string + OfficialWebsite string + SocialLinks []string + PressLinks []string + AdditionalNote string + Status string + ReviewerAdminID string + DecisionReason string + InternalNote string + CorrelationID string + CreatedAt pgtype.Timestamptz + UpdatedAt pgtype.Timestamptz + SubmittedAt pgtype.Timestamptz + ReviewedAt pgtype.Timestamptz + Version int64 +} + +type VerificationApplicationEvent struct { + ID int64 + ApplicationID int64 + Kind string + FromStatus string + ToStatus string + Actor string + Reason string + Note string + CorrelationID string + CreatedAt pgtype.Timestamptz +} + +type VerificationIcon struct { + ID int64 + DocumentID int64 + OwnerBotID int64 + Name string + Active bool + CreatedAt pgtype.Timestamptz + UpdatedAt pgtype.Timestamptz +} + +type VerificationNotificationOutbox struct { + ID int64 + ApplicationID int64 + RecipientUserID int64 + Kind string + Payload []byte + Attempts int32 + DeliveredAt pgtype.Timestamptz + LastError string + CreatedAt pgtype.Timestamptz +} + +type WalletGiftTransfer struct { + ID int64 + UniqueGiftID int64 + Action string + WalletName string + WalletAddress string + PreviousWalletAddress string + PreviousOwnerPeerType string + PreviousOwnerPeerID int64 + PreviousHostPeerType string + PreviousHostPeerID int64 + ActorUserID int64 + CreatedAt pgtype.Timestamptz +} + +type WebAuthorization struct { + Hash int64 + RequestID int64 + UserID int64 + BotUserID int64 + Domain string + Browser string + Platform string + Ip string + Region string + GrantedScopes []string + PhoneShared bool + BotAccessGranted bool + CreatedAt pgtype.Timestamptz + LastActiveAt pgtype.Timestamptz + RevokedAt pgtype.Timestamptz +} + type WebPage struct { UrlHash int64 WebPageID int64 @@ -2439,3 +3547,43 @@ type WebviewRequestedButton struct { UsernameRequested bool PhotoRequested bool } + +type WelcomeMessage struct { + ChannelID int64 + ID int32 + CreatorUserID int64 + Date int32 + EditDate int32 + RandomID int64 + Content []byte + CreateFingerprint []byte + Version int64 + CreatedAt pgtype.Timestamptz + UpdatedAt pgtype.Timestamptz +} + +type WelcomeMessageDelivery struct { + ID int64 + JoinEventID int64 + ChannelID int64 + TargetUserID int64 + TemplateID int32 + EphemeralID *int32 + JoinedAt int32 + Content []byte + AttemptCount int32 + NextAttemptAt pgtype.Timestamptz + LeaseOwner *string + LeaseExpiresAt pgtype.Timestamptz + DeliveredAt pgtype.Timestamptz + LastError string + CreatedAt pgtype.Timestamptz + ExpiresAt pgtype.Timestamptz +} + +type WelcomeMessagePeer struct { + ChannelID int64 + NextID int32 + Revision int64 + UpdatedAt pgtype.Timestamptz +} diff --git a/internal/store/postgres/sqlcgen/user.sql.go b/internal/store/postgres/sqlcgen/user.sql.go index 2d03c6dd..f7dd903b 100644 --- a/internal/store/postgres/sqlcgen/user.sql.go +++ b/internal/store/postgres/sqlcgen/user.sql.go @@ -14,7 +14,7 @@ import ( const createUser = `-- name: CreateUser :one INSERT INTO users (access_hash, phone, first_name, last_name, username, country_code, premium_expires_at) VALUES ($1, $2, $3, $4, $5, $6, $7) -RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, scam, fake +RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, scam, fake, premium_updated_at ` type CreateUserParams struct { @@ -77,12 +77,13 @@ func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (User, e &i.LinkedCommunityID, &i.Scam, &i.Fake, + &i.PremiumUpdatedAt, ) return i, err } const getUserByID = `-- name: GetUserByID :one -SELECT id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, scam, fake FROM users WHERE id = $1 +SELECT id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, scam, fake, premium_updated_at FROM users WHERE id = $1 ` func (q *Queries) GetUserByID(ctx context.Context, id int64) (User, error) { @@ -127,12 +128,13 @@ func (q *Queries) GetUserByID(ctx context.Context, id int64) (User, error) { &i.LinkedCommunityID, &i.Scam, &i.Fake, + &i.PremiumUpdatedAt, ) return i, err } const getUserByPhone = `-- name: GetUserByPhone :one -SELECT id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, scam, fake FROM users WHERE phone = $1 AND deleted_at IS NULL +SELECT id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, scam, fake, premium_updated_at FROM users WHERE phone = $1 AND deleted_at IS NULL ` func (q *Queries) GetUserByPhone(ctx context.Context, phone string) (User, error) { @@ -177,12 +179,13 @@ func (q *Queries) GetUserByPhone(ctx context.Context, phone string) (User, error &i.LinkedCommunityID, &i.Scam, &i.Fake, + &i.PremiumUpdatedAt, ) return i, err } const getUserByUsername = `-- name: GetUserByUsername :one -SELECT id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, scam, fake FROM users WHERE lower(username) = lower($1) AND username <> '' AND deleted_at IS NULL +SELECT id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, scam, fake, premium_updated_at FROM users WHERE lower(username) = lower($1) AND username <> '' AND deleted_at IS NULL ` func (q *Queries) GetUserByUsername(ctx context.Context, lower string) (User, error) { @@ -227,12 +230,13 @@ func (q *Queries) GetUserByUsername(ctx context.Context, lower string) (User, er &i.LinkedCommunityID, &i.Scam, &i.Fake, + &i.PremiumUpdatedAt, ) return i, err } const getUsersByIDs = `-- name: GetUsersByIDs :many -SELECT id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, scam, fake +SELECT id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, scam, fake, premium_updated_at FROM users WHERE id = ANY($1::bigint[]) ORDER BY id @@ -286,6 +290,7 @@ func (q *Queries) GetUsersByIDs(ctx context.Context, ids []int64) ([]User, error &i.LinkedCommunityID, &i.Scam, &i.Fake, + &i.PremiumUpdatedAt, ); err != nil { return nil, err } @@ -298,7 +303,7 @@ func (q *Queries) GetUsersByIDs(ctx context.Context, ids []int64) ([]User, error } const getUsersByPhones = `-- name: GetUsersByPhones :many -SELECT id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, scam, fake +SELECT id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, scam, fake, premium_updated_at FROM users WHERE phone = ANY($1::text[]) AND deleted_at IS NULL ORDER BY id @@ -352,6 +357,7 @@ func (q *Queries) GetUsersByPhones(ctx context.Context, phones []string) ([]User &i.LinkedCommunityID, &i.Scam, &i.Fake, + &i.PremiumUpdatedAt, ); err != nil { return nil, err } @@ -560,7 +566,7 @@ UPDATE users SET premium_expires_at = $1::timestamptz, updated_at = now() WHERE id = $2::bigint AND deleted_at IS NULL -RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, scam, fake +RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, scam, fake, premium_updated_at ` type SetUserPremiumUntilParams struct { @@ -610,6 +616,7 @@ func (q *Queries) SetUserPremiumUntil(ctx context.Context, arg SetUserPremiumUnt &i.LinkedCommunityID, &i.Scam, &i.Fake, + &i.PremiumUpdatedAt, ) return i, err } @@ -620,7 +627,7 @@ SET scam = $1::boolean, fake = $2::boolean, updated_at = now() WHERE id = $3::bigint AND deleted_at IS NULL -RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, scam, fake +RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, scam, fake, premium_updated_at ` type SetUserScamFakeParams struct { @@ -671,6 +678,7 @@ func (q *Queries) SetUserScamFake(ctx context.Context, arg SetUserScamFakeParams &i.LinkedCommunityID, &i.Scam, &i.Fake, + &i.PremiumUpdatedAt, ) return i, err } @@ -680,7 +688,7 @@ UPDATE users SET support = $1::boolean, updated_at = now() WHERE id = $2::bigint AND deleted_at IS NULL -RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, scam, fake +RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, scam, fake, premium_updated_at ` type SetUserSupportParams struct { @@ -730,6 +738,7 @@ func (q *Queries) SetUserSupport(ctx context.Context, arg SetUserSupportParams) &i.LinkedCommunityID, &i.Scam, &i.Fake, + &i.PremiumUpdatedAt, ) return i, err } @@ -739,7 +748,7 @@ UPDATE users SET verified = $1::boolean, updated_at = now() WHERE id = $2::bigint AND deleted_at IS NULL -RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, scam, fake +RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, scam, fake, premium_updated_at ` type SetUserVerifiedParams struct { @@ -789,6 +798,7 @@ func (q *Queries) SetUserVerified(ctx context.Context, arg SetUserVerifiedParams &i.LinkedCommunityID, &i.Scam, &i.Fake, + &i.PremiumUpdatedAt, ) return i, err } @@ -805,7 +815,7 @@ WHERE id IN ( ORDER BY premium_expires_at LIMIT $2::int ) -RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, scam, fake +RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, scam, fake, premium_updated_at ` type SweepExpiredPremiumParams struct { @@ -861,6 +871,7 @@ func (q *Queries) SweepExpiredPremium(ctx context.Context, arg SweepExpiredPremi &i.LinkedCommunityID, &i.Scam, &i.Fake, + &i.PremiumUpdatedAt, ); err != nil { return nil, err } @@ -879,7 +890,7 @@ SET birthday_day = $1::int, birthday_year = $3::int, updated_at = now() WHERE id = $4::bigint AND deleted_at IS NULL -RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, scam, fake +RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, scam, fake, premium_updated_at ` type UpdateUserBirthdayParams struct { @@ -936,6 +947,7 @@ func (q *Queries) UpdateUserBirthday(ctx context.Context, arg UpdateUserBirthday &i.LinkedCommunityID, &i.Scam, &i.Fake, + &i.PremiumUpdatedAt, ) return i, err } @@ -947,7 +959,7 @@ SET color_set = $1::boolean, color_background_emoji_id = $3::bigint, updated_at = now() WHERE id = $4::bigint AND deleted_at IS NULL -RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, scam, fake +RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, scam, fake, premium_updated_at ` type UpdateUserColorParams struct { @@ -1004,6 +1016,7 @@ func (q *Queries) UpdateUserColor(ctx context.Context, arg UpdateUserColorParams &i.LinkedCommunityID, &i.Scam, &i.Fake, + &i.PremiumUpdatedAt, ) return i, err } @@ -1016,7 +1029,7 @@ SET emoji_status_document_id = $1::bigint, emoji_status_collectible = $4::jsonb, updated_at = now() WHERE id = $5::bigint AND deleted_at IS NULL -RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, scam, fake +RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, scam, fake, premium_updated_at ` type UpdateUserEmojiStatusParams struct { @@ -1075,6 +1088,7 @@ func (q *Queries) UpdateUserEmojiStatus(ctx context.Context, arg UpdateUserEmoji &i.LinkedCommunityID, &i.Scam, &i.Fake, + &i.PremiumUpdatedAt, ) return i, err } @@ -1101,7 +1115,7 @@ UPDATE users SET personal_channel_id = $1::bigint, updated_at = now() WHERE id = $2::bigint AND deleted_at IS NULL -RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, scam, fake +RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, scam, fake, premium_updated_at ` type UpdateUserPersonalChannelParams struct { @@ -1151,6 +1165,7 @@ func (q *Queries) UpdateUserPersonalChannel(ctx context.Context, arg UpdateUserP &i.LinkedCommunityID, &i.Scam, &i.Fake, + &i.PremiumUpdatedAt, ) return i, err } @@ -1160,7 +1175,7 @@ UPDATE users SET phone = $1::text, updated_at = now() WHERE id = $2::bigint AND deleted_at IS NULL -RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, scam, fake +RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, scam, fake, premium_updated_at ` type UpdateUserPhoneParams struct { @@ -1210,6 +1225,7 @@ func (q *Queries) UpdateUserPhone(ctx context.Context, arg UpdateUserPhoneParams &i.LinkedCommunityID, &i.Scam, &i.Fake, + &i.PremiumUpdatedAt, ) return i, err } @@ -1221,7 +1237,7 @@ SET first_name = $2, about = $4, updated_at = now() WHERE id = $1 AND deleted_at IS NULL -RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, scam, fake +RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, scam, fake, premium_updated_at ` type UpdateUserProfileParams struct { @@ -1278,6 +1294,7 @@ func (q *Queries) UpdateUserProfile(ctx context.Context, arg UpdateUserProfilePa &i.LinkedCommunityID, &i.Scam, &i.Fake, + &i.PremiumUpdatedAt, ) return i, err } @@ -1289,7 +1306,7 @@ SET profile_color_set = $1::boolean, profile_color_background_emoji_id = $3::bigint, updated_at = now() WHERE id = $4::bigint AND deleted_at IS NULL -RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, scam, fake +RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, scam, fake, premium_updated_at ` type UpdateUserProfileColorParams struct { @@ -1346,6 +1363,7 @@ func (q *Queries) UpdateUserProfileColor(ctx context.Context, arg UpdateUserProf &i.LinkedCommunityID, &i.Scam, &i.Fake, + &i.PremiumUpdatedAt, ) return i, err } @@ -1355,7 +1373,7 @@ UPDATE users SET username = $2, updated_at = now() WHERE id = $1 AND deleted_at IS NULL -RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, scam, fake +RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, scam, fake, premium_updated_at ` type UpdateUserUsernameParams struct { @@ -1405,6 +1423,7 @@ func (q *Queries) UpdateUserUsername(ctx context.Context, arg UpdateUserUsername &i.LinkedCommunityID, &i.Scam, &i.Fake, + &i.PremiumUpdatedAt, ) return i, err }