Actualiza formato del código aplicando cargo fmt
This commit is contained in:
parent
4b5caf06a7
commit
e6ea59785e
75 changed files with 1069 additions and 1160 deletions
|
|
@ -27,9 +27,7 @@ impl ModuleTrait for Node {
|
|||
}
|
||||
|
||||
fn actions(&self) -> Vec<HookAction> {
|
||||
vec![
|
||||
hook_action!(BeforeRenderPageHook => before_render_page, -1)
|
||||
]
|
||||
vec![hook_action!(BeforeRenderPageHook => before_render_page, -1)]
|
||||
}
|
||||
|
||||
fn migrations(&self) -> Vec<MigrationItem> {
|
||||
|
|
@ -43,11 +41,7 @@ impl ModuleTrait for Node {
|
|||
}
|
||||
|
||||
async fn node() -> app::Result<Markup> {
|
||||
Page::new()
|
||||
.with_title(
|
||||
"Nodo"
|
||||
)
|
||||
.render()
|
||||
Page::new().with_title("Nodo").render()
|
||||
}
|
||||
|
||||
fn before_render_page(page: &mut Page) {
|
||||
|
|
|
|||
|
|
@ -24,61 +24,35 @@ pub_migration!(Migration);
|
|||
#[async_trait::async_trait]
|
||||
impl MigrationTrait for Migration {
|
||||
async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> {
|
||||
manager.create_table(Table::create()
|
||||
.table(NodeType::Table)
|
||||
.if_not_exists()
|
||||
.col(ColumnDef::new(NodeType::Type)
|
||||
.integer()
|
||||
.not_null()
|
||||
.auto_increment()
|
||||
.primary_key(),
|
||||
manager
|
||||
.create_table(
|
||||
Table::create()
|
||||
.table(NodeType::Table)
|
||||
.if_not_exists()
|
||||
.col(
|
||||
ColumnDef::new(NodeType::Type)
|
||||
.integer()
|
||||
.not_null()
|
||||
.auto_increment()
|
||||
.primary_key(),
|
||||
)
|
||||
.col(ColumnDef::new(NodeType::Name).string().not_null())
|
||||
.col(ColumnDef::new(NodeType::Description).string().not_null())
|
||||
.col(ColumnDef::new(NodeType::Help).string().not_null())
|
||||
.col(ColumnDef::new(NodeType::HasTitle).string().not_null())
|
||||
.col(ColumnDef::new(NodeType::TitleLabel).string().not_null())
|
||||
.col(ColumnDef::new(NodeType::Custom).string().not_null())
|
||||
.col(ColumnDef::new(NodeType::Locked).string().not_null())
|
||||
.col(ColumnDef::new(NodeType::Disabled).string().not_null())
|
||||
.col(ColumnDef::new(NodeType::OrigType).string().not_null())
|
||||
.to_owned(),
|
||||
)
|
||||
.col(ColumnDef::new(NodeType::Name)
|
||||
.string()
|
||||
.not_null()
|
||||
)
|
||||
.col(ColumnDef::new(NodeType::Description)
|
||||
.string()
|
||||
.not_null()
|
||||
)
|
||||
.col(ColumnDef::new(NodeType::Help)
|
||||
.string()
|
||||
.not_null()
|
||||
)
|
||||
.col(ColumnDef::new(NodeType::HasTitle)
|
||||
.string()
|
||||
.not_null()
|
||||
)
|
||||
.col(ColumnDef::new(NodeType::TitleLabel)
|
||||
.string()
|
||||
.not_null()
|
||||
)
|
||||
.col(ColumnDef::new(NodeType::Custom)
|
||||
.string()
|
||||
.not_null()
|
||||
)
|
||||
.col(ColumnDef::new(NodeType::Locked)
|
||||
.string()
|
||||
.not_null()
|
||||
)
|
||||
.col(ColumnDef::new(NodeType::Disabled)
|
||||
.string()
|
||||
.not_null()
|
||||
)
|
||||
.col(ColumnDef::new(NodeType::OrigType)
|
||||
.string()
|
||||
.not_null()
|
||||
)
|
||||
.to_owned()
|
||||
)
|
||||
.await
|
||||
.await
|
||||
}
|
||||
|
||||
async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> {
|
||||
manager.drop_table(Table::drop()
|
||||
.table(NodeType::Table)
|
||||
.to_owned()
|
||||
)
|
||||
.await
|
||||
manager
|
||||
.drop_table(Table::drop().table(NodeType::Table).to_owned())
|
||||
.await
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,77 +31,39 @@ pub_migration!(Migration);
|
|||
#[async_trait::async_trait]
|
||||
impl MigrationTrait for Migration {
|
||||
async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> {
|
||||
manager.create_table(Table::create()
|
||||
.table(Node::Table)
|
||||
.if_not_exists()
|
||||
.col(ColumnDef::new(Node::Nid)
|
||||
.integer()
|
||||
.not_null()
|
||||
.auto_increment()
|
||||
.primary_key(),
|
||||
manager
|
||||
.create_table(
|
||||
Table::create()
|
||||
.table(Node::Table)
|
||||
.if_not_exists()
|
||||
.col(
|
||||
ColumnDef::new(Node::Nid)
|
||||
.integer()
|
||||
.not_null()
|
||||
.auto_increment()
|
||||
.primary_key(),
|
||||
)
|
||||
.col(ColumnDef::new(Node::Vid).string().not_null())
|
||||
.col(ColumnDef::new(Node::Type).string().not_null())
|
||||
.col(ColumnDef::new(Node::Language).string().not_null())
|
||||
.col(ColumnDef::new(Node::Title).string().not_null())
|
||||
.col(ColumnDef::new(Node::Uid).string().not_null())
|
||||
.col(ColumnDef::new(Node::Status).string().not_null())
|
||||
.col(ColumnDef::new(Node::Created).string().not_null())
|
||||
.col(ColumnDef::new(Node::Changed).string().not_null())
|
||||
.col(ColumnDef::new(Node::Comment).string().not_null())
|
||||
.col(ColumnDef::new(Node::Promote).string().not_null())
|
||||
.col(ColumnDef::new(Node::Sticky).string().not_null())
|
||||
.col(ColumnDef::new(Node::Tnid).string().not_null())
|
||||
.col(ColumnDef::new(Node::Translate).string().not_null())
|
||||
.to_owned(),
|
||||
)
|
||||
.col(ColumnDef::new(Node::Vid)
|
||||
.string()
|
||||
.not_null()
|
||||
)
|
||||
.col(ColumnDef::new(Node::Type)
|
||||
.string()
|
||||
.not_null()
|
||||
)
|
||||
.col(ColumnDef::new(Node::Language)
|
||||
.string()
|
||||
.not_null()
|
||||
)
|
||||
.col(ColumnDef::new(Node::Title)
|
||||
.string()
|
||||
.not_null()
|
||||
)
|
||||
.col(ColumnDef::new(Node::Uid)
|
||||
.string()
|
||||
.not_null()
|
||||
)
|
||||
.col(ColumnDef::new(Node::Status)
|
||||
.string()
|
||||
.not_null()
|
||||
)
|
||||
.col(ColumnDef::new(Node::Created)
|
||||
.string()
|
||||
.not_null()
|
||||
)
|
||||
.col(ColumnDef::new(Node::Changed)
|
||||
.string()
|
||||
.not_null()
|
||||
)
|
||||
.col(ColumnDef::new(Node::Comment)
|
||||
.string()
|
||||
.not_null()
|
||||
)
|
||||
.col(ColumnDef::new(Node::Promote)
|
||||
.string()
|
||||
.not_null()
|
||||
)
|
||||
.col(ColumnDef::new(Node::Sticky)
|
||||
.string()
|
||||
.not_null()
|
||||
)
|
||||
.col(ColumnDef::new(Node::Tnid)
|
||||
.string()
|
||||
.not_null()
|
||||
)
|
||||
.col(ColumnDef::new(Node::Translate)
|
||||
.string()
|
||||
.not_null()
|
||||
)
|
||||
.to_owned()
|
||||
)
|
||||
.await
|
||||
.await
|
||||
}
|
||||
|
||||
async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> {
|
||||
manager.drop_table(Table::drop()
|
||||
.table(Node::Table)
|
||||
.to_owned()
|
||||
)
|
||||
.await
|
||||
manager
|
||||
.drop_table(Table::drop().table(Node::Table).to_owned())
|
||||
.await
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,45 +23,31 @@ pub_migration!(Migration);
|
|||
#[async_trait::async_trait]
|
||||
impl MigrationTrait for Migration {
|
||||
async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> {
|
||||
manager.create_table(Table::create()
|
||||
.table(NodeAccess::Table)
|
||||
.if_not_exists()
|
||||
.col(ColumnDef::new(NodeAccess::Nid)
|
||||
.integer()
|
||||
.not_null()
|
||||
.auto_increment()
|
||||
.primary_key(),
|
||||
manager
|
||||
.create_table(
|
||||
Table::create()
|
||||
.table(NodeAccess::Table)
|
||||
.if_not_exists()
|
||||
.col(
|
||||
ColumnDef::new(NodeAccess::Nid)
|
||||
.integer()
|
||||
.not_null()
|
||||
.auto_increment()
|
||||
.primary_key(),
|
||||
)
|
||||
.col(ColumnDef::new(NodeAccess::Gid).string().not_null())
|
||||
.col(ColumnDef::new(NodeAccess::Realm).string().not_null())
|
||||
.col(ColumnDef::new(NodeAccess::GrantView).string().not_null())
|
||||
.col(ColumnDef::new(NodeAccess::GrantUpdate).string().not_null())
|
||||
.col(ColumnDef::new(NodeAccess::GrantDelete).string().not_null())
|
||||
.to_owned(),
|
||||
)
|
||||
.col(ColumnDef::new(NodeAccess::Gid)
|
||||
.string()
|
||||
.not_null()
|
||||
)
|
||||
.col(ColumnDef::new(NodeAccess::Realm)
|
||||
.string()
|
||||
.not_null()
|
||||
)
|
||||
.col(ColumnDef::new(NodeAccess::GrantView)
|
||||
.string()
|
||||
.not_null()
|
||||
)
|
||||
.col(ColumnDef::new(NodeAccess::GrantUpdate)
|
||||
.string()
|
||||
.not_null()
|
||||
)
|
||||
.col(ColumnDef::new(NodeAccess::GrantDelete)
|
||||
.string()
|
||||
.not_null()
|
||||
)
|
||||
.to_owned()
|
||||
)
|
||||
.await
|
||||
.await
|
||||
}
|
||||
|
||||
async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> {
|
||||
manager.drop_table(Table::drop()
|
||||
.table(NodeAccess::Table)
|
||||
.to_owned()
|
||||
)
|
||||
.await
|
||||
manager
|
||||
.drop_table(Table::drop().table(NodeAccess::Table).to_owned())
|
||||
.await
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,61 +25,35 @@ pub_migration!(Migration);
|
|||
#[async_trait::async_trait]
|
||||
impl MigrationTrait for Migration {
|
||||
async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> {
|
||||
manager.create_table(Table::create()
|
||||
.table(NodeRevision::Table)
|
||||
.if_not_exists()
|
||||
.col(ColumnDef::new(NodeRevision::Nid)
|
||||
.integer()
|
||||
.not_null()
|
||||
.auto_increment()
|
||||
.primary_key(),
|
||||
manager
|
||||
.create_table(
|
||||
Table::create()
|
||||
.table(NodeRevision::Table)
|
||||
.if_not_exists()
|
||||
.col(
|
||||
ColumnDef::new(NodeRevision::Nid)
|
||||
.integer()
|
||||
.not_null()
|
||||
.auto_increment()
|
||||
.primary_key(),
|
||||
)
|
||||
.col(ColumnDef::new(NodeRevision::Vid).string().not_null())
|
||||
.col(ColumnDef::new(NodeRevision::Uid).string().not_null())
|
||||
.col(ColumnDef::new(NodeRevision::Title).string().not_null())
|
||||
.col(ColumnDef::new(NodeRevision::Log).string().not_null())
|
||||
.col(ColumnDef::new(NodeRevision::Timestamp).string().not_null())
|
||||
.col(ColumnDef::new(NodeRevision::Status).string().not_null())
|
||||
.col(ColumnDef::new(NodeRevision::Comment).string().not_null())
|
||||
.col(ColumnDef::new(NodeRevision::Promote).string().not_null())
|
||||
.col(ColumnDef::new(NodeRevision::Sticky).string().not_null())
|
||||
.to_owned(),
|
||||
)
|
||||
.col(ColumnDef::new(NodeRevision::Vid)
|
||||
.string()
|
||||
.not_null()
|
||||
)
|
||||
.col(ColumnDef::new(NodeRevision::Uid)
|
||||
.string()
|
||||
.not_null()
|
||||
)
|
||||
.col(ColumnDef::new(NodeRevision::Title)
|
||||
.string()
|
||||
.not_null()
|
||||
)
|
||||
.col(ColumnDef::new(NodeRevision::Log)
|
||||
.string()
|
||||
.not_null()
|
||||
)
|
||||
.col(ColumnDef::new(NodeRevision::Timestamp)
|
||||
.string()
|
||||
.not_null()
|
||||
)
|
||||
.col(ColumnDef::new(NodeRevision::Status)
|
||||
.string()
|
||||
.not_null()
|
||||
)
|
||||
.col(ColumnDef::new(NodeRevision::Comment)
|
||||
.string()
|
||||
.not_null()
|
||||
)
|
||||
.col(ColumnDef::new(NodeRevision::Promote)
|
||||
.string()
|
||||
.not_null()
|
||||
)
|
||||
.col(ColumnDef::new(NodeRevision::Sticky)
|
||||
.string()
|
||||
.not_null()
|
||||
)
|
||||
.to_owned()
|
||||
)
|
||||
.await
|
||||
.await
|
||||
}
|
||||
|
||||
async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> {
|
||||
manager.drop_table(Table::drop()
|
||||
.table(NodeRevision::Table)
|
||||
.to_owned()
|
||||
)
|
||||
.await
|
||||
manager
|
||||
.drop_table(Table::drop().table(NodeRevision::Table).to_owned())
|
||||
.await
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue