-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdataSource.ts
More file actions
37 lines (34 loc) · 997 Bytes
/
dataSource.ts
File metadata and controls
37 lines (34 loc) · 997 Bytes
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
import { ChannelChats } from 'src/entities/ChannelChats';
import { ChannelMembers } from 'src/entities/ChannelMembers';
import { Channels } from 'src/entities/Channels';
import { DMs } from 'src/entities/DMs';
import { Mentions } from 'src/entities/Mentions';
import { Users } from 'src/entities/Users';
import { WorkspaceMembers } from 'src/entities/WorkspaceMembers';
import { Workspaces } from 'src/entities/Workspaces';
import { DataSource } from 'typeorm';
import dotenv from 'dotenv';
dotenv.config();
const dataSource = new DataSource({
type: 'mysql',
host: 'localhost',
port: 3306,
username: process.env.DB_USERNAME,
password: process.env.DB_PASSWORD,
database: process.env.DB_DATABASE,
entities: [
ChannelChats,
ChannelMembers,
Channels,
DMs,
Mentions,
Users,
WorkspaceMembers,
Workspaces,
],
migrations: [__dirname + '/src/migrations/*.ts'],
charset: 'utf8mb4',
synchronize: false,
logging: true,
});
export default dataSource;