Added the watch and scheduler systems
This commit is contained in:
@@ -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,
|
||||
}
|
||||
@@ -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),
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user