feat: add autostart toggle setting

This commit is contained in:
PandaDEV 2025-01-02 18:41:28 +10:00
parent 6d7874c1ae
commit 3bfd72b638
No known key found for this signature in database
GPG key ID: 13EFF9BAF70EE75C
7 changed files with 11 additions and 16 deletions

View file

@ -69,9 +69,9 @@ async fn apply_migrations(pool: &SqlitePool) -> Result<(), Box<dyn std::error::E
.files()
.filter_map(|file| {
let file_name = file.path().file_name()?.to_str()?;
if file_name.ends_with(".sql") && file_name.starts_with("migration") {
if file_name.ends_with(".sql") && file_name.starts_with("v") {
let version: i64 = file_name
.trim_start_matches("migration")
.trim_start_matches("v")
.trim_end_matches(".sql")
.parse()
.ok()?;

View file

@ -0,0 +1 @@
INSERT INTO settings (key, value) VALUES ('autostart', 'true');