-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathdatabase.ts
90 lines (89 loc) · 2.46 KB
/
database.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
import { registerAs } from '@nestjs/config';
import { SnakeNamingStrategy } from 'typeorm-naming-strategies';
import {
TransactionAction,
Transaction,
Receipt,
ReceiptAction,
AccountChange,
} from '@sputnik-v2/near-indexer/entities';
import { Subscription } from '@sputnik-v2/subscription/entities';
import { Proposal, ProposalAction } from '@sputnik-v2/proposal/entities';
import { Account } from '@sputnik-v2/account/entities';
import { Dao, DaoVersion, Policy, Role } from '@sputnik-v2/dao/entities';
import {
Bounty,
BountyClaim,
BountyContext,
} from '@sputnik-v2/bounty/entities';
import {
Token,
NFTToken,
NFTTokenMetadata,
TokenBalance,
NFTContract,
} from '@sputnik-v2/token/entities';
import {
AccountNotification,
AccountNotificationSettings,
Notification,
} from '@sputnik-v2/notification/entities';
import { Comment, CommentReport } from '@sputnik-v2/comment/entities';
import { DaoStats } from '@sputnik-v2/stats/entities';
import { DaoSettings } from '@sputnik-v2/dao-settings/entities';
import { OTP } from '@sputnik-v2/otp';
import {
ProposalTemplate,
SharedProposalTemplate,
} from '@sputnik-v2/proposal-template/entities';
import { TransactionHandlerState } from '@sputnik-v2/transaction-handler/entities';
import { SharedProposalTemplateDao } from '@sputnik-v2/proposal-template/entities/shared-proposal-template-dao.entity';
import { Delegation } from '@sputnik-v2/dao/entities/delegation.entity';
import { ErrorEntity } from '@sputnik-v2/error-tracker/entities';
export default registerAs('db_default', () => ({
type: 'postgres',
host: process.env.DATABASE_HOST,
port: parseInt(process.env.DATABASE_PORT, 10),
database: process.env.DATABASE_NAME,
username: process.env.DATABASE_USERNAME,
password: process.env.DATABASE_PASSWORD,
entities: [
Subscription,
Dao,
DaoVersion,
DaoSettings,
Policy,
Role,
Bounty,
BountyClaim,
BountyContext,
Proposal,
ProposalAction,
Transaction,
TransactionAction,
Account,
Receipt,
ReceiptAction,
AccountChange,
Token,
TokenBalance,
NFTContract,
NFTToken,
NFTTokenMetadata,
Notification,
AccountNotification,
AccountNotificationSettings,
Comment,
CommentReport,
DaoStats,
OTP,
ProposalTemplate,
SharedProposalTemplate,
SharedProposalTemplateDao,
Delegation,
TransactionHandlerState,
ErrorEntity,
],
synchronize: false,
namingStrategy: new SnakeNamingStrategy(),
}));