diff --git a/packages/api/src/entity/newsletter_email.ts b/packages/api/src/entity/newsletter_email.ts index 707dcf379..312cc6b14 100644 --- a/packages/api/src/entity/newsletter_email.ts +++ b/packages/api/src/entity/newsletter_email.ts @@ -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 } diff --git a/packages/api/src/entity/subscription.ts b/packages/api/src/entity/subscription.ts index 10416a551..2b240e8e5 100644 --- a/packages/api/src/entity/subscription.ts +++ b/packages/api/src/entity/subscription.ts @@ -76,4 +76,10 @@ export class Subscription { @Column('boolean') autoAddToLibrary?: boolean | null + + @Column('boolean') + fetchContent!: boolean + + @Column('text') + folder!: string } diff --git a/packages/db/migrations/0149.do.add_fetch_content_to_subscriptions.sql b/packages/db/migrations/0149.do.add_fetch_content_to_subscriptions.sql new file mode 100755 index 000000000..66bd1f373 --- /dev/null +++ b/packages/db/migrations/0149.do.add_fetch_content_to_subscriptions.sql @@ -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; diff --git a/packages/db/migrations/0149.undo.add_fetch_content_to_subscriptions.sql b/packages/db/migrations/0149.undo.add_fetch_content_to_subscriptions.sql new file mode 100755 index 000000000..5fad9146c --- /dev/null +++ b/packages/db/migrations/0149.undo.add_fetch_content_to_subscriptions.sql @@ -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;