-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support inscription transfers (#37)
* feat: transfer apply * test: transfers * feat: location draft * feat: history * feat: json p op * fix: overwrite data * fix: automatic genesis current * fix: normalize location pos * feat: prometheus http metrics * refactor: rename to /transfers * fix: normalization * fix: switch to new predicate syntax
- Loading branch information
Showing
20 changed files
with
1,126 additions
and
312 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* eslint-disable @typescript-eslint/naming-convention */ | ||
import { MigrationBuilder, ColumnDefinitions } from 'node-pg-migrate'; | ||
|
||
export const shorthands: ColumnDefinitions | undefined = undefined; | ||
|
||
export function up(pgm: MigrationBuilder): void { | ||
pgm.createTable('json_contents', { | ||
id: { | ||
type: 'serial', | ||
primaryKey: true, | ||
}, | ||
inscription_id: { | ||
type: 'int', | ||
notNull: true, | ||
}, | ||
p: { | ||
type: 'text', | ||
notNull: true, | ||
}, | ||
op: { | ||
type: 'text', | ||
notNull: true, | ||
}, | ||
content: { | ||
type: 'jsonb', | ||
notNull: true, | ||
}, | ||
}); | ||
pgm.createConstraint( | ||
'json_contents', | ||
'json_contents_inscription_id_fk', | ||
'FOREIGN KEY(inscription_id) REFERENCES inscriptions(id) ON DELETE CASCADE' | ||
); | ||
pgm.createConstraint( | ||
'json_contents', | ||
'json_contents_inscription_id_unique', | ||
'UNIQUE(inscription_id)' | ||
); | ||
pgm.createIndex('json_contents', ['p']); | ||
pgm.createIndex('json_contents', ['op']); | ||
} |
Oops, something went wrong.