-
Notifications
You must be signed in to change notification settings - Fork 242
Add postgres migrations for onchain-logic #390
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
peterbroadhurst
merged 2 commits into
hyperledger:onchain-logic
from
kaleido-io:onchain-logic-postgres
Jan 10, 2022
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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,3 @@ | ||
| BEGIN; | ||
| DROP TABLE IF EXISTS ffi; | ||
| COMMIT; |
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,14 @@ | ||
| BEGIN; | ||
| CREATE TABLE ffi ( | ||
| seq SERIAL PRIMARY KEY, | ||
| id UUID NOT NULL, | ||
| namespace VARCHAR(64) NOT NULL, | ||
| name VARCHAR(1024) NOT NULL, | ||
| version VARCHAR(64) NOT NULL, | ||
| description TEXT NOT NULL, | ||
| message_id UUID NOT NULL | ||
| ); | ||
|
|
||
| CREATE UNIQUE INDEX ffi_id ON ffi(id); | ||
| CREATE UNIQUE INDEX ffi_name ON ffi(namespace,name,version); | ||
| COMMIT; |
3 changes: 3 additions & 0 deletions
3
db/migrations/postgres/000050_create_ffi_methods_table.down.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,3 @@ | ||
| BEGIN; | ||
| DROP TABLE IF EXISTS ffimethods; | ||
| COMMIT; |
15 changes: 15 additions & 0 deletions
15
db/migrations/postgres/000050_create_ffi_methods_table.up.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,15 @@ | ||
| BEGIN; | ||
| CREATE TABLE ffimethods ( | ||
| seq SERIAL PRIMARY KEY, | ||
| id UUID NOT NULL, | ||
| interface_id UUID NOT NULL, | ||
| namespace VARCHAR(64) NOT NULL, | ||
| name VARCHAR(1024) NOT NULL, | ||
| pathname VARCHAR(1024) NOT NULL, | ||
| description TEXT NOT NULL, | ||
| params BYTEA NOT NULL, | ||
| returns BYTEA NOT NULL | ||
| ); | ||
|
|
||
| CREATE UNIQUE INDEX ffimethods_pathname ON ffimethods(interface_id,pathname); | ||
| COMMIT; |
3 changes: 3 additions & 0 deletions
3
db/migrations/postgres/000051_create_ffi_events_table.down.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,3 @@ | ||
| BEGIN; | ||
| DROP TABLE IF EXISTS ffievents; | ||
| COMMIT; |
14 changes: 14 additions & 0 deletions
14
db/migrations/postgres/000051_create_ffi_events_table.up.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,14 @@ | ||
| BEGIN; | ||
| CREATE TABLE ffievents ( | ||
| seq SERIAL PRIMARY KEY, | ||
| id UUID NOT NULL, | ||
| interface_id UUID NULL, | ||
| namespace VARCHAR(64) NOT NULL, | ||
| name VARCHAR(1024) NOT NULL, | ||
| pathname VARCHAR(1024) NOT NULL, | ||
| description TEXT NOT NULL, | ||
| params BYTEA NOT NULL | ||
| ); | ||
|
|
||
| CREATE UNIQUE INDEX ffievents_pathname ON ffievents(interface_id,pathname); | ||
| COMMIT; | ||
3 changes: 3 additions & 0 deletions
3
db/migrations/postgres/000052_create_contractapis_table.down.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,3 @@ | ||
| BEGIN; | ||
| DROP TABLE IF EXISTS contractapis; | ||
| COMMIT; |
13 changes: 13 additions & 0 deletions
13
db/migrations/postgres/000052_create_contractapis_table.up.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,13 @@ | ||
| BEGIN; | ||
| CREATE TABLE contractapis ( | ||
| seq SERIAL PRIMARY KEY, | ||
| id UUID NOT NULL, | ||
| interface_id UUID NOT NULL, | ||
| ledger BYTEA, | ||
| location BYTEA, | ||
| name VARCHAR(64) NOT NULL, | ||
| namespace VARCHAR(64) NOT NULL | ||
| ); | ||
|
|
||
| CREATE UNIQUE INDEX contractapis_namespace_name ON contractapis(namespace,name); | ||
| COMMIT; |
12 changes: 0 additions & 12 deletions
12
db/migrations/postgres/000053_create_contractevents_table.up.sql
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...eate_contractsubscriptions_table.down.sql → ...eate_contractsubscriptions_table.down.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 |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| BEGIN; | ||
| DROP TABLE IF EXISTS contractsubscriptions; | ||
| COMMIT; | ||
| COMMIT; |
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
2 changes: 1 addition & 1 deletion
2
...0053_create_contractevents_table.down.sql → ...0054_create_contractevents_table.down.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 |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| BEGIN; | ||
| DROP TABLE IF EXISTS contractevents; | ||
| COMMIT; | ||
| COMMIT; |
15 changes: 15 additions & 0 deletions
15
db/migrations/postgres/000054_create_contractevents_table.up.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,15 @@ | ||
| BEGIN; | ||
| CREATE TABLE contractevents ( | ||
| seq SERIAL PRIMARY KEY, | ||
| id UUID NOT NULL, | ||
| namespace VARCHAR(64) NOT NULL, | ||
| name VARCHAR(1024) NOT NULL, | ||
| subscription_id UUID NOT NULL, | ||
| outputs BYTEA, | ||
| info BYTEA, | ||
| timestamp BIGINT NOT NULL | ||
| ); | ||
| CREATE UNIQUE INDEX contractevents_name ON contractevents(namespace,name); | ||
| CREATE UNIQUE INDEX contractevents_timestamp ON contractevents(timestamp); | ||
| CREATE UNIQUE INDEX contractevents_subscription_id ON contractevents(subscription_id); | ||
| COMMIT; |
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll be updating this after in the merge from #384