Expand Index struct to also get the original field name
This is needed in postgres, since we store data as jsonb so struct fields can't get renamed Signed-off-by: Lee Smet <lee.smet@hotmail.com>
This commit is contained in:
@@ -83,6 +83,11 @@ pub trait Index {
|
||||
|
||||
/// The key of this index
|
||||
fn key() -> &'static str;
|
||||
|
||||
/// The original field name. This is the same as [Index::key] by default, unless the user
|
||||
/// specified a `(name=...)` value to the index attribute, in which case [Index::key] will be
|
||||
/// set to the specified key.
|
||||
fn field_name() -> &'static str;
|
||||
}
|
||||
|
||||
/// Base struct that all models should include
|
||||
|
Reference in New Issue
Block a user