mirror of
https://github.com/4cuck/nitter-status.git
synced 2026-10-27 00:57:39 +00:00
parse and display instance countries
This commit is contained in:
1 parent
b7498ceb3d
commit
e0826ab468
16 files changed
+2681
-1773
No files matched your search
@@ -4,6 +4,8 @@ mod m20220101_000001_create_table;
|
||||
mod m20230729_010231_datetime_rowid;
|
||||
mod m20230729_230909_datetime_int_host;
|
||||
mod m20230803_154714_version_url;
|
||||
mod m20230829_201916_country;
|
||||
|
||||
|
||||
pub struct Migrator;
|
||||
|
||||
@@ -15,6 +17,7 @@ impl MigratorTrait for Migrator {
|
||||
Box::new(m20230729_010231_datetime_rowid::Migration),
|
||||
Box::new(m20230729_230909_datetime_int_host::Migration),
|
||||
Box::new(m20230803_154714_version_url::Migration),
|
||||
Box::new(m20230829_201916_country::Migration),
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
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> {
|
||||
let cmd = r#"ALTER TABLE "host" ADD COLUMN "country" TEXT NOT NULL DEFAULT '';"#;
|
||||
let db = manager.get_connection();
|
||||
db.execute_unprepared("BEGIN EXCLUSIVE").await?;
|
||||
tracing::info!("adding version_url column..");
|
||||
db.execute_unprepared(cmd).await?;
|
||||
db.execute_unprepared("COMMIT TRANSACTION").await?;
|
||||
db.execute_unprepared("VACUUM").await?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
async fn down(&self, _manager: &SchemaManager) -> Result<(), DbErr> {
|
||||
panic!("Can't migrate down");
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user