A card game engine for TCGs, primarily Magic: The Gathering but with support for others
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Working on migration stuff, need to fix this, and also add entities (see basic example from sea-orm)

+15 -3
+15 -3
migration/src/m20260421_001539_add_first_test_card.rs
··· 1 - use sea_orm_migration::prelude::*; 1 + use sea_orm_migration::{prelude::*, sea_orm::{entity::*, query::*}}; 2 2 3 3 #[derive(DeriveMigrationName)] 4 4 pub struct Migration; 5 5 6 6 #[async_trait::async_trait] 7 7 impl MigrationTrait for Migration { 8 - async fn up(&self, _manager: &SchemaManager) -> Result<(), DbErr> { 9 - todo!(); 8 + async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> { 9 + let stmt = Query::insert() 10 + .into_table("card") 11 + .columns(["name", "power", "toughness", "type"]) 12 + .values_panic([ 13 + "Bear".into(), 14 + 2.into(), 15 + 2.into(), 16 + "creature".into() 17 + ]) 18 + .to_owned(); 19 + 20 + manager.execute(&stmt).await?; 21 + Ok(()) 10 22 } 11 23 12 24 async fn down(&self, _manager: &SchemaManager) -> Result<(), DbErr> {