mirror of
https://github.com/alexgo-io/stacks-blockchain-api.git
synced 2026-04-30 05:45:37 +08:00
fix: possible fix for invalid paths after build for schemas and tx lib
This commit is contained in:
@@ -1,41 +0,0 @@
|
||||
import { MigrationBuilder, ColumnDefinitions } from 'node-pg-migrate';
|
||||
|
||||
export const shorthands: ColumnDefinitions | undefined = undefined;
|
||||
|
||||
export async function up(pgm: MigrationBuilder): Promise<void> {
|
||||
pgm.createTable('blocks', {
|
||||
block_hash: {
|
||||
primaryKey: true,
|
||||
type: 'bytea',
|
||||
},
|
||||
block_height: {
|
||||
type: 'integer',
|
||||
notNull: true,
|
||||
},
|
||||
index_block_hash: {
|
||||
type: 'bytea',
|
||||
notNull: true,
|
||||
},
|
||||
parent_block_hash: {
|
||||
type: 'bytea',
|
||||
notNull: true,
|
||||
},
|
||||
parent_microblock: {
|
||||
type: 'bytea',
|
||||
notNull: true,
|
||||
},
|
||||
canonical: {
|
||||
type: 'boolean',
|
||||
notNull: true,
|
||||
},
|
||||
});
|
||||
pgm.createIndex('blocks', 'block_height');
|
||||
pgm.createIndex('blocks', 'parent_block_hash');
|
||||
pgm.createIndex('blocks', 'canonical');
|
||||
}
|
||||
|
||||
/*
|
||||
export async function down(pgm: MigrationBuilder): Promise<void> {
|
||||
pgm.dropTable('blocks');
|
||||
}
|
||||
*/
|
||||
@@ -1,66 +0,0 @@
|
||||
import { MigrationBuilder, ColumnDefinitions } from 'node-pg-migrate';
|
||||
|
||||
export const shorthands: ColumnDefinitions | undefined = undefined;
|
||||
|
||||
export async function up(pgm: MigrationBuilder): Promise<void> {
|
||||
pgm.createTable('txs', {
|
||||
tx_id: {
|
||||
primaryKey: true,
|
||||
type: 'bytea',
|
||||
},
|
||||
tx_index: {
|
||||
notNull: true,
|
||||
type: 'smallint',
|
||||
},
|
||||
block_hash: {
|
||||
type: 'bytea',
|
||||
notNull: true,
|
||||
},
|
||||
block_height: {
|
||||
type: 'integer',
|
||||
notNull: true,
|
||||
},
|
||||
type_id: {
|
||||
notNull: true,
|
||||
type: 'smallint',
|
||||
},
|
||||
status: {
|
||||
notNull: true,
|
||||
type: 'smallint',
|
||||
},
|
||||
canonical: {
|
||||
type: 'boolean',
|
||||
notNull: true,
|
||||
},
|
||||
post_conditions: {
|
||||
type: 'bytea',
|
||||
},
|
||||
fee_rate: {
|
||||
type: 'bigint',
|
||||
notNull: true,
|
||||
},
|
||||
sponsored: {
|
||||
type: 'boolean',
|
||||
notNull: true,
|
||||
},
|
||||
sender_address: {
|
||||
type: 'string',
|
||||
notNull: true,
|
||||
},
|
||||
origin_hash_mode: {
|
||||
type: 'smallint',
|
||||
notNull: true,
|
||||
},
|
||||
});
|
||||
pgm.createIndex('txs', 'block_hash');
|
||||
pgm.createIndex('txs', 'type_id');
|
||||
pgm.createIndex('txs', 'block_height');
|
||||
pgm.createIndex('txs', 'canonical');
|
||||
pgm.createIndex('txs', 'sender_address');
|
||||
}
|
||||
|
||||
/*
|
||||
export async function down(pgm: MigrationBuilder): Promise<void> {
|
||||
pgm.dropTable('txs');
|
||||
}
|
||||
*/
|
||||
Reference in New Issue
Block a user