Skip to content

Commit

Permalink
feat: add typeHash and daoData to Output
Browse files Browse the repository at this point in the history
  • Loading branch information
classicalliu committed Nov 4, 2019
1 parent 6a099dc commit 5efe225
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
12 changes: 12 additions & 0 deletions packages/neuron-wallet/src/database/chain/entities/output.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@ export default class Output extends BaseEntity {
})
typeScript: Script | null = null

@Column({
type: 'varchar',
nullable: true,
})
typeHash: string | null = null

@Column({
type: 'varchar',
nullable: true,
})
daoData: string | null = null

@Column({
type: 'boolean',
})
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import {MigrationInterface, QueryRunner, TableColumn} from "typeorm"

export class AddTypeHashToOutput1572852964749 implements MigrationInterface {

public async up(queryRunner: QueryRunner): Promise<any> {
await queryRunner.addColumn('output', new TableColumn({
name: 'typeHash',
type: 'varchar',
isNullable: true,
}))

await queryRunner.addColumn('output', new TableColumn({
name: 'daoData',
type: 'varchar',
isNullable: true,
}))
}

public async down(queryRunner: QueryRunner): Promise<any> {
await queryRunner.dropColumn('output', 'typeHash')
await queryRunner.dropColumn('output', 'daoData')
}

}
4 changes: 3 additions & 1 deletion packages/neuron-wallet/src/database/chain/ormconfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { AddLockToInput1570522869590 } from './migrations/1570522869590-AddLockT
import { AddIndices1572006450765 } from './migrations/1572006450765-AddIndices'
import { AddIndexToTxTimestamp1572137226866 } from './migrations/1572137226866-AddIndexToTxTimestamp'
import { AddOutputIndex1572226722928 } from './migrations/1572226722928-AddOutputIndex'
import { AddTypeHashToOutput1572852964749 } from './migrations/1572852964749-AddTypeHashToOutput'

export const CONNECTION_NOT_FOUND_NAME = 'ConnectionNotFoundError'

Expand Down Expand Up @@ -43,7 +44,8 @@ const connectOptions = async (genesisBlockHash: string): Promise<SqliteConnectio
AddLockToInput1570522869590,
AddIndices1572006450765,
AddIndexToTxTimestamp1572137226866,
AddOutputIndex1572226722928
AddOutputIndex1572226722928,
AddTypeHashToOutput1572852964749,
],
logging,
maxQueryExecutionTime: 30
Expand Down

0 comments on commit 5efe225

Please sign in to comment.