Compare commits
No commits in common. "0d6627d86a34937a344fda889dff5c4a9a0dd2c0" and "76090d4266342ed84cd90144982fad4edd7848a7" have entirely different histories.
0d6627d86a
...
76090d4266
@ -6,7 +6,6 @@ mod m20220101_000001_create_table;
|
|||||||
mod m20230726_124452_images;
|
mod m20230726_124452_images;
|
||||||
mod m20230726_135630_parking_spaces;
|
mod m20230726_135630_parking_spaces;
|
||||||
mod m20230805_000001_add_email;
|
mod m20230805_000001_add_email;
|
||||||
mod m20230809_135630_add_spot;
|
|
||||||
|
|
||||||
pub struct Migrator;
|
pub struct Migrator;
|
||||||
|
|
||||||
@ -18,7 +17,6 @@ impl MigratorTrait for Migrator {
|
|||||||
Box::new(m20230726_124452_images::Migration),
|
Box::new(m20230726_124452_images::Migration),
|
||||||
Box::new(m20230726_135630_parking_spaces::Migration),
|
Box::new(m20230726_135630_parking_spaces::Migration),
|
||||||
Box::new(m20230805_000001_add_email::Migration),
|
Box::new(m20230805_000001_add_email::Migration),
|
||||||
Box::new(m20230809_135630_add_spot::Migration),
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -137,7 +137,6 @@ pub enum ParkingSpace {
|
|||||||
Id,
|
Id,
|
||||||
State,
|
State,
|
||||||
Location,
|
Location,
|
||||||
Spot,
|
|
||||||
AccountId,
|
AccountId,
|
||||||
CreatedAt,
|
CreatedAt,
|
||||||
UpdatedAt,
|
UpdatedAt,
|
||||||
|
@ -1,35 +0,0 @@
|
|||||||
use sea_orm_migration::prelude::*;
|
|
||||||
|
|
||||||
use crate::m20230726_135630_parking_spaces::ParkingSpace;
|
|
||||||
|
|
||||||
#[derive(DeriveMigrationName)]
|
|
||||||
pub struct Migration;
|
|
||||||
|
|
||||||
#[async_trait::async_trait]
|
|
||||||
impl MigrationTrait for Migration {
|
|
||||||
async fn up(&self, m: &SchemaManager) -> Result<(), DbErr> {
|
|
||||||
m.alter_table(
|
|
||||||
Table::alter()
|
|
||||||
.table(ParkingSpace::ParkingSpaces)
|
|
||||||
.add_column(
|
|
||||||
ColumnDef::new(ParkingSpace::Spot)
|
|
||||||
.integer())
|
|
||||||
.to_owned(),
|
|
||||||
)
|
|
||||||
.await?;
|
|
||||||
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|
||||||
async fn down(&self, m: &SchemaManager) -> Result<(), DbErr> {
|
|
||||||
m.alter_table(
|
|
||||||
Table::alter()
|
|
||||||
.table(ParkingSpace::ParkingSpaces)
|
|
||||||
.drop_column(ParkingSpace::Spot)
|
|
||||||
.to_owned(),
|
|
||||||
)
|
|
||||||
.await?;
|
|
||||||
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,5 +1,5 @@
|
|||||||
use actix_web::web::{scope, Data, Form, ServiceConfig};
|
use actix_web::get;
|
||||||
use actix_web::{get, post, HttpResponse};
|
use actix_web::web::{scope, Data, ServiceConfig};
|
||||||
use askama_actix::Template;
|
use askama_actix::Template;
|
||||||
use oswilno_contract::accounts;
|
use oswilno_contract::accounts;
|
||||||
use oswilno_contract::parking_space_rents;
|
use oswilno_contract::parking_space_rents;
|
||||||
@ -100,18 +100,3 @@ async fn load_parking_spaces(db: Arc<DatabaseConnection>) -> AllParkingSpace {
|
|||||||
parking_space_by_id,
|
parking_space_by_id,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, serde::Deserialize)]
|
|
||||||
struct CreateParkingSpace {
|
|
||||||
location: String,
|
|
||||||
spot: Option<u32>,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[post("/parking-spaces")]
|
|
||||||
async fn create(
|
|
||||||
db: Data<sea_orm::DatabaseConnection>,
|
|
||||||
p: Form<CreateParkingSpace>,
|
|
||||||
) -> HttpResponse {
|
|
||||||
let p = p.into_inner();
|
|
||||||
unreachable!()
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user