Skip to content

Commit

Permalink
migrateを一旦無効化
Browse files Browse the repository at this point in the history
  • Loading branch information
Pugma committed Jul 11, 2024
1 parent d7d4a48 commit 55da0e6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion server/app/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use repository::Repository;
async fn main() -> anyhow::Result<()> {
// DB 初期化
let state = Repository::setup_db().await?;
state.migrate().await?;
// state.migrate().await?;

// 静的ファイル配信設定
let static_dir = ServeFile::new("/dist/index.html");
Expand Down
12 changes: 6 additions & 6 deletions server/app/src/repository.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use sqlx::{FromRow, MySqlPool};
use std::env;
use std::string::String;

const MIGRATOR: sqlx::migrate::Migrator = sqlx::migrate!("../../docs");
// const MIGRATOR: sqlx::migrate::Migrator = sqlx::migrate!("../../docs");

use async_sqlx_session::MySqlSessionStore;
use openapi::models::GroupItem;
Expand Down Expand Up @@ -40,11 +40,11 @@ impl Repository {
})
}

pub async fn migrate(&self) -> anyhow::Result<()> {
MIGRATOR.run(&self.pool).await?;
self.session_store.migrate().await?;
Ok(())
}
// pub async fn migrate(&self) -> anyhow::Result<()> {
// MIGRATOR.run(&self.pool).await?;
// self.session_store.migrate().await?;
// Ok(())
// }
}

impl AsRef<Repository> for Repository {
Expand Down

0 comments on commit 55da0e6

Please sign in to comment.