1
0
mirror of https://git.ngram.ca/OpenJam/rc-servers synced 2026-08-23 23:08:52 +00:00

Configure all death, spawn, and garage bay skins for #3

This commit is contained in:
NG (Graham)
2025-05-26 21:30:28 -04:00
parent 956bb2149d
commit ab19c723cd
14 changed files with 584 additions and 143 deletions

View File

@@ -0,0 +1,54 @@
use sea_orm_migration::prelude::*;
pub struct Migration;
impl MigrationName for Migration {
fn name(&self) -> &str {
"m20250526_000001_add_garage_customisation"
}
}
#[async_trait::async_trait]
impl MigrationTrait for Migration {
// Define how to apply this migration: Add death and spawn animation columns
async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> {
// sqlite adapter doesn't support multiple alter operations in one declaration
manager
.alter_table(
Table::alter()
.table(crate::schema::garage::Entity)
.add_column(ColumnDef::new(crate::schema::garage::Column::SpawnAnimationId).string().not_null().default("Spawn".to_owned()))
.to_owned()
)
.await?;
manager
.alter_table(
Table::alter()
.table(crate::schema::garage::Entity)
.add_column(ColumnDef::new(crate::schema::garage::Column::DeathAnimationId).string().not_null().default("Explosion".to_owned()))
.to_owned()
)
.await
}
// Define how to rollback this migration: Drop the added colums.
async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> {
manager
.alter_table(
Table::alter()
.table(crate::schema::garage::Entity)
.drop_column(crate::schema::garage::Column::SpawnAnimationId)
.to_owned()
)
.await?;
manager
.alter_table(
Table::alter()
.table(crate::schema::garage::Entity)
.drop_column(crate::schema::garage::Column::DeathAnimationId)
.to_owned()
)
.await
}
}

View File

@@ -5,6 +5,7 @@ mod m20250424_000002_create_user_permissions_table;
mod m20250424_000003_create_garage_table;
mod m20250424_000004_create_user_aux_table;
mod m20250424_000005_create_campaign_tables;
mod m20250526_000001_add_garage_customisation;
pub struct Migrator;
@@ -17,6 +18,7 @@ impl MigratorTrait for Migrator {
Box::new(m20250424_000003_create_garage_table::Migration),
Box::new(m20250424_000004_create_user_aux_table::Migration),
Box::new(m20250424_000005_create_campaign_tables::Migration),
Box::new(m20250526_000001_add_garage_customisation::Migration),
]
}
}