Add birthdays.
This commit is contained in:
parent
3086da9284
commit
93f39c7bf8
1 changed files with 10 additions and 2 deletions
|
|
@ -20,8 +20,9 @@ type Database struct {
|
|||
db *sqlx.DB
|
||||
conf *settings.Settings
|
||||
|
||||
chats *ChatModel
|
||||
verses *VerseModel
|
||||
birthdays *BirthdayModel
|
||||
chats *ChatModel
|
||||
verses *VerseModel
|
||||
}
|
||||
|
||||
func OpenDatabase(ctx context.Context, conf *settings.Settings) *Database {
|
||||
|
|
@ -59,6 +60,13 @@ func (d *Database) Migrate(migrations vfs.VFS) error {
|
|||
return migrator.Up()
|
||||
}
|
||||
|
||||
func (d *Database) Birthdays() *BirthdayModel {
|
||||
if d.birthdays == nil {
|
||||
d.birthdays = NewBirthdayModel(d.ctx, d.db)
|
||||
}
|
||||
return d.birthdays
|
||||
}
|
||||
|
||||
func (d *Database) Chats() *ChatModel {
|
||||
if d.chats == nil {
|
||||
return NewChatModel(d.ctx, d.db)
|
||||
|
|
|
|||
Loading…
Reference in a new issue