MCPcopy Create free account
hub / github.com/SeaQL/sea-orm / create_log_table

Function create_log_table

tests/common/features/schema.rs:72–105  ·  view source on GitHub ↗
(db: &DbConn)

Source from the content-addressed store, hash-verified

70}
71
72pub async fn create_log_table(db: &DbConn) -> Result<ExecResult, DbErr> {
73 let stmt = sea_query::Table::create()
74 .table(applog::Entity)
75 .comment("app logs")
76 .col(
77 ColumnDef::new(applog::Column::Id)
78 .integer()
79 .not_null()
80 .comment("ID")
81 .auto_increment()
82 .primary_key(),
83 )
84 .col(
85 ColumnDef::new(applog::Column::Action)
86 .string()
87 .not_null()
88 .comment("action"),
89 )
90 .col(
91 ColumnDef::new(applog::Column::Json)
92 .json()
93 .not_null()
94 .comment("action data"),
95 )
96 .col(
97 ColumnDef::new(applog::Column::CreatedAt)
98 .timestamp_with_time_zone()
99 .not_null()
100 .comment("create time"),
101 )
102 .to_owned();
103
104 create_table(db, &stmt, Applog).await
105}
106
107pub async fn create_metadata_table(db: &DbConn) -> Result<ExecResult, DbErr> {
108 let stmt = sea_query::Table::create()

Callers 1

create_tablesFunction · 0.85

Calls 5

createFunction · 0.50
newFunction · 0.50
create_tableFunction · 0.50
commentMethod · 0.45
auto_incrementMethod · 0.45

Tested by

no test coverage detected