Skip to content

Commit

Permalink
Allow FFIs and APIs to be created without a message ID
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
  • Loading branch information
awrichar committed Jun 29, 2022
1 parent 0ce79ca commit 784a4db
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 10 deletions.
16 changes: 16 additions & 0 deletions db/migrations/postgres/000094_allow_local_definitions.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
BEGIN;
ALTER TABLE identities RENAME COLUMN messages_claim TO messages_claim_old;
ALTER TABLE identities ADD COLUMN messages_claim UUID;
UPDATE identities SET messages_claim = messages_claim_old;
ALTER TABLE identities DROP COLUMN messages_claim_old;

ALTER TABLE ffi RENAME COLUMN message_id TO message_id_old;
ALTER TABLE ffi ADD COLUMN message_id UUID;
UPDATE ffi SET message_id = message_id_old;
ALTER TABLE ffi DROP COLUMN message_id_old;

ALTER TABLE contractapis RENAME COLUMN message_id TO message_id_old;
ALTER TABLE contractapis ADD COLUMN message_id UUID;
UPDATE contractapis SET message_id = message_id_old;
ALTER TABLE contractapis DROP COLUMN message_id_old;
COMMIT;
6 changes: 0 additions & 6 deletions db/migrations/postgres/000094_allow_local_identity.up.sql

This file was deleted.

14 changes: 14 additions & 0 deletions db/migrations/sqlite/000094_allow_local_definitions.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
ALTER TABLE identities RENAME COLUMN messages_claim TO messages_claim_old;
ALTER TABLE identities ADD COLUMN messages_claim UUID;
UPDATE identities SET messages_claim = messages_claim_old;
ALTER TABLE identities DROP COLUMN messages_claim_old;

ALTER TABLE ffi RENAME COLUMN message_id TO message_id_old;
ALTER TABLE ffi ADD COLUMN message_id UUID;
UPDATE ffi SET message_id = message_id_old;
ALTER TABLE ffi DROP COLUMN message_id_old;

ALTER TABLE contractapis RENAME COLUMN message_id TO message_id_old;
ALTER TABLE contractapis ADD COLUMN message_id UUID;
UPDATE contractapis SET message_id = message_id_old;
ALTER TABLE contractapis DROP COLUMN message_id_old;
4 changes: 0 additions & 4 deletions db/migrations/sqlite/000094_allow_local_identity.up.sql

This file was deleted.

0 comments on commit 784a4db

Please sign in to comment.