diff --git a/rslib/src/storage/tag/mod.rs b/rslib/src/storage/tag/mod.rs index 8d9817856..bfbbce227 100644 --- a/rslib/src/storage/tag/mod.rs +++ b/rslib/src/storage/tag/mod.rs @@ -171,17 +171,8 @@ impl SqliteStorage { }) })? .collect::>>()?; - self.db.execute_batch( - " - drop table tags; - create table tags ( - id integer primary key not null, - name text not null collate unicase, - usn integer not null, - config blob not null - ); - ", - )?; + self.db + .execute_batch(include_str!["../upgrades/schema17_upgrade.sql"])?; tags.into_iter().try_for_each(|mut tag| -> Result<()> { tag.name = human_tag_name_to_native(&tag.name); self.register_tag(&mut tag) diff --git a/rslib/src/storage/upgrades/schema17_upgrade.sql b/rslib/src/storage/upgrades/schema17_upgrade.sql new file mode 100644 index 000000000..a324181f9 --- /dev/null +++ b/rslib/src/storage/upgrades/schema17_upgrade.sql @@ -0,0 +1,7 @@ +drop table tags; +create table tags ( + id integer primary key not null, + name text not null collate unicase, + usn integer not null, + config blob not null +); \ No newline at end of file