File tree Expand file tree Collapse file tree 5 files changed +8
-6
lines changed
migrations/20241105091733_chain_id_from_int_to_string Expand file tree Collapse file tree 5 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ export const createContractSubscription = async ({
2121} : CreateContractSubscriptionParams ) => {
2222 return prisma . contractSubscriptions . create ( {
2323 data : {
24- chainId,
24+ chainId : chainId . toString ( ) ,
2525 contractAddress,
2626 webhookId,
2727 processEventLogs,
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ export const isContractSubscribed = async ({
1111} : GetContractSubscriptionsParams ) => {
1212 const contractSubscription = await prisma . contractSubscriptions . findFirst ( {
1313 where : {
14- chainId,
14+ chainId : chainId . toString ( ) ,
1515 contractAddress,
1616 deletedAt : null ,
1717 } ,
@@ -25,7 +25,7 @@ export const getContractSubscriptionsByChainId = async (
2525) => {
2626 return await prisma . contractSubscriptions . findMany ( {
2727 where : {
28- chainId,
28+ chainId : chainId . toString ( ) ,
2929 deletedAt : null ,
3030 } ,
3131 include : {
@@ -56,5 +56,5 @@ export const getContractSubscriptionsUniqueChainIds = async () => {
5656 } ,
5757 } ) ;
5858
59- return uniqueChainIds . map ( ( contract ) => contract . chainId ) ;
59+ return uniqueChainIds . map ( ( contract ) => Number . parseInt ( contract . chainId ) ) ;
6060} ;
Original file line number Diff line number Diff line change 1+ -- AlterTable
2+ ALTER TABLE " contract_subscriptions" ALTER COLUMN " chainId" SET DATA TYPE TEXT ;
Original file line number Diff line number Diff line change @@ -202,7 +202,7 @@ model Relayers {
202202
203203model ContractSubscriptions {
204204 id String @id @default (uuid () ) @map (" id " )
205- chainId Int
205+ chainId String
206206 contractAddress String
207207 webhookId Int ?
208208 processEventLogs Boolean @default (true )
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ export const toContractSubscriptionSchema = (
2222 contractSubscription : ContractSubscriptions & { webhook : Webhooks | null } ,
2323) : Static < typeof contractSubscriptionSchema > => ( {
2424 id : contractSubscription . id ,
25- chainId : contractSubscription . chainId ,
25+ chainId : Number . parseInt ( contractSubscription . chainId ) ,
2626 contractAddress : contractSubscription . contractAddress ,
2727 webhook : contractSubscription . webhook
2828 ? toWebhookSchema ( contractSubscription . webhook )
You can’t perform that action at this time.
0 commit comments