Skip to content

Commit

Permalink
Add entities for user migration
Browse files Browse the repository at this point in the history
This was generated using 'sea-orm-cli generate entity --output-dir
../qb-entity/src --lib' inside of crates/qb-backend.
  • Loading branch information
lbirkert committed Aug 17, 2023
1 parent d7386f2 commit f55f299
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 22 deletions.
25 changes: 3 additions & 22 deletions crates/qb-entity/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,24 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-only
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.2

// ████████████████████████████████████████████████
// █─▄▄▄─█▄─██─▄█▄─▄█▄─▀─▄█▄─▄─▀█▄─█─▄█─▄─▄─█▄─▄▄─█
// █─██▀─██─██─███─███▀─▀███─▄─▀██▄─▄████─████─▄█▀█
// ▀───▄▄▀▀▄▄▄▄▀▀▄▄▄▀▄▄█▄▄▀▄▄▄▄▀▀▀▄▄▄▀▀▀▄▄▄▀▀▄▄▄▄▄▀
// https://github.com/QuixByte/qb/blob/main/LICENSE
//
// (c) Copyright 2023 The QuixByte Authors
pub mod prelude;

pub fn add(left: usize, right: usize) -> usize {
left + right
}

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn it_works() {
let result = add(2, 2);
assert_eq!(result, 4);
}
}
pub mod user;
3 changes: 3 additions & 0 deletions crates/qb-entity/src/prelude.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.2

pub use super::user::Entity as User;
18 changes: 18 additions & 0 deletions crates/qb-entity/src/user.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.2

use sea_orm::entity::prelude::*;

#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "user")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: i32,
pub name: String,
pub display_name: String,
pub password: String,
}

#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {}

impl ActiveModelBehavior for ActiveModel {}

0 comments on commit f55f299

Please sign in to comment.