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 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
|
|
|
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
|
|
|
|
);
|
|
|
|
|
2024-05-04 11:58:10 -07:00
|
|
|
CREATE TABLE UserSourceSubscriptions (
|
|
|
|
ID INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
|
|
CreatedAt DATETIME NOT NULL,
|
|
|
|
UpdatedAt DATETIME NOT NULL,
|
|
|
|
DeletedAt DATETIME NOT NULL,
|
|
|
|
UserID NUMBER NOT NULL,
|
|
|
|
SourceID NUMBER NOT NULL
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE AlertDiscord (
|
|
|
|
ID INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
|
|
CreatedAt DATETIME NOT NULL,
|
|
|
|
UpdatedAt DATETIME NOT NULL,
|
|
|
|
DeletedAt DATETIME NOT NULL,
|
|
|
|
UserID NUMBER NOT NULL,
|
|
|
|
SourceID NUMBER NOT NULL,
|
|
|
|
DiscordWebHookID 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,
|
2024-05-05 10:02:17 -07:00
|
|
|
DeletedAt DATETIME NOT NULL,
|
2024-04-26 16:02:36 -07:00
|
|
|
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,
|
2024-05-05 10:02:17 -07:00
|
|
|
DeletedAt DATETIME NOT NULL,
|
2024-04-26 16:02:36 -07:00
|
|
|
Username TEXT NOT NULL,
|
|
|
|
Token TEXT NOT NULL
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
-- +goose StatementEnd
|
|
|
|
|
|
|
|
-- +goose Down
|
|
|
|
-- +goose StatementBegin
|
2024-05-05 10:02:17 -07:00
|
|
|
DROP TABLE AlertDiscord;
|
2024-04-26 16:02:36 -07:00
|
|
|
Drop Table Articles;
|
|
|
|
Drop Table DiscordWebHooks;
|
|
|
|
Drop Table Icons;
|
2024-05-05 10:02:17 -07:00
|
|
|
DROP TABLE RefreshTokens;
|
2024-04-26 16:02:36 -07:00
|
|
|
Drop Table Sources;
|
|
|
|
DROP TABLE Users;
|
2024-05-05 10:02:17 -07:00
|
|
|
DROP TABLE UserSourceSubscriptions;
|
2024-04-26 16:02:36 -07:00
|
|
|
-- +goose StatementEnd
|