fix parsing
This commit is contained in:
33
goal-examples/webapp/models.bl
Normal file
33
goal-examples/webapp/models.bl
Normal file
@@ -0,0 +1,33 @@
|
||||
import uuid as uuid;
|
||||
import orm as orm;
|
||||
|
||||
|
||||
#[derive(DeepCopy, Debug, PartialEq, DeriveEntityModel)]
|
||||
#[orm::model(table_name = "user")]
|
||||
pub type User struct {
|
||||
#[orm::model(primary_key)]
|
||||
pub id: uuid::UUID;
|
||||
#[orm::model(unique, column_type = "VARCHAR(256)")]
|
||||
pub email: String;
|
||||
#[orm::model(nullable)]
|
||||
pub password_hash: Option[String];
|
||||
}
|
||||
|
||||
#[derive(DeepCopy, Debug, PartialEq, DeriveEntityModel)]
|
||||
#[orm::model(table_name = "todo")]
|
||||
pub type Todo struct {
|
||||
#[orm::model(primary_key)]
|
||||
pub id: uuid::UUID;
|
||||
|
||||
#[orm::model(foreign_key = "user", on_delete="CASCADE")]
|
||||
pub user_id: uuid::UUID;
|
||||
|
||||
#[orm::model(column_type = "VARCHAR(256)")]
|
||||
pub title: String;
|
||||
|
||||
#[orm::model(column_type = "TEXT")]
|
||||
pub description: String;
|
||||
|
||||
pub created_at: DateTime;
|
||||
pub updated_at: DateTime;
|
||||
}
|
||||
Reference in New Issue
Block a user