Set up some routes using new Rust API

This commit is contained in:
Ben Grant 2023-05-13 13:46:23 +10:00
parent fdc58b428b
commit fc8e2a4360
26 changed files with 703 additions and 134 deletions

View file

@ -36,6 +36,7 @@ impl MigrationTrait for Migration {
.col(ColumnDef::new(Event::Id).string().not_null().primary_key())
.col(ColumnDef::new(Event::Name).string().not_null())
.col(ColumnDef::new(Event::CreatedAt).timestamp().not_null())
.col(ColumnDef::new(Event::VisitedAt).timestamp().not_null())
.col(ColumnDef::new(Event::Times).json().not_null())
.col(ColumnDef::new(Event::Timezone).string().not_null())
.to_owned(),
@ -105,6 +106,7 @@ enum Event {
Id,
Name,
CreatedAt,
VisitedAt,
Times,
Timezone,
}

View file

@ -1,12 +1,12 @@
pub use sea_orm_migration::prelude::*;
mod setup_tables;
mod m01_setup_tables;
pub struct Migrator;
#[async_trait::async_trait]
impl MigratorTrait for Migrator {
fn migrations() -> Vec<Box<dyn MigrationTrait>> {
vec![Box::new(setup_tables::Migration)]
vec![Box::new(m01_setup_tables::Migration)]
}
}