-
Notifications
You must be signed in to change notification settings - Fork 1
/
db.js
40 lines (37 loc) · 893 Bytes
/
db.js
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
import { Sequelize, DataTypes } from 'sequelize';
export const sequelize = new Sequelize(process.env.DB, process.env.USERNAME, process.env.PASSWORD, {
// host: process.env.HOST,
// port: process.env.PORT,
// dialect: 'postgres',
// dialectOptions: {
// keepAlive: true,
// },
// logging: false,
// SQLite only
dialect: 'sqlite',
storage: 'database.sqlite',
});
export const Channels = sequelize.define('channels', {
guildId: {
type: DataTypes.STRING,
},
channelId: {
type: DataTypes.STRING,
unique: true,
},
createdAt: {
type: DataTypes.DATE,
},
createdBy: {
type: DataTypes.STRING,
}
});
export const Appreciate = sequelize.define('appreciate',{
userId:{
type: DataTypes.STRING,
unique: true,
},
count:{
type: DataTypes.INTEGER,
}
})