From b153fa8b3cd2e48bbe13326695f11d2013427ebc Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Mon, 18 Dec 2017 20:52:46 -0800 Subject: Add Wallabag integration --- storage/integration.go | 30 +++++++++++++++++++++++++++--- storage/migration.go | 2 +- 2 files changed, 28 insertions(+), 4 deletions(-) (limited to 'storage') diff --git a/storage/integration.go b/storage/integration.go index 6d89a68..779ca81 100644 --- a/storage/integration.go +++ b/storage/integration.go @@ -47,7 +47,13 @@ func (s *Storage) Integration(userID int64) (*model.Integration, error) { fever_enabled, fever_username, fever_password, - fever_token + fever_token, + wallabag_enabled, + wallabag_url, + wallabag_client_id, + wallabag_client_secret, + wallabag_username, + wallabag_password FROM integrations WHERE user_id=$1 ` @@ -65,6 +71,12 @@ func (s *Storage) Integration(userID int64) (*model.Integration, error) { &integration.FeverUsername, &integration.FeverPassword, &integration.FeverToken, + &integration.WallabagEnabled, + &integration.WallabagURL, + &integration.WallabagClientID, + &integration.WallabagClientSecret, + &integration.WallabagUsername, + &integration.WallabagPassword, ) switch { case err == sql.ErrNoRows: @@ -90,8 +102,14 @@ func (s *Storage) UpdateIntegration(integration *model.Integration) error { fever_enabled=$8, fever_username=$9, fever_password=$10, - fever_token=$11 - WHERE user_id=$12 + fever_token=$11, + wallabag_enabled=$12, + wallabag_url=$13, + wallabag_client_id=$14, + wallabag_client_secret=$15, + wallabag_username=$16, + wallabag_password=$17 + WHERE user_id=$18 ` _, err := s.db.Exec( query, @@ -106,6 +124,12 @@ func (s *Storage) UpdateIntegration(integration *model.Integration) error { integration.FeverUsername, integration.FeverPassword, integration.FeverToken, + integration.WallabagEnabled, + integration.WallabagURL, + integration.WallabagClientID, + integration.WallabagClientSecret, + integration.WallabagUsername, + integration.WallabagPassword, integration.UserID, ) diff --git a/storage/migration.go b/storage/migration.go index d29c76d..0408330 100644 --- a/storage/migration.go +++ b/storage/migration.go @@ -12,7 +12,7 @@ import ( "github.com/miniflux/miniflux/sql" ) -const schemaVersion = 10 +const schemaVersion = 11 // Migrate run database migrations. func (s *Storage) Migrate() { -- cgit v1.2.3