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 ({
21
21
} : CreateContractSubscriptionParams ) => {
22
22
return prisma . contractSubscriptions . create ( {
23
23
data : {
24
- chainId,
24
+ chainId : chainId . toString ( ) ,
25
25
contractAddress,
26
26
webhookId,
27
27
processEventLogs,
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ export const isContractSubscribed = async ({
11
11
} : GetContractSubscriptionsParams ) => {
12
12
const contractSubscription = await prisma . contractSubscriptions . findFirst ( {
13
13
where : {
14
- chainId,
14
+ chainId : chainId . toString ( ) ,
15
15
contractAddress,
16
16
deletedAt : null ,
17
17
} ,
@@ -25,7 +25,7 @@ export const getContractSubscriptionsByChainId = async (
25
25
) => {
26
26
return await prisma . contractSubscriptions . findMany ( {
27
27
where : {
28
- chainId,
28
+ chainId : chainId . toString ( ) ,
29
29
deletedAt : null ,
30
30
} ,
31
31
include : {
@@ -56,5 +56,5 @@ export const getContractSubscriptionsUniqueChainIds = async () => {
56
56
} ,
57
57
} ) ;
58
58
59
- return uniqueChainIds . map ( ( contract ) => contract . chainId ) ;
59
+ return uniqueChainIds . map ( ( contract ) => Number . parseInt ( contract . chainId ) ) ;
60
60
} ;
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 {
202
202
203
203
model ContractSubscriptions {
204
204
id String @id @default (uuid () ) @map (" id " )
205
- chainId Int
205
+ chainId String
206
206
contractAddress String
207
207
webhookId Int ?
208
208
processEventLogs Boolean @default (true )
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ export const toContractSubscriptionSchema = (
22
22
contractSubscription : ContractSubscriptions & { webhook : Webhooks | null } ,
23
23
) : Static < typeof contractSubscriptionSchema > => ( {
24
24
id : contractSubscription . id ,
25
- chainId : contractSubscription . chainId ,
25
+ chainId : Number . parseInt ( contractSubscription . chainId ) ,
26
26
contractAddress : contractSubscription . contractAddress ,
27
27
webhook : contractSubscription . webhook
28
28
? toWebhookSchema ( contractSubscription . webhook )
You can’t perform that action at this time.
0 commit comments