Files
stacks-blockchain-api/migrations/1621511823381_nft_metadata.js
2023-09-19 10:58:39 +01:00

45 lines
829 B
JavaScript

/** @param { import("node-pg-migrate").MigrationBuilder } pgm */
exports.up = pgm => {
pgm.createTable('nft_metadata', {
id: {
type: 'serial',
primaryKey: true,
},
name: {
type: 'string',
notNull: true,
},
token_uri: {
type: 'string',
notNull: true,
},
description: {
type: 'string',
notNull: true,
},
image_uri: {
type: 'string',
notNull: true,
},
image_canonical_uri: {
type: 'string',
notNull: true,
},
contract_id: {
type: 'string',
notNull: true,
unique: true,
},
tx_id: {
type: 'bytea',
notNull: true,
},
sender_address: {
type: 'string',
notNull: true,
}
});
pgm.createIndex('nft_metadata', 'contract_id', { method: 'hash' });
}