Update user.go
This commit is contained in:
parent
539699ba04
commit
2d3de9740c
1 changed files with 27 additions and 11 deletions
|
@ -34,6 +34,7 @@ type UserQuery struct {
|
|||
}
|
||||
|
||||
func (uq *UserQuery) CreateTable(dbType string) error {
|
||||
if strings.ToLower(dbType) == "postgres" {
|
||||
_, err := uq.db.Exec(`CREATE TABLE IF NOT EXISTS whatsapp_user (
|
||||
mxid VARCHAR(255) PRIMARY KEY,
|
||||
jid VARCHAR(255) UNIQUE,
|
||||
|
@ -47,6 +48,21 @@ func (uq *UserQuery) CreateTable(dbType string) error {
|
|||
mac_key bytea
|
||||
)`)
|
||||
return err
|
||||
} else {
|
||||
_, err := uq.db.Exec(`CREATE TABLE IF NOT EXISTS whatsapp_user (
|
||||
mxid VARCHAR(255) PRIMARY KEY,
|
||||
jid VARCHAR(255) UNIQUE,
|
||||
|
||||
management_room VARCHAR(255),
|
||||
|
||||
client_id VARCHAR(255),
|
||||
client_token VARCHAR(255),
|
||||
server_token VARCHAR(255),
|
||||
enc_key BLOB,
|
||||
mac_key BLOB
|
||||
)`)
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
func (uq *UserQuery) New() *User {
|
||||
|
|
Loading…
Reference in a new issue