items_prices.rs 940 B

123456789101112131415161718192021222324252627282930313233343536
  1. //! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.11
  2. use sea_orm::entity::prelude::*;
  3. #[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
  4. #[sea_orm(table_name = "items_prices")]
  5. pub struct Model {
  6. #[sea_orm(primary_key)]
  7. pub id: i64,
  8. #[sea_orm(column_type = "Text")]
  9. pub item_name: String,
  10. #[sea_orm(column_type = "Text", nullable)]
  11. pub item_price: Option<String>,
  12. pub user_created_id: i64,
  13. pub time_created: DateTimeWithTimeZone,
  14. }
  15. #[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
  16. pub enum Relation {
  17. #[sea_orm(
  18. belongs_to = "super::users::Entity",
  19. from = "Column::UserCreatedId",
  20. to = "super::users::Column::Id",
  21. on_update = "NoAction",
  22. on_delete = "NoAction"
  23. )]
  24. Users,
  25. }
  26. impl Related<super::users::Entity> for Entity {
  27. fn to() -> RelationDef {
  28. Relation::Users.def()
  29. }
  30. }
  31. impl ActiveModelBehavior for ActiveModel {}