Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: cleanup unsed code in migration #378

Merged
merged 1 commit into from
Dec 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading