James Tombleson
713205bb03
* basic routes are working with db context * swagger is working along with swag gen * cron was updated with a class and better db context, untested though * sourcelist command added * lost the pg package but added it back * Updated the api startup for cron and api * updated source routes and started to add article routes * Updated cron add func calls * updated swagger * keeping articles basic for now as I dont need to pull them in yet * swagger update * added getarticlesbysourceid call * adding the subscriptions table to track who to send notifications and where * removed legacy columns from discordwebhooks that are no longer needed. * added discord webhook routes * updated routes * Minor change to schema * Updated routes to support subscriptions * ignore .vscode
61 lines
1.5 KiB
SQL
61 lines
1.5 KiB
SQL
CREATE TABLE Articles (
|
|
ID uuid PRIMARY KEY,
|
|
SourceId uuid NOT null,
|
|
Tags TEXT NOT NULL,
|
|
Title TEXT NOT NULL,
|
|
Url TEXT NOT NULL,
|
|
PubDate timestamp NOT NULL,
|
|
Video TEXT,
|
|
VideoHeight int NOT NULL,
|
|
VideoWidth int NOT NULL,
|
|
Thumbnail TEXT NOT NULL,
|
|
Description TEXT NOT NULL,
|
|
AuthorName TEXT,
|
|
AuthorImage TEXT
|
|
);
|
|
|
|
CREATE Table DiscordQueue (
|
|
ID uuid PRIMARY KEY,
|
|
ArticleId uuid NOT NULL
|
|
);
|
|
|
|
CREATE Table DiscordWebHooks (
|
|
ID uuid PRIMARY KEY,
|
|
Url TEXT NOT NULL, -- Webhook Url
|
|
Server TEXT NOT NULL, -- Defines the server its bound it. Used for refrence
|
|
Channel TEXT NOT NULL, -- Defines the channel its bound to. Used for refrence
|
|
Enabled BOOLEAN NOT NULL
|
|
);
|
|
|
|
CREATE Table Icons (
|
|
ID uuid PRIMARY Key,
|
|
FileName TEXT NOT NULL,
|
|
Site TEXT NOT NULL
|
|
);
|
|
|
|
Create Table Settings (
|
|
ID uuid PRIMARY Key,
|
|
Key TEXT NOT NULL,
|
|
Value TEXT NOT NULL,
|
|
Options TEXT
|
|
);
|
|
|
|
Create Table Sources (
|
|
ID uuid PRIMARY Key,
|
|
Site TEXT NOT NULL, -- Vanity name
|
|
Name TEXT NOT NULL, -- Defines the name of the source. IE: dadjokes
|
|
Source TEXT NOT NULL, -- Defines the service that will use this reocrd. IE reddit or youtube
|
|
Type TEXT NOT NULL, -- Defines what kind of feed this is. feed, user, tag
|
|
Value TEXT,
|
|
Enabled BOOLEAN NOT NULL,
|
|
Url TEXT NOT NULL,
|
|
Tags TEXT NOT NULL
|
|
);
|
|
|
|
/* This table is used to track what the Web Hook wants to have sent by Source */;
|
|
Create TABLE Subscriptions (
|
|
ID uuid Primary Key,
|
|
DiscordWebHookID uuid Not Null,
|
|
SourceID uuid Not Null
|
|
);
|