Skip to content

Commit

Permalink
feat: add Delegate entity
Browse files Browse the repository at this point in the history
  • Loading branch information
deanpress committed Jan 31, 2020
1 parent f70c806 commit 03c0f8a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@
"updates": "../../node_modules/npm-check-updates/bin/npm-check-updates -a"
},
"dependencies": {
"sqlite3": "^4.1.1",
"@arkecosystem/core-container": "^2.6.0-next.9",
"@arkecosystem/core-http-utils": "^2.6.0-next.9",
"@arkecosystem/core-interfaces": "^2.6.0-next.9",
"@arkecosystem/crypto": "^2.6.0-next.9",
"bytebuffer": "^5.0.1",
"queue": "^6.0.1",
"reflect-metadata": "0.1.13",
"sqlite3": "^4.1.0",
"typeorm": "^0.2.18"
},
"devDependencies": {
Expand Down
13 changes: 13 additions & 0 deletions src/entities/Delegate.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { BaseEntity, Column, Entity, PrimaryGeneratedColumn } from "typeorm";

@Entity()
export class Delegate extends BaseEntity {
@PrimaryGeneratedColumn()
public id: number;

@Column("varchar")
public publicKey: string;

@Column("varchar")
public topRewards: string;
}
1 change: 1 addition & 0 deletions src/entities/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from "./Statistic";
export * from "./Round";
export * from "./Delegate";
4 changes: 2 additions & 2 deletions src/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const qp = queue();
qp.concurrency = 1;

// Entities
import { Statistic, Round } from "./entities";
import { Statistic, Round, Delegate } from "./entities";

// Core plugins

Expand Down Expand Up @@ -41,7 +41,7 @@ export const plugin: Container.IPluginDescriptor = {
type: "sqlite",
database: dbPath,
// Import entities to connection
entities: [Statistic, Round],
entities: [Statistic, Round, Delegate],
synchronize: true,
});

Expand Down

0 comments on commit 03c0f8a

Please sign in to comment.