mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 00:55:28 +00:00
move migration api out of struct implementation
This commit is contained in:
parent
06f43f34f3
commit
39ee50c4ba
12 changed files with 173 additions and 177 deletions
|
|
@ -219,19 +219,19 @@ impl Item {
|
|||
pub fn gobject(&self) -> &TabPage {
|
||||
&self.widget.gobject()
|
||||
}
|
||||
|
||||
// Tools
|
||||
pub fn migrate(tx: &Transaction) -> Result<(), String> {
|
||||
// Migrate self components
|
||||
if let Err(e) = Database::init(&tx) {
|
||||
return Err(e.to_string());
|
||||
}
|
||||
|
||||
// Delegate migration to childs
|
||||
Page::migrate(&tx)?;
|
||||
Widget::migrate(&tx)?;
|
||||
|
||||
// Success
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
// Tools
|
||||
pub fn migrate(tx: &Transaction) -> Result<(), String> {
|
||||
// Migrate self components
|
||||
if let Err(e) = Database::init(&tx) {
|
||||
return Err(e.to_string());
|
||||
}
|
||||
|
||||
// Delegate migration to childs
|
||||
page::migrate(&tx)?;
|
||||
widget::migrate(&tx)?;
|
||||
|
||||
// Success
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue