aboutsummaryrefslogtreecommitdiffhomepage
path: root/storage
diff options
context:
space:
mode:
authorGravatar Allan Reyes <allanbreyes@users.noreply.github.com>2018-05-20 13:31:56 -0700
committerGravatar Frédéric Guillot <fred@kanboard.net>2018-05-20 13:31:56 -0700
commit0f3f5e442f81d37a03618d0df5ea8f0524a24029 (patch)
treecdd430707b2eeafa436784d382e531fa699208e9 /storage
parentf19ab21b7d7dcddb3de0536c272cb22d581eb8d7 (diff)
Add Pocket integration
Diffstat (limited to 'storage')
-rw-r--r--storage/integration.go20
-rw-r--r--storage/migration.go2
2 files changed, 17 insertions, 5 deletions
diff --git a/storage/integration.go b/storage/integration.go
index 6a389de..5a7ef19 100644
--- a/storage/integration.go
+++ b/storage/integration.go
@@ -70,7 +70,10 @@ func (s *Storage) Integration(userID int64) (*model.Integration, error) {
wallabag_password,
nunux_keeper_enabled,
nunux_keeper_url,
- nunux_keeper_api_key
+ nunux_keeper_api_key,
+ pocket_enabled,
+ pocket_access_token,
+ pocket_consumer_key
FROM integrations
WHERE user_id=$1
`
@@ -97,6 +100,9 @@ func (s *Storage) Integration(userID int64) (*model.Integration, error) {
&integration.NunuxKeeperEnabled,
&integration.NunuxKeeperURL,
&integration.NunuxKeeperAPIKey,
+ &integration.PocketEnabled,
+ &integration.PocketAccessToken,
+ &integration.PocketConsumerKey,
)
switch {
case err == sql.ErrNoRows:
@@ -131,8 +137,11 @@ func (s *Storage) UpdateIntegration(integration *model.Integration) error {
wallabag_password=$17,
nunux_keeper_enabled=$18,
nunux_keeper_url=$19,
- nunux_keeper_api_key=$20
- WHERE user_id=$21
+ nunux_keeper_api_key=$20,
+ pocket_enabled=$21,
+ pocket_access_token=$22,
+ pocket_consumer_key=$23
+ WHERE user_id=$24
`
_, err := s.db.Exec(
query,
@@ -156,6 +165,9 @@ func (s *Storage) UpdateIntegration(integration *model.Integration) error {
integration.NunuxKeeperEnabled,
integration.NunuxKeeperURL,
integration.NunuxKeeperAPIKey,
+ integration.PocketEnabled,
+ integration.PocketAccessToken,
+ integration.PocketConsumerKey,
integration.UserID,
)
@@ -182,7 +194,7 @@ func (s *Storage) HasSaveEntry(userID int64) (result bool) {
query := `
SELECT true FROM integrations
WHERE user_id=$1 AND
- (pinboard_enabled='t' OR instapaper_enabled='t' OR wallabag_enabled='t' OR nunux_keeper_enabled='t')
+ (pinboard_enabled='t' OR instapaper_enabled='t' OR wallabag_enabled='t' OR nunux_keeper_enabled='t' OR pocket_enabled='t')
`
if err := s.db.QueryRow(query, userID).Scan(&result); err != nil {
diff --git a/storage/migration.go b/storage/migration.go
index d7d40e8..ab44d17 100644
--- a/storage/migration.go
+++ b/storage/migration.go
@@ -12,7 +12,7 @@ import (
"github.com/miniflux/miniflux/sql"
)
-const schemaVersion = 16
+const schemaVersion = 17
// Migrate run database migrations.
func (s *Storage) Migrate() {