Skip to content

Commit

Permalink
Revert "vingo: use time with timezone for seasons start and end"
Browse files Browse the repository at this point in the history
This reverts commit 363c99d.
  • Loading branch information
xerbalind committed Dec 5, 2024
1 parent 363c99d commit f302fcc
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 62 deletions.
2 changes: 0 additions & 2 deletions vingo/migration/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ mod m20240829_234032_create_card;
mod m20240903_194156_create_scan;
mod m20240909_195645_create_days;
mod m20240909_214352_create_seasons;
mod m20241205_210208_add_timezone;

pub struct Migrator;

Expand All @@ -18,7 +17,6 @@ impl MigratorTrait for Migrator {
Box::new(m20240903_194156_create_scan::Migration),
Box::new(m20240909_195645_create_days::Migration),
Box::new(m20240909_214352_create_seasons::Migration),
Box::new(m20241205_210208_add_timezone::Migration),
]
}
}
46 changes: 0 additions & 46 deletions vingo/migration/src/m20241205_210208_add_timezone.rs

This file was deleted.

2 changes: 1 addition & 1 deletion vingo/src/entities/card.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.0
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.1
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
Expand Down
2 changes: 1 addition & 1 deletion vingo/src/entities/day.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.0
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.1
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
Expand Down
2 changes: 1 addition & 1 deletion vingo/src/entities/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.0
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.1
pub mod prelude;

Expand Down
2 changes: 1 addition & 1 deletion vingo/src/entities/prelude.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.0
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.1
pub use super::card::Entity as Card;
pub use super::day::Entity as Day;
Expand Down
2 changes: 1 addition & 1 deletion vingo/src/entities/scan.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.0
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.1
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
Expand Down
6 changes: 3 additions & 3 deletions vingo/src/entities/season.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.0
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.1
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
Expand All @@ -10,8 +10,8 @@ pub struct Model {
pub id: i32,
#[sea_orm(column_type = "Text")]
pub name: String,
pub start: DateTimeWithTimeZone,
pub end: DateTimeWithTimeZone,
pub start: Date,
pub end: Date,
}

#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
Expand Down
2 changes: 1 addition & 1 deletion vingo/src/entities/user.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.0
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.1
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
Expand Down
11 changes: 6 additions & 5 deletions vingo/src/routes/seasons.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ use axum::{
extract::{Path, State},
Json,
};
use chrono::NaiveDate;

use reqwest::StatusCode;
use sea_orm::{prelude::DateTimeWithTimeZone, sea_query::Expr, DatabaseConnection};
use sea_orm::{sea_query::Expr, DatabaseConnection};
use sea_orm::{
ActiveModelTrait, EntityTrait, FromQueryResult, QueryFilter, QuerySelect, QueryTrait, Set,
};
Expand All @@ -21,8 +22,8 @@ use super::util::errors::{ResponseResult, ResultAndLogError};
pub struct SeasonGet {
id: i32,
name: String,
start: DateTimeWithTimeZone,
end: DateTimeWithTimeZone,
start: NaiveDate,
end: NaiveDate,
is_current: bool,
}

Expand Down Expand Up @@ -55,8 +56,8 @@ pub async fn db_seasons(db: &DatabaseConnection, future: bool) -> ResponseResult
#[derive(Debug, Serialize, Deserialize)]
pub struct SeasonAddBody {
name: String,
start: DateTimeWithTimeZone,
end: DateTimeWithTimeZone,
start: NaiveDate,
end: NaiveDate,
}
pub async fn add(
state: State<AppState>,
Expand Down

0 comments on commit f302fcc

Please sign in to comment.