Move sql code for upgrading to schema 17 to a separate file

This commit is contained in:
abdo 2021-01-09 14:36:38 +03:00
parent c6e3d55400
commit 1be789f25f
2 changed files with 9 additions and 11 deletions

View file

@ -171,17 +171,8 @@ impl SqliteStorage {
}) })
})? })?
.collect::<Result<Vec<Tag>>>()?; .collect::<Result<Vec<Tag>>>()?;
self.db.execute_batch( self.db
" .execute_batch(include_str!["../upgrades/schema17_upgrade.sql"])?;
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
);
",
)?;
tags.into_iter().try_for_each(|mut tag| -> Result<()> { tags.into_iter().try_for_each(|mut tag| -> Result<()> {
tag.name = human_tag_name_to_native(&tag.name); tag.name = human_tag_name_to_native(&tag.name);
self.register_tag(&mut tag) self.register_tag(&mut tag)

View file

@ -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
);