-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
405ce0a
commit 66429ae
Showing
60 changed files
with
450 additions
and
1,210 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
import type { Config } from 'drizzle-kit'; | ||
import { env } from './src/env.js'; | ||
|
||
if (!process.env.DELEGATIONS_DATABASE_URL) { | ||
throw new Error('DELEGATIONS_DATABASE_URL is not set'); | ||
} | ||
|
||
export default { | ||
schema: './src/db/schema.ts', | ||
out: './src/db/migrations', | ||
dialect: 'postgresql', | ||
dbCredentials: { | ||
url: env.DELEGATIONS_DATABASE_URL, | ||
url: process.env.DELEGATIONS_DATABASE_URL, | ||
}, | ||
} satisfies Config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 5 additions & 2 deletions
7
apps/api-delegations/src/db/actions/delegations/insert-delegation-db.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
apps/api-delegations/src/db/migrations/0006_flimsy_harpoon.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
ALTER TABLE "caveats" ALTER COLUMN "type" DROP NOT NULL;--> statement-breakpoint | ||
ALTER TABLE "delegations" ALTER COLUMN "type" DROP NOT NULL;--> statement-breakpoint | ||
ALTER TABLE "delegations" ADD COLUMN "verifyingContract" varchar(42) NOT NULL; |
156 changes: 156 additions & 0 deletions
156
apps/api-delegations/src/db/migrations/meta/0006_snapshot.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,156 @@ | ||
{ | ||
"id": "329f48a4-b96c-4cdf-99d6-6a84a14dd24c", | ||
"prevId": "1f0dc50b-abed-4990-b8a2-435e9ee80874", | ||
"version": "7", | ||
"dialect": "postgresql", | ||
"tables": { | ||
"public.caveats": { | ||
"name": "caveats", | ||
"schema": "", | ||
"columns": { | ||
"id": { | ||
"name": "id", | ||
"type": "serial", | ||
"primaryKey": true, | ||
"notNull": true | ||
}, | ||
"type": { | ||
"name": "type", | ||
"type": "varchar(256)", | ||
"primaryKey": false, | ||
"notNull": false | ||
}, | ||
"enforcer": { | ||
"name": "enforcer", | ||
"type": "varchar(42)", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"terms": { | ||
"name": "terms", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"args": { | ||
"name": "args", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"delegationHash": { | ||
"name": "delegationHash", | ||
"type": "varchar(66)", | ||
"primaryKey": false, | ||
"notNull": true | ||
} | ||
}, | ||
"indexes": {}, | ||
"foreignKeys": { | ||
"caveats_delegationHash_delegations_hash_fk": { | ||
"name": "caveats_delegationHash_delegations_hash_fk", | ||
"tableFrom": "caveats", | ||
"tableTo": "delegations", | ||
"columnsFrom": [ | ||
"delegationHash" | ||
], | ||
"columnsTo": [ | ||
"hash" | ||
], | ||
"onDelete": "no action", | ||
"onUpdate": "no action" | ||
} | ||
}, | ||
"compositePrimaryKeys": {}, | ||
"uniqueConstraints": {}, | ||
"policies": {}, | ||
"checkConstraints": {}, | ||
"isRLSEnabled": false | ||
}, | ||
"public.delegations": { | ||
"name": "delegations", | ||
"schema": "", | ||
"columns": { | ||
"hash": { | ||
"name": "hash", | ||
"type": "varchar(66)", | ||
"primaryKey": true, | ||
"notNull": true | ||
}, | ||
"chainId": { | ||
"name": "chainId", | ||
"type": "integer", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"verifyingContract": { | ||
"name": "verifyingContract", | ||
"type": "varchar(42)", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"type": { | ||
"name": "type", | ||
"type": "varchar(256)", | ||
"primaryKey": false, | ||
"notNull": false | ||
}, | ||
"delegator": { | ||
"name": "delegator", | ||
"type": "varchar(42)", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"delegate": { | ||
"name": "delegate", | ||
"type": "varchar(42)", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"authority": { | ||
"name": "authority", | ||
"type": "varchar(66)", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"salt": { | ||
"name": "salt", | ||
"type": "bigint", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"signature": { | ||
"name": "signature", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"isValid": { | ||
"name": "isValid", | ||
"type": "boolean", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"default": true | ||
} | ||
}, | ||
"indexes": {}, | ||
"foreignKeys": {}, | ||
"compositePrimaryKeys": {}, | ||
"uniqueConstraints": {}, | ||
"policies": {}, | ||
"checkConstraints": {}, | ||
"isRLSEnabled": false | ||
} | ||
}, | ||
"enums": {}, | ||
"schemas": {}, | ||
"sequences": {}, | ||
"roles": {}, | ||
"policies": {}, | ||
"views": {}, | ||
"_meta": { | ||
"columns": {}, | ||
"schemas": {}, | ||
"tables": {} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 3 additions & 5 deletions
8
apps/api-universal/src/utils/calculate-erc20-transfer-amount-enforcer-collection-total.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.