diff options
| -rw-r--r-- | .dockerignore | 1 | ||||
| -rw-r--r-- | documentation/er-model.pdf | bin | 0 -> 142284 bytes | |||
| -rw-r--r-- | migrations/20241106161637_tagredesign.sql | 13 | ||||
| -rw-r--r-- | src/db/gametag.rs | 5 | ||||
| -rw-r--r-- | src/db/mod.rs | 4 | ||||
| -rw-r--r-- | src/db/producttag.rs (renamed from src/db/storytag.rs) | 4 | ||||
| -rw-r--r-- | src/db/tooltag.rs | 5 |
7 files changed, 17 insertions, 15 deletions
diff --git a/.dockerignore b/.dockerignore index c3e7034..fc04251 100644 --- a/.dockerignore +++ b/.dockerignore @@ -2,3 +2,4 @@ target/ .git/ .env *.db +documentation/ diff --git a/documentation/er-model.pdf b/documentation/er-model.pdf Binary files differnew file mode 100644 index 0000000..2a6d49c --- /dev/null +++ b/documentation/er-model.pdf diff --git a/migrations/20241106161637_tagredesign.sql b/migrations/20241106161637_tagredesign.sql new file mode 100644 index 0000000..c33cec3 --- /dev/null +++ b/migrations/20241106161637_tagredesign.sql @@ -0,0 +1,13 @@ +DROP TABLE IF EXISTS storytag; +DROP TABLE IF EXISTS gametag; +DROP TABLE IF EXISTS tooltag; + +CREATE TABLE IF NOT EXISTS producttag +( + pid INTEGER NOT NULL, + tid INTEGER NOT NULL, + FOREIGN KEY (pid) REFERENCES product(id), + FOREIGN KEY (tid) REFERENCES tag(id), + PRIMARY KEY (pid, tid) +); + diff --git a/src/db/gametag.rs b/src/db/gametag.rs deleted file mode 100644 index 335d2a4..0000000 --- a/src/db/gametag.rs +++ /dev/null @@ -1,5 +0,0 @@ -#[derive(Debug, serde::Serialize, sqlx::FromRow)] -pub struct Gametag { - pub gid: i64, - pub tgid: i64, -} diff --git a/src/db/mod.rs b/src/db/mod.rs index 0b310c6..7050527 100644 --- a/src/db/mod.rs +++ b/src/db/mod.rs @@ -4,13 +4,11 @@ use crate::error::AppError; use async_trait::async_trait; pub mod game; -pub mod gametag; pub mod product; +pub mod producttag; pub mod story; -pub mod storytag; pub mod tag; pub mod tool; -pub mod tooltag; #[async_trait] pub trait ProductDatabaseHandler { diff --git a/src/db/storytag.rs b/src/db/producttag.rs index 0953fc2..b3091c3 100644 --- a/src/db/storytag.rs +++ b/src/db/producttag.rs @@ -1,5 +1,5 @@ #[derive(Debug, serde::Serialize, sqlx::FromRow)] pub struct Storytag { - pub sid: i64, - pub tgid: i64, + pub pid: i64, + pub tid: i64, } diff --git a/src/db/tooltag.rs b/src/db/tooltag.rs deleted file mode 100644 index 393e687..0000000 --- a/src/db/tooltag.rs +++ /dev/null @@ -1,5 +0,0 @@ -#[derive(Debug, serde::Serialize, sqlx::FromRow)] -pub struct Tooltag { - pub tid: i64, - pub tgid: i64, -} |
