-
Notifications
You must be signed in to change notification settings - Fork 16
Database migrations toolkit for ENSNode Schema in ENSDb #1779
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
f593595
Setup `drizzle-kit` to enable database migrations for ENSNode Schema
tk-o 82feb70
Migration: initialize ENSNode Schema in ENSDb.
tk-o 9b96470
docs(changeset): Introduced toolkit for managing ENSDb migrations for…
tk-o 1ad9002
Apply suggestions from code review
tk-o 177324a
Apply suggestions from code review
tk-o 8f6994d
Optimize readme file for ENSDb SDK for clarity
tk-o 4e6c2c0
Merge remote-tracking branch 'origin/main' into feat/ensdb-sdk-migrat…
tk-o 7f477c5
Revert updates to README.md file
tk-o cf6bd47
Merge remote-tracking branch 'origin/main' into feat/ensdb-sdk-migrat…
tk-o 825972e
Apply pr feedback
tk-o File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,5 @@ | ||
| --- | ||
| "@ensnode/ensdb-sdk": minor | ||
| --- | ||
|
|
||
| Introduced toolkit for managing ENSDb migrations for ENSNode Schema. | ||
This file contains hidden or 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,10 @@ | ||
| import { defineConfig } from "drizzle-kit"; | ||
|
|
||
| const ensNodeSchemaPath = "./src/ensnode/index.ts"; | ||
|
|
||
| export default defineConfig({ | ||
| casing: "snake_case", | ||
| dialect: "postgresql", | ||
| out: "migrations", | ||
| schema: ensNodeSchemaPath, | ||
tk-o marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }); | ||
8 changes: 8 additions & 0 deletions
8
packages/ensdb-sdk/migrations/0000_cultured_captain_cross.sql
This file contains hidden or 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,8 @@ | ||
| CREATE SCHEMA IF NOT EXISTS ensnode; | ||
|
|
||
| CREATE TABLE "ensnode"."metadata" ( | ||
| "ens_indexer_schema_name" text NOT NULL, | ||
| "key" text NOT NULL, | ||
| "value" jsonb NOT NULL, | ||
| CONSTRAINT "metadata_pkey" PRIMARY KEY("ens_indexer_schema_name","key") | ||
| ); |
This file contains hidden or 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,55 @@ | ||
| { | ||
| "id": "d661dcae-f64d-4ecd-a4da-3d5783e17e2c", | ||
| "prevId": "00000000-0000-0000-0000-000000000000", | ||
| "version": "7", | ||
| "dialect": "postgresql", | ||
| "tables": { | ||
| "ensnode.metadata": { | ||
| "name": "metadata", | ||
| "schema": "ensnode", | ||
| "columns": { | ||
| "ens_indexer_schema_name": { | ||
| "name": "ens_indexer_schema_name", | ||
| "type": "text", | ||
| "primaryKey": false, | ||
| "notNull": true | ||
| }, | ||
| "key": { | ||
| "name": "key", | ||
| "type": "text", | ||
| "primaryKey": false, | ||
| "notNull": true | ||
| }, | ||
| "value": { | ||
| "name": "value", | ||
| "type": "jsonb", | ||
| "primaryKey": false, | ||
| "notNull": true | ||
| } | ||
| }, | ||
| "indexes": {}, | ||
| "foreignKeys": {}, | ||
| "compositePrimaryKeys": { | ||
| "metadata_pkey": { | ||
| "name": "metadata_pkey", | ||
| "columns": ["ens_indexer_schema_name", "key"] | ||
| } | ||
| }, | ||
| "uniqueConstraints": {}, | ||
| "policies": {}, | ||
| "checkConstraints": {}, | ||
| "isRLSEnabled": false | ||
| } | ||
| }, | ||
| "enums": {}, | ||
| "schemas": {}, | ||
| "sequences": {}, | ||
| "roles": {}, | ||
| "policies": {}, | ||
| "views": {}, | ||
| "_meta": { | ||
| "columns": {}, | ||
| "schemas": {}, | ||
| "tables": {} | ||
| } | ||
| } |
This file contains hidden or 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,13 @@ | ||
| { | ||
| "version": "7", | ||
| "dialect": "postgresql", | ||
| "entries": [ | ||
| { | ||
| "idx": 0, | ||
| "version": "7", | ||
| "when": 1773743108514, | ||
| "tag": "0000_cultured_captain_cross", | ||
| "breakpoints": true | ||
| } | ||
| ] | ||
| } |
This file contains hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.