Skip to content

Commit

Permalink
SeaORM Migration CLI (#4)
Browse files Browse the repository at this point in the history
* this stinks

* wow im in pain from that
  • Loading branch information
aaronleopold authored Feb 17, 2022
1 parent f4e4568 commit cd85b5e
Show file tree
Hide file tree
Showing 46 changed files with 540 additions and 292 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
"server:build:docker-debian": "echo 'FIXME: I AM BROKEN --> run the following in /server: docker build -f Dockerfile.debian -t stump-deb .'",
"server:build:docker-alpine": "cd server && docker build -f Dockerfile.alpine -t stump .",
"server:check": "cd server && cargo check",
"server:migrate-up": "cd server && sea-orm-cli migrate up",
"server:migrate-down": "cd server && sea-orm-cli migrate down",
"server:fmt": "cargo fmt --all --manifest-path=server/Cargo.toml",
"frontend:install": "cd frontend && pnpm install",
"frontend:start": "cd frontend && pnpm run start",
Expand Down
165 changes: 121 additions & 44 deletions server/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[workspace]
members = [".", "entity", "migration"]

[dependencies]
rocket = { version = "0.5.0-rc.1", features = ["json" ] }
sea-orm = { version = "0.6.0", features = [ "sqlx-sqlite", "runtime-async-std-native-tls" ] }
serde = { version = "1.0", features = ["derive"] }
log = "0.4.0"
env_logger = "0.8.4"
anyhow = "1.0.52"
Expand All @@ -29,6 +30,9 @@ epub = "1.2.3"
rocket-session-store = "0.1.0"
bcrypt = "0.10.1"
rocket_cors = "0.6.0-alpha1"
dotenv = "0.15.0"
entity = { path = "entity" }
migration = { path = "migration" }
# FIXME: introduced MAJOR compilation issues
#pdf = { git = "https://github.com/pdf-rs/pdf" }
#pdf_render = { git = "https://github.com/pdf-rs/pdf_render" }
Expand Down
26 changes: 26 additions & 0 deletions server/entity/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[package]
name = "entity"
version = "0.1.0"
edition = "2021"
publish = false

[lib]
name = "entity"
path = "src/lib.rs"

[dependencies]
chrono = "0.4.19"
rocket = { version = "0.5.0-rc.1", features = [
"json",
] }

[dependencies.sea-orm]
version = "^0.6.0"
features = [
"macros",
"runtime-tokio-native-tls",
# "sqlx-postgres",
# "sqlx-mysql",
"sqlx-sqlite"
]
default-features = false
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
#[macro_use]
extern crate rocket;

pub mod library;
pub mod log;
pub mod media;
pub mod read_progress;
pub mod series;
pub mod server_preferences;
pub mod user;

pub mod util;

pub use sea_orm;
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use rocket::serde::{Deserialize, Serialize};
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};

use crate::fs::FileStatus;
use crate::util::FileStatus;

#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
#[serde(crate = "rocket::serde")]
Expand Down
Loading

0 comments on commit cd85b5e

Please sign in to comment.