2024-04-26 16:02:36 -07:00
|
|
|
-- +goose Up
|
|
|
|
-- +goose StatementBegin
|
|
|
|
SELECT 'up SQL query';
|
|
|
|
CREATE TABLE Articles (
|
|
|
|
ID INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
|
|
CreatedAt DATETIME NOT NULL,
|
2024-04-27 07:44:04 -07:00
|
|
|
UpdatedAt DATETIME NOT NULL,
|
2024-04-28 10:02:57 -07:00
|
|
|
DeletedAt DATETIME NOT NULL,
|
2024-04-26 16:02:36 -07:00
|
|
|
SourceId NUMBER NOT NULL,
|
|
|
|
Tags TEXT NOT NULL,
|
|
|
|
Title TEXT NOT NULL,
|
|
|
|
Url TEXT NOT NULL,
|
|
|
|
PubDate DATETIME NOT NULL,
|
2024-04-27 07:44:04 -07:00
|
|
|
IsVideo TEXT NOT NULL,
|
|
|
|
ThumbnailUrl TEXT NOT NULL,
|
2024-04-26 16:02:36 -07:00
|
|
|
Description TEXT NOT NULL,
|
2024-04-27 07:44:04 -07:00
|
|
|
AuthorName TEXT NOT NULL,
|
|
|
|
AuthorImageUrl TEXT NOT NULL
|
2024-04-26 16:02:36 -07:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE Table DiscordQueue (
|
|
|
|
ID INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
|
|
CreatedAt DATETIME NOT NULL,
|
|
|
|
UpdatedAt DATETIME NOT NULL,
|
|
|
|
DeletedAt DATETIME,
|
|
|
|
ArticleId NUMBER NOT NULL,
|
|
|
|
SourceId NUMBER NOT NULL
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE Table DiscordWebHooks (
|
|
|
|
ID INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
|
|
CreatedAt DATETIME NOT NULL,
|
|
|
|
UpdatedAt DATETIME NOT NULL,
|
2024-04-28 10:02:57 -07:00
|
|
|
DeletedAt DATETIME NOT NULL,
|
2024-05-02 17:39:07 -07:00
|
|
|
UserID INTEGER NOT NULL,
|
2024-04-26 16:02:36 -07:00
|
|
|
--Name TEXT NOT NULL, -- Defines webhook purpose
|
|
|
|
--Key TEXT,
|
|
|
|
Url TEXT NOT NULL, -- Webhook Url
|
2024-04-28 10:02:57 -07:00
|
|
|
Server TEXT NOT NULL, -- Defines the server its bound it. Used for reference
|
|
|
|
Channel TEXT NOT NULL, -- Defines the channel its bound to. Used for reference
|
2024-04-26 16:02:36 -07:00
|
|
|
Enabled BOOLEAN NOT NULL
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE Table Icons (
|
|
|
|
ID INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
|
|
CreatedAt DATETIME NOT NULL,
|
|
|
|
UpdatedAt DATETIME NOT NULL,
|
|
|
|
DeletedAt DATETIME,
|
|
|
|
FileName TEXT NOT NULL,
|
|
|
|
Site TEXT NOT NULL
|
|
|
|
);
|
|
|
|
|
|
|
|
Create Table Settings (
|
|
|
|
ID INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
|
|
CreatedAt DATETIME NOT NULL,
|
|
|
|
UpdatedAt DATETIME NOT NULL,
|
|
|
|
DeletedAt DATETIME,
|
|
|
|
Key TEXT NOT NULL, -- How you search for a entry
|
|
|
|
Value TEXT NOT NULL, -- The value for one
|
|
|
|
Options TEXT -- any notes about the entry
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE Table Sources (
|
|
|
|
ID INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
|
|
CreatedAt DATETIME NOT NULL,
|
|
|
|
UpdatedAt DATETIME NOT NULL,
|
2024-04-28 10:02:57 -07:00
|
|
|
DeletedAt DATETIME NOT NULL,
|
|
|
|
DisplayName TEXT NOT NULL, -- Vanity name
|
|
|
|
Source TEXT NOT NULL, -- Defines the service that will use this record. IE reddit or youtube
|
2024-04-26 16:02:36 -07:00
|
|
|
Enabled BOOLEAN NOT NULL,
|
|
|
|
Url TEXT NOT NULL,
|
|
|
|
Tags TEXT NOT NULL
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE Subscriptions (
|
|
|
|
ID INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
|
|
CreatedAt DATETIME NOT NULL,
|
|
|
|
UpdatedAt DATETIME NOT NULL,
|
|
|
|
DeletedAt DATETIME,
|
2024-05-02 17:39:07 -07:00
|
|
|
DiscordWebHookID NUMBER NOT NULL,
|
|
|
|
SourceID NUMBER NOT NULL,
|
|
|
|
UserID NUMBER NOT NULL
|
2024-04-26 16:02:36 -07:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE Users (
|
|
|
|
ID INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
|
|
CreatedAt DATETIME NOT NULL,
|
|
|
|
UpdatedAt DATETIME NOT NULL,
|
|
|
|
DeletedAt DATETIME,
|
|
|
|
Name TEXT NOT NULL,
|
|
|
|
Hash TEXT NOT NULL,
|
|
|
|
Scopes TEXT NOT NULL
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE RefreshTokens (
|
|
|
|
ID INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
|
|
CreatedAt DATETIME NOT NULL,
|
|
|
|
UpdatedAt DATETIME NOT NULL,
|
|
|
|
DeletedAt DATETIME,
|
|
|
|
Username TEXT NOT NULL,
|
|
|
|
Token TEXT NOT NULL
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
-- +goose StatementEnd
|
|
|
|
|
|
|
|
-- +goose Down
|
|
|
|
-- +goose StatementBegin
|
|
|
|
Drop Table Articles;
|
|
|
|
Drop Table DiscordQueue;
|
|
|
|
Drop Table DiscordWebHooks;
|
|
|
|
Drop Table Icons;
|
|
|
|
Drop Table Settings;
|
|
|
|
Drop Table Sources;
|
|
|
|
DROP TABLE Subscriptions;
|
|
|
|
DROP TABLE Users;
|
|
|
|
DROP TABLE RefreshTokens;
|
|
|
|
-- +goose StatementEnd
|