-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
484 additions
and
171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15 | ||
|
||
use sea_orm::entity::prelude::*; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)] | ||
#[sea_orm(table_name = "live_prize_pool_item_cdk")] | ||
pub struct Model { | ||
#[sea_orm(primary_key)] | ||
pub id: i64, | ||
pub live_id: Option<i64>, | ||
pub prize_id: Option<i64>, | ||
pub cdk: Option<String>, | ||
pub status: Option<bool>, | ||
pub create_time: Option<DateTime>, | ||
pub update_time: Option<DateTime>, | ||
} | ||
|
||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] | ||
pub enum Relation {} | ||
|
||
impl ActiveModelBehavior for ActiveModel {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
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 | ||
.create_table( | ||
Table::create() | ||
.table(LivePrizePoolItemCdk::Table) | ||
.if_not_exists() | ||
.comment("活动奖池奖品CDK信息") | ||
.col( | ||
ColumnDef::new(LivePrizePoolItemCdk::Id) | ||
.big_integer() | ||
.not_null() | ||
.auto_increment() | ||
.primary_key(), | ||
) | ||
.col(ColumnDef::new(LivePrizePoolItemCdk::LiveId).big_integer().comment("活动奖池ID")) | ||
.col(ColumnDef::new(LivePrizePoolItemCdk::PrizeId).big_integer().comment("奖品ID")) | ||
.col(ColumnDef::new(LivePrizePoolItemCdk::Cdk).string().char_len(64).comment("CDK")) | ||
.col(ColumnDef::new(LivePrizePoolItemCdk::Status).boolean().default(1).comment("状态")) | ||
.col(ColumnDef::new(LivePrizePoolItemCdk::CreateTime).date_time().comment("创建时间")) | ||
.col(ColumnDef::new(LivePrizePoolItemCdk::UpdateTime).date_time().comment("更新时间")) | ||
.to_owned(), | ||
) | ||
.await?; | ||
manager.alter_table( | ||
Table::alter() | ||
.table(LivePrizePoolItem::Table) | ||
.add_column(ColumnDef::new(LivePrizePoolItem::CdkQuantity).big_integer().default(0).comment("CDK数量")) | ||
.to_owned() | ||
).await?; | ||
Ok(()) | ||
} | ||
|
||
async fn down(&self, _manager: &SchemaManager) -> Result<(), DbErr> { | ||
Ok(()) | ||
} | ||
} | ||
|
||
#[derive(DeriveIden)] | ||
enum LivePrizePoolItemCdk { | ||
Table, | ||
Id, | ||
LiveId, | ||
PrizeId, | ||
Cdk, | ||
Status, | ||
CreateTime, | ||
UpdateTime, | ||
} | ||
|
||
#[derive(DeriveIden)] | ||
enum LivePrizePoolItem { | ||
Table, | ||
CdkQuantity, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.