Skip to content

Commit

Permalink
Revert sea-orm-codegen
Browse files Browse the repository at this point in the history
  • Loading branch information
tyt2y3 committed Dec 14, 2023
1 parent 94eac96 commit d4f8e72
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 24 deletions.
6 changes: 0 additions & 6 deletions sea-orm-codegen/src/entity/base_entity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,9 @@ pub struct Entity {
pub(crate) relations: Vec<Relation>,
pub(crate) conjunct_relations: Vec<ConjunctRelation>,
pub(crate) primary_keys: Vec<PrimaryKey>,
pub(crate) comment: Option<String>,
}

impl Entity {
pub fn get_table_comment(&self) -> Option<&String> {
self.comment.as_ref()
}

pub fn get_table_name_snake_case(&self) -> String {
self.table_name.to_snake_case()
}
Expand Down Expand Up @@ -323,7 +318,6 @@ mod tests {
primary_keys: vec![PrimaryKey {
name: "id".to_owned(),
}],
comment: None,
}
}

Expand Down
2 changes: 0 additions & 2 deletions sea-orm-codegen/src/entity/transformer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,12 @@ impl EntityTransformer {
.collect::<Vec<_>>()
}),
);
let comment = table_create.get_comment().cloned();
let entity = Entity {
table_name: table_name.clone(),
columns,
relations: relations.clone(),
conjunct_relations: vec![],
primary_keys,
comment,
};
entities.insert(table_name.clone(), entity.clone());
for mut rel in relations.into_iter() {
Expand Down
16 changes: 0 additions & 16 deletions sea-orm-codegen/src/entity/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,6 @@ impl EntityWriter {
},
None => quote! {},
};

let extra_derive = with_serde.extra_derive();

quote! {
Expand Down Expand Up @@ -883,11 +882,9 @@ mod tests {
primary_keys: vec![PrimaryKey {
name: "id".to_owned(),
}],
comment: None,
},
Entity {
table_name: "_cake_filling_".to_owned(),
comment: None,
columns: vec![
Column {
name: "cake_id".to_owned(),
Expand Down Expand Up @@ -983,7 +980,6 @@ mod tests {
name: "filling_id".to_owned(),
},
],
comment: None,
},
Entity {
table_name: "filling".to_owned(),
Expand Down Expand Up @@ -1011,7 +1007,6 @@ mod tests {
primary_keys: vec![PrimaryKey {
name: "id".to_owned(),
}],
comment: None,
},
Entity {
table_name: "fruit".to_owned(),
Expand Down Expand Up @@ -1066,7 +1061,6 @@ mod tests {
primary_keys: vec![PrimaryKey {
name: "id".to_owned(),
}],
comment: None,
},
Entity {
table_name: "vendor".to_owned(),
Expand Down Expand Up @@ -1108,7 +1102,6 @@ mod tests {
primary_keys: vec![PrimaryKey {
name: "id".to_owned(),
}],
comment: None,
},
Entity {
table_name: "rust_keyword".to_owned(),
Expand Down Expand Up @@ -1266,7 +1259,6 @@ mod tests {
primary_keys: vec![PrimaryKey {
name: "id".to_owned(),
}],
comment: None,
},
Entity {
table_name: "cake_with_float".to_owned(),
Expand Down Expand Up @@ -1311,7 +1303,6 @@ mod tests {
primary_keys: vec![PrimaryKey {
name: "id".to_owned(),
}],
comment: None,
},
Entity {
table_name: "cake_with_double".to_owned(),
Expand Down Expand Up @@ -1356,7 +1347,6 @@ mod tests {
primary_keys: vec![PrimaryKey {
name: "id".to_owned(),
}],
comment: None,
},
Entity {
table_name: "collection".to_owned(),
Expand Down Expand Up @@ -1388,7 +1378,6 @@ mod tests {
primary_keys: vec![PrimaryKey {
name: "id".to_owned(),
}],
comment: None,
},
Entity {
table_name: "collection_float".to_owned(),
Expand Down Expand Up @@ -1420,7 +1409,6 @@ mod tests {
primary_keys: vec![PrimaryKey {
name: "id".to_owned(),
}],
comment: None,
},
]
}
Expand Down Expand Up @@ -1782,7 +1770,6 @@ mod tests {
fn test_gen_with_seaography() -> io::Result<()> {
let cake_entity = Entity {
table_name: "cake".to_owned(),
comment: None,
columns: vec![
Column {
name: "id".to_owned(),
Expand Down Expand Up @@ -2238,7 +2225,6 @@ mod tests {
primary_keys: vec![PrimaryKey {
name: "id".to_owned(),
}],
comment: None,
},
];
const ENTITY_FILES: [&str; 1] = [include_str!("../../tests/postgres/binary_json.rs")];
Expand Down Expand Up @@ -2322,7 +2308,6 @@ mod tests {
let entities = vec![
Entity {
table_name: "tea_pairing".to_owned(),
comment: None,
columns: vec![
Column {
name: "id".to_owned(),
Expand Down Expand Up @@ -2366,7 +2351,6 @@ mod tests {
},
Entity {
table_name: "tea_pairing_with_size".to_owned(),
comment: None,
columns: vec![
Column {
name: "id".to_owned(),
Expand Down

0 comments on commit d4f8e72

Please sign in to comment.