Added preliminary announcement code.
This commit is contained in:
parent
84e624a91b
commit
3fafe8455a
4 changed files with 95 additions and 12 deletions
|
|
@ -20,9 +20,10 @@ type Database struct {
|
|||
db *sqlx.DB
|
||||
conf *settings.Settings
|
||||
|
||||
birthdays *BirthdayModel
|
||||
chats *ChatModel
|
||||
verses *VerseModel
|
||||
announcements *AnnouncementModel
|
||||
birthdays *BirthdayModel
|
||||
chats *ChatModel
|
||||
verses *VerseModel
|
||||
}
|
||||
|
||||
func OpenDatabase(ctx context.Context, conf *settings.Settings) *Database {
|
||||
|
|
@ -60,6 +61,13 @@ func (d *Database) Migrate(migrations vfs.VFS) error {
|
|||
return migrator.Up()
|
||||
}
|
||||
|
||||
func (d *Database) Announcements() *AnnouncementModel {
|
||||
if d.announcements == nil {
|
||||
d.announcements = NewAnnouncementModel(d.ctx, d.db)
|
||||
}
|
||||
return d.announcements
|
||||
}
|
||||
|
||||
func (d *Database) Birthdays() *BirthdayModel {
|
||||
if d.birthdays == nil {
|
||||
d.birthdays = NewBirthdayModel(d.ctx, d.db)
|
||||
|
|
|
|||
Loading…
Reference in a new issue