Skip to content

Commit

Permalink
add columns to migration
Browse files Browse the repository at this point in the history
  • Loading branch information
carver committed Jan 30, 2025
1 parent fa8a027 commit 8e822b8
Showing 1 changed file with 50 additions and 3 deletions.
53 changes: 50 additions & 3 deletions migration/src/m20250130_042751_create_audit_internal_failures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,56 @@ impl MigrationTrait for Migration {
Table::create()
.table(AuditInternalFailure::Table)
.if_not_exists()
.col(pk_auto(Post::Id))
.col(string(Post::Title))
.col(string(Post::Text))
.col(
ColumnDef::new(AuditInternalFailure::Id)
.integer()
.not_null()
.auto_increment()
.primary_key(),
)
.col(
ColumnDef::new(AuditInternalFailure::Audit)
.integer()
.not_null(),
)
.foreign_key(
ForeignKey::create()
.name("FK_auditinternalfailure_audit")
.from(AuditInternalFailure::Table, AuditInternalFailure::Audit)
.to(Audit::Table, Audit::Id)
.on_delete(ForeignKeyAction::Cascade)
.on_update(ForeignKeyAction::Cascade),
)
.col(
ColumnDef::new(AuditInternalFailure::SenderClientInfo)
.integer()
.not_null(),
)
.foreign_key(
ForeignKey::create()
.name("FK_auditinternalfailure_sender_client_info")
.from(
AuditInternalFailure::Table,
AuditInternalFailure::SenderClientInfo,
)
.to(ClientInfo::Table, ClientInfo::Id),
)
.col(
ColumnDef::new(AuditInternalFailure::SenderNode)
.integer()
.not_null(),
)
.foreign_key(
ForeignKey::create()
.name("FK_auditinternalfailure_sender_node")
.from(AuditInternalFailure::Table, AuditInternalFailure::SenderNode)
.to(Node::Table, Node::Id),
)
.col(
ColumnDef::new(AuditInternalFailure::FailureType)
.integer()
.not_null(),
)
.to_owned(),
)
.await
Expand Down

0 comments on commit 8e822b8

Please sign in to comment.