Skip to content

Commit

Permalink
Merge pull request #378 from chenyukang/yukang-cleanup
Browse files Browse the repository at this point in the history
chore: cleanup unsed code in migration
  • Loading branch information
quake authored Dec 7, 2024
2 parents e197ce3 + 5ebfb1f commit 1049343
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 31 deletions.
23 changes: 0 additions & 23 deletions src/store/migration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,25 +152,6 @@ pub trait Migration: Send + Sync {

/// returns migration version, use `date +'%Y%m%d%H%M%S'` timestamp format
fn version(&self) -> &str;

/// Will cost a lot of time to perform this migration operation.
///
/// Override this function for `Migrations` which could be executed very fast.
fn expensive(&self) -> bool {
true
}

/// Check if the background migration can be resumed.
///
/// If a migration can be resumed, it should implement the recovery logic in `migrate` function.
/// and the `MigirateWorker` will add the migration's handler with `register_thread`, so that then
/// main thread can wait for the background migration to store the progress and exit.
///
/// Otherwise, the migration will be restarted from the beginning.
///
fn can_resume(&self) -> bool {
false
}
}

const INIT_DB_VERSION: &str = "20241116135521";
Expand Down Expand Up @@ -199,8 +180,4 @@ impl Migration for DefaultMigration {
fn version(&self) -> &str {
&self.version
}

fn expensive(&self) -> bool {
false
}
}
4 changes: 0 additions & 4 deletions src/store/migrations/sample.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,4 @@ impl Migration for SampleMigration {
fn version(&self) -> &str {
&self.version
}

fn expensive(&self) -> bool {
false
}
}
4 changes: 0 additions & 4 deletions src/store/tests/migrate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,6 @@ fn test_run_migration() {
fn version(&self) -> &str {
&self.version
}

fn expensive(&self) -> bool {
false
}
}

let migrate = gen_migrate();
Expand Down

0 comments on commit 1049343

Please sign in to comment.