Skip to content

Commit

Permalink
feat: add tags commands
Browse files Browse the repository at this point in the history
  • Loading branch information
melothemarten committed Oct 5, 2024
1 parent 06c2b52 commit 183b522
Show file tree
Hide file tree
Showing 6 changed files with 700 additions and 4 deletions.
7 changes: 4 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@ shuttle-shared-db = { version = "0.47.0", features = ["postgres", "sqlx"] }
poise = "0.6"
anyhow = "1.0"
tokio = "1.28"
tracing = "0.1.37"
tracing = "0.1"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
sqlx = { version = "0.7.0", features = ["runtime-tokio-native-tls", "postgres", "macros"] }
sqlx = { version = "0.7", features = ["runtime-tokio-native-tls", "postgres", "macros"] }
reqwest = { version = "0.11", default-features = false, features = ["json", "rustls-tls"] }
image = { version = "0.24", default-features = false, features = ["png"] } # get a better computer meme rendering
imageproc = { version = "0.23", default-features = false } # get a better computer meme rendering
rusttype = { version = "0.9", default-features = false } # interact with imageproc
rand = "0.8.5"
syn = { version = "2.0.68", features = ["full"] }
itertools = "0.12.0"
syn = { version = "2.0", features = ["full"] }
chrono = "0.4"
18 changes: 18 additions & 0 deletions migrations/0001_init.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
CREATE TABLE IF NOT EXISTS tags
(
name TEXT PRIMARY KEY,
content BIGINT NOT NULL,
creator_user_id BIGINT NOT NULL,
last_editor_user_id TEXT,
creation_date TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
last_edit_date TIMESTAMPTZ,
times_used INT DEFAULT 0,
restricted BOOLEAN DEFAULT FALSE
);

CREATE TABLE IF NOT EXISTS tag_aliases
(
alias TEXT PRIMARY KEY,
tag_name TEXT NOT NULL,
FOREIGN KEY (tag_name) REFERENCES tags (name) ON DELETE CASCADE
);
1 change: 1 addition & 0 deletions src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ pub mod crates;
pub mod godbolt;
pub mod modmail;
pub mod playground;
pub mod tags;
pub mod thread_pin;
pub mod utilities;
Loading

0 comments on commit 183b522

Please sign in to comment.