Added the watch and scheduler systems

This commit is contained in:
Connor Johnstone
2026-03-20 16:28:15 -04:00
parent 9917ee981d
commit 8a1435d9e9
4 changed files with 88 additions and 0 deletions
@@ -0,0 +1,59 @@
use sea_orm_migration::prelude::*;
#[derive(DeriveMigrationName)]
pub struct Migration;
#[async_trait::async_trait]
impl MigrationTrait for Migration {
async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> {
manager
.alter_table(
Table::alter()
.table(Artists::Table)
.add_column(
ColumnDef::new(Artists::Monitored)
.boolean()
.not_null()
.default(false),
)
.to_owned(),
)
.await?;
manager
.alter_table(
Table::alter()
.table(Artists::Table)
.add_column(ColumnDef::new(Artists::LastCheckedAt).timestamp())
.to_owned(),
)
.await
}
async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> {
manager
.alter_table(
Table::alter()
.table(Artists::Table)
.drop_column(Artists::LastCheckedAt)
.to_owned(),
)
.await?;
manager
.alter_table(
Table::alter()
.table(Artists::Table)
.drop_column(Artists::Monitored)
.to_owned(),
)
.await
}
}
#[derive(DeriveIden)]
enum Artists {
Table,
Monitored,
LastCheckedAt,
}
+2
View File
@@ -11,6 +11,7 @@ mod m20260317_000009_add_wanted_name;
mod m20260317_000010_add_wanted_mbid;
mod m20260319_000011_create_users;
mod m20260319_000012_add_user_id_to_wanted_items;
mod m20260320_000013_add_artist_monitoring;
pub struct Migrator;
@@ -29,6 +30,7 @@ impl MigratorTrait for Migrator {
Box::new(m20260317_000010_add_wanted_mbid::Migration),
Box::new(m20260319_000011_create_users::Migration),
Box::new(m20260319_000012_add_user_id_to_wanted_items::Migration),
Box::new(m20260320_000013_add_artist_monitoring::Migration),
]
}
}