diff --git a/examples/leptos-0.7-ssr/Cargo.toml b/examples/leptos-0.7-ssr/Cargo.toml index 03c54905..d5c3e6f7 100644 --- a/examples/leptos-0.7-ssr/Cargo.toml +++ b/examples/leptos-0.7-ssr/Cargo.toml @@ -14,8 +14,6 @@ hydrate = [ ] ssr = [ "dep:roadster", - "dep:leptos-7-example-entity", - "dep:leptos-7-example-migration", "dep:axum", "dep:tokio", "dep:tokio-util", @@ -27,7 +25,7 @@ ssr = [ ] [dependencies] -roadster = { version = "0.6", path = "../..", optional = true, default-features = false, features = ["http", "db-sql", "cli"] } +roadster = { version = "0.6", path = "../..", optional = true, default-features = false, features = ["http", "cli"] } tokio = { workspace = true, optional = true } tokio-util = { workspace = true, optional = true } anyhow = { workspace = true } @@ -38,10 +36,6 @@ clap = { workspace = true } # Http API axum = { workspace = true, optional = true } -# DB -leptos-7-example-entity = { path = "entity", optional = true } -leptos-7-example-migration = { path = "migration", optional = true } - serde = { workspace = true, features = ["derive"] } # Leptos diff --git a/examples/leptos-0.7-ssr/README.md b/examples/leptos-0.7-ssr/README.md index 9a0a2c93..17f3605d 100644 --- a/examples/leptos-0.7-ssr/README.md +++ b/examples/leptos-0.7-ssr/README.md @@ -7,9 +7,6 @@ Feel free to explore the project structure, but the best place to start with you ## Running your project ```bash -# Start the database and redis (for sidekiq). Note: change the credentials when deploying to prod -docker run -d -p 5432:5432 -e POSTGRES_USER=roadster -e POSTGRES_DB=example_dev -e POSTGRES_PASSWORD=roadster postgres:15.3-alpine -docker run -d -p 6379:6379 redis:7.2-alpine # From the root Roadster directory, cd into the example dir cd examples/leptos-ssr # Run the app diff --git a/examples/leptos-0.7-ssr/entity/Cargo.toml b/examples/leptos-0.7-ssr/entity/Cargo.toml deleted file mode 100644 index 5119063d..00000000 --- a/examples/leptos-0.7-ssr/entity/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "leptos-7-example-entity" -version = "0.1.0" -edition = "2021" -publish = false - -[lib] -name = "entity" -path = "src/lib.rs" - -[dependencies] -sea-orm = { workspace = true } diff --git a/examples/leptos-0.7-ssr/entity/src/lib.rs b/examples/leptos-0.7-ssr/entity/src/lib.rs deleted file mode 100644 index 8b137891..00000000 --- a/examples/leptos-0.7-ssr/entity/src/lib.rs +++ /dev/null @@ -1 +0,0 @@ - diff --git a/examples/leptos-0.7-ssr/migration/Cargo.toml b/examples/leptos-0.7-ssr/migration/Cargo.toml deleted file mode 100644 index 0f3eb906..00000000 --- a/examples/leptos-0.7-ssr/migration/Cargo.toml +++ /dev/null @@ -1,22 +0,0 @@ -[package] -name = "leptos-7-example-migration" -version = "0.1.0" -edition = "2021" -publish = false - -[lib] -name = "migration" -path = "src/lib.rs" - -[dependencies] -tokio = { workspace = true } - -[dependencies.sea-orm-migration] -workspace = true -features = [ - # Enable at least one `ASYNC_RUNTIME` and `DATABASE_DRIVER` feature if you want to run migration via CLI. - # View the list of supported features at https://www.sea-ql.org/SeaORM/docs/install-and-config/database-and-async-runtime. - # e.g. - "runtime-tokio-rustls", # `ASYNC_RUNTIME` feature - "sqlx-postgres", # `DATABASE_DRIVER` feature -] diff --git a/examples/leptos-0.7-ssr/migration/README.md b/examples/leptos-0.7-ssr/migration/README.md deleted file mode 100644 index 3b438d89..00000000 --- a/examples/leptos-0.7-ssr/migration/README.md +++ /dev/null @@ -1,41 +0,0 @@ -# Running Migrator CLI - -- Generate a new migration file - ```sh - cargo run -- generate MIGRATION_NAME - ``` -- Apply all pending migrations - ```sh - cargo run - ``` - ```sh - cargo run -- up - ``` -- Apply first 10 pending migrations - ```sh - cargo run -- up -n 10 - ``` -- Rollback last applied migrations - ```sh - cargo run -- down - ``` -- Rollback last 10 applied migrations - ```sh - cargo run -- down -n 10 - ``` -- Drop all tables from the database, then reapply all migrations - ```sh - cargo run -- fresh - ``` -- Rollback all applied migrations, then reapply all migrations - ```sh - cargo run -- refresh - ``` -- Rollback all applied migrations - ```sh - cargo run -- reset - ``` -- Check the status of all migrations - ```sh - cargo run -- status - ``` diff --git a/examples/leptos-0.7-ssr/migration/src/lib.rs b/examples/leptos-0.7-ssr/migration/src/lib.rs deleted file mode 100644 index 2c605afb..00000000 --- a/examples/leptos-0.7-ssr/migration/src/lib.rs +++ /dev/null @@ -1,12 +0,0 @@ -pub use sea_orm_migration::prelude::*; - -mod m20220101_000001_create_table; - -pub struct Migrator; - -#[async_trait::async_trait] -impl MigratorTrait for Migrator { - fn migrations() -> Vec> { - vec![Box::new(m20220101_000001_create_table::Migration)] - } -} diff --git a/examples/leptos-0.7-ssr/migration/src/m20220101_000001_create_table.rs b/examples/leptos-0.7-ssr/migration/src/m20220101_000001_create_table.rs deleted file mode 100644 index 02dab03a..00000000 --- a/examples/leptos-0.7-ssr/migration/src/m20220101_000001_create_table.rs +++ /dev/null @@ -1,15 +0,0 @@ -use sea_orm_migration::prelude::*; - -#[derive(DeriveMigrationName)] -pub struct Migration; - -#[async_trait::async_trait] -impl MigrationTrait for Migration { - async fn up(&self, _manager: &SchemaManager) -> Result<(), DbErr> { - Ok(()) - } - - async fn down(&self, _manager: &SchemaManager) -> Result<(), DbErr> { - Ok(()) - } -} diff --git a/examples/leptos-0.7-ssr/migration/src/main.rs b/examples/leptos-0.7-ssr/migration/src/main.rs deleted file mode 100644 index f054deaf..00000000 --- a/examples/leptos-0.7-ssr/migration/src/main.rs +++ /dev/null @@ -1,6 +0,0 @@ -use sea_orm_migration::prelude::*; - -#[tokio::main] -async fn main() { - cli::run_cli(migration::Migrator).await; -} diff --git a/examples/leptos-0.7-ssr/src/server/mod.rs b/examples/leptos-0.7-ssr/src/server/mod.rs index 30953a24..533028c5 100644 --- a/examples/leptos-0.7-ssr/src/server/mod.rs +++ b/examples/leptos-0.7-ssr/src/server/mod.rs @@ -5,7 +5,6 @@ use async_trait::async_trait; use axum::Router; use leptos::prelude::*; use leptos_axum::{generate_route_list, LeptosRoutes}; -use migration::Migrator; use roadster::app::context::AppContext; use roadster::app::metadata::AppMetadata; use roadster::app::App as RoadsterApp; @@ -23,7 +22,6 @@ pub struct Server; #[async_trait] impl RoadsterApp for Server { type Cli = crate::cli::AppCli; - type M = Migrator; fn metadata(&self, _config: &AppConfig) -> RoadsterResult { Ok(AppMetadata::builder() diff --git a/examples/leptos-ssr/Cargo.toml b/examples/leptos-ssr/Cargo.toml index a4a40dc9..14cd5621 100644 --- a/examples/leptos-ssr/Cargo.toml +++ b/examples/leptos-ssr/Cargo.toml @@ -10,8 +10,6 @@ publish = false hydrate = ["leptos/hydrate", "leptos_meta/hydrate", "leptos_router/hydrate"] ssr = [ "dep:roadster", - "dep:leptos-example-entity", - "dep:leptos-example-migration", "dep:axum", "dep:tokio", "dep:tokio-util", @@ -25,7 +23,7 @@ ssr = [ ] [dependencies] -roadster = { version = "0.6", path = "../..", optional = true, default-features = false, features = ["http", "db-sql", "cli"] } +roadster = { version = "0.6", path = "../..", optional = true, default-features = false, features = ["http", "cli"] } tokio = { workspace = true, optional = true } tokio-util = { workspace = true, optional = true } anyhow = { workspace = true } @@ -36,10 +34,6 @@ clap = { workspace = true } # Http API axum = { workspace = true, optional = true } -# DB -leptos-example-entity = { path = "entity", optional = true } -leptos-example-migration = { path = "migration", optional = true } - serde = { workspace = true, features = ["derive"] } # Leptos diff --git a/examples/leptos-ssr/README.md b/examples/leptos-ssr/README.md index fe802357..f6b1e10b 100644 --- a/examples/leptos-ssr/README.md +++ b/examples/leptos-ssr/README.md @@ -7,9 +7,6 @@ Feel free to explore the project structure, but the best place to start with you ## Running your project ```bash -# Start the database and redis (for sidekiq). Note: change the credentials when deploying to prod -docker run -d -p 5432:5432 -e POSTGRES_USER=roadster -e POSTGRES_DB=example_dev -e POSTGRES_PASSWORD=roadster postgres:15.3-alpine -docker run -d -p 6379:6379 redis:7.2-alpine # From the root Roadster directory, cd into the example dir cd examples/leptos-ssr # Run the app diff --git a/examples/leptos-ssr/entity/Cargo.toml b/examples/leptos-ssr/entity/Cargo.toml deleted file mode 100644 index e1f05284..00000000 --- a/examples/leptos-ssr/entity/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "leptos-example-entity" -version = "0.1.0" -edition = "2021" -publish = false - -[lib] -name = "entity" -path = "src/lib.rs" - -[dependencies] -sea-orm = { workspace = true } diff --git a/examples/leptos-ssr/entity/src/lib.rs b/examples/leptos-ssr/entity/src/lib.rs deleted file mode 100644 index 8b137891..00000000 --- a/examples/leptos-ssr/entity/src/lib.rs +++ /dev/null @@ -1 +0,0 @@ - diff --git a/examples/leptos-ssr/migration/Cargo.toml b/examples/leptos-ssr/migration/Cargo.toml deleted file mode 100644 index 6ed76044..00000000 --- a/examples/leptos-ssr/migration/Cargo.toml +++ /dev/null @@ -1,22 +0,0 @@ -[package] -name = "leptos-example-migration" -version = "0.1.0" -edition = "2021" -publish = false - -[lib] -name = "migration" -path = "src/lib.rs" - -[dependencies] -tokio = { workspace = true } - -[dependencies.sea-orm-migration] -workspace = true -features = [ - # Enable at least one `ASYNC_RUNTIME` and `DATABASE_DRIVER` feature if you want to run migration via CLI. - # View the list of supported features at https://www.sea-ql.org/SeaORM/docs/install-and-config/database-and-async-runtime. - # e.g. - "runtime-tokio-rustls", # `ASYNC_RUNTIME` feature - "sqlx-postgres", # `DATABASE_DRIVER` feature -] diff --git a/examples/leptos-ssr/migration/README.md b/examples/leptos-ssr/migration/README.md deleted file mode 100644 index 3b438d89..00000000 --- a/examples/leptos-ssr/migration/README.md +++ /dev/null @@ -1,41 +0,0 @@ -# Running Migrator CLI - -- Generate a new migration file - ```sh - cargo run -- generate MIGRATION_NAME - ``` -- Apply all pending migrations - ```sh - cargo run - ``` - ```sh - cargo run -- up - ``` -- Apply first 10 pending migrations - ```sh - cargo run -- up -n 10 - ``` -- Rollback last applied migrations - ```sh - cargo run -- down - ``` -- Rollback last 10 applied migrations - ```sh - cargo run -- down -n 10 - ``` -- Drop all tables from the database, then reapply all migrations - ```sh - cargo run -- fresh - ``` -- Rollback all applied migrations, then reapply all migrations - ```sh - cargo run -- refresh - ``` -- Rollback all applied migrations - ```sh - cargo run -- reset - ``` -- Check the status of all migrations - ```sh - cargo run -- status - ``` diff --git a/examples/leptos-ssr/migration/src/lib.rs b/examples/leptos-ssr/migration/src/lib.rs deleted file mode 100644 index 2c605afb..00000000 --- a/examples/leptos-ssr/migration/src/lib.rs +++ /dev/null @@ -1,12 +0,0 @@ -pub use sea_orm_migration::prelude::*; - -mod m20220101_000001_create_table; - -pub struct Migrator; - -#[async_trait::async_trait] -impl MigratorTrait for Migrator { - fn migrations() -> Vec> { - vec![Box::new(m20220101_000001_create_table::Migration)] - } -} diff --git a/examples/leptos-ssr/migration/src/m20220101_000001_create_table.rs b/examples/leptos-ssr/migration/src/m20220101_000001_create_table.rs deleted file mode 100644 index 02dab03a..00000000 --- a/examples/leptos-ssr/migration/src/m20220101_000001_create_table.rs +++ /dev/null @@ -1,15 +0,0 @@ -use sea_orm_migration::prelude::*; - -#[derive(DeriveMigrationName)] -pub struct Migration; - -#[async_trait::async_trait] -impl MigrationTrait for Migration { - async fn up(&self, _manager: &SchemaManager) -> Result<(), DbErr> { - Ok(()) - } - - async fn down(&self, _manager: &SchemaManager) -> Result<(), DbErr> { - Ok(()) - } -} diff --git a/examples/leptos-ssr/migration/src/main.rs b/examples/leptos-ssr/migration/src/main.rs deleted file mode 100644 index f054deaf..00000000 --- a/examples/leptos-ssr/migration/src/main.rs +++ /dev/null @@ -1,6 +0,0 @@ -use sea_orm_migration::prelude::*; - -#[tokio::main] -async fn main() { - cli::run_cli(migration::Migrator).await; -} diff --git a/examples/leptos-ssr/src/server/mod.rs b/examples/leptos-ssr/src/server/mod.rs index 80667548..3f814e5a 100644 --- a/examples/leptos-ssr/src/server/mod.rs +++ b/examples/leptos-ssr/src/server/mod.rs @@ -7,7 +7,6 @@ use axum::Router; use leptos::get_configuration; use leptos_axum::{generate_route_list, LeptosRoutes}; use leptos_config::{ConfFile, Env}; -use migration::Migrator; use roadster::app::context::AppContext; use roadster::app::metadata::AppMetadata; use roadster::app::App as RoadsterApp; @@ -28,7 +27,6 @@ pub struct Server; #[async_trait] impl RoadsterApp for Server { type Cli = crate::cli::AppCli; - type M = Migrator; fn metadata(&self, _config: &AppConfig) -> RoadsterResult { Ok(AppMetadata::builder()