add fetch_content and folder column to the subscriptions table and folder column to newsletter_emails table

This commit is contained in:
Hongbo Wu
2023-12-14 15:41:54 +08:00
parent 6d0dcee488
commit d67b974367
4 changed files with 47 additions and 0 deletions

View File

@ -34,4 +34,13 @@ export class NewsletterEmail {
@OneToMany(() => Subscription, (subscription) => subscription.newsletterEmail)
subscriptions!: Subscription[]
@Column('text')
folder!: string
@Column('text')
name?: string | null
@Column('text')
description?: string | null
}

View File

@ -76,4 +76,10 @@ export class Subscription {
@Column('boolean')
autoAddToLibrary?: boolean | null
@Column('boolean')
fetchContent!: boolean
@Column('text')
folder!: string
}

View File

@ -0,0 +1,16 @@
-- Type: DO
-- Name: add_fetch_content_to_subscriptions
-- Description: Add fetch_content column to subscriptions tables
BEGIN;
ALTER TABLE omnivore.subscriptions
ADD COLUMN fetch_content BOOLEAN NOT NULL DEFAULT TRUE,
ADD COLUMN folder TEXT NOT NULL DEFAULT 'following';
ALTER TABLE omnivore.newsletter_emails
ADD COLUMN name TEXT,
ADD COLUMN description TEXT,
ADD COLUMN folder TEXT NOT NULL DEFAULT 'inbox';
COMMIT;

View File

@ -0,0 +1,16 @@
-- Type: UNDO
-- Name: add_fetch_content_to_subscriptions
-- Description: Add fetch_content column to subscriptions tables
BEGIN;
ALTER TABLE omnivore.subscriptions
DROP COLUMN fetch_content,
DROP COLUMN folder;
ALTER TABLE omnivore.newsletter_emails
DROP COLUMN name,
DROP COLUMN description,
DROP COLUMN folder;
COMMIT;