diff --git a/src/code.rs b/src/code.rs index 7a263e78..b4388310 100644 --- a/src/code.rs +++ b/src/code.rs @@ -213,6 +213,8 @@ impl<'a> Struct<'a> { if !self.table.foreign_keys.is_empty() { derives_vec.extend_from_slice(&[derives::ASSOCIATIONS, derives::IDENTIFIABLE]); + } else if !self.table.primary_key_columns.is_empty() { + derives_vec.push(derives::IDENTIFIABLE); } } StructType::Update => { diff --git a/test/advanced_queries/models/todos/generated.rs b/test/advanced_queries/models/todos/generated.rs index 86b4202d..af9bfd10 100644 --- a/test/advanced_queries/models/todos/generated.rs +++ b/test/advanced_queries/models/todos/generated.rs @@ -7,7 +7,7 @@ use crate::schema::*; pub type ConnectionType = diesel::r2d2::PooledConnection>; /// Struct representing a row in table `todos` -#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName)] +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName, diesel::Identifiable)] #[diesel(table_name=todos, primary_key(id))] pub struct Todos { /// Field representing column `id` diff --git a/test/autogenerated_all/models/todos/generated.rs b/test/autogenerated_all/models/todos/generated.rs index f2739530..0011bd27 100644 --- a/test/autogenerated_all/models/todos/generated.rs +++ b/test/autogenerated_all/models/todos/generated.rs @@ -7,7 +7,7 @@ use crate::schema::*; pub type ConnectionType = diesel::r2d2::PooledConnection>; /// Struct representing a row in table `todos` -#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName)] +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName, diesel::Identifiable)] #[diesel(table_name=todos, primary_key(id))] pub struct Todos { /// Field representing column `id` diff --git a/test/autogenerated_attributes/models/todos/generated.rs b/test/autogenerated_attributes/models/todos/generated.rs index b30d19ad..a6d97825 100644 --- a/test/autogenerated_attributes/models/todos/generated.rs +++ b/test/autogenerated_attributes/models/todos/generated.rs @@ -7,7 +7,7 @@ use crate::schema::*; pub type ConnectionType = diesel::r2d2::PooledConnection>; /// Struct representing a row in table `todos` -#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName)] +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName, diesel::Identifiable)] #[diesel(table_name=todos, primary_key(id))] pub struct Todos { /// Field representing column `id` diff --git a/test/autogenerated_primary_keys/models/todos/generated.rs b/test/autogenerated_primary_keys/models/todos/generated.rs index 6e41bd91..2fee7b85 100644 --- a/test/autogenerated_primary_keys/models/todos/generated.rs +++ b/test/autogenerated_primary_keys/models/todos/generated.rs @@ -7,7 +7,7 @@ use crate::schema::*; pub type ConnectionType = diesel::r2d2::PooledConnection>; /// Struct representing a row in table `todos` -#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName)] +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName, diesel::Identifiable)] #[diesel(table_name=todos, primary_key(id))] pub struct Todos { /// Field representing column `id` diff --git a/test/cleanup_generated_content/models/todos/generated.rs b/test/cleanup_generated_content/models/todos/generated.rs index 3fab8013..c6db004b 100644 --- a/test/cleanup_generated_content/models/todos/generated.rs +++ b/test/cleanup_generated_content/models/todos/generated.rs @@ -7,7 +7,7 @@ use crate::schema::*; pub type ConnectionType = diesel::r2d2::PooledConnection>; /// Struct representing a row in table `todos` -#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName)] +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName, diesel::Identifiable)] #[diesel(table_name=todos, primary_key(id))] pub struct Todos { /// Field representing column `id` diff --git a/test/create_update_bytes_cow/models/todos/generated.rs b/test/create_update_bytes_cow/models/todos/generated.rs index 7ed4d487..bb61dacc 100644 --- a/test/create_update_bytes_cow/models/todos/generated.rs +++ b/test/create_update_bytes_cow/models/todos/generated.rs @@ -7,7 +7,7 @@ use crate::schema::*; pub type ConnectionType = diesel::r2d2::PooledConnection>; /// Struct representing a row in table `todos` -#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName)] +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName, diesel::Identifiable)] #[diesel(table_name=todos, primary_key(data))] pub struct Todos { /// Field representing column `data` diff --git a/test/create_update_bytes_slice/models/todos/generated.rs b/test/create_update_bytes_slice/models/todos/generated.rs index 258d90e9..8ca6fd7e 100644 --- a/test/create_update_bytes_slice/models/todos/generated.rs +++ b/test/create_update_bytes_slice/models/todos/generated.rs @@ -7,7 +7,7 @@ use crate::schema::*; pub type ConnectionType = diesel::r2d2::PooledConnection>; /// Struct representing a row in table `todos` -#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName)] +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName, diesel::Identifiable)] #[diesel(table_name=todos, primary_key(data))] pub struct Todos { /// Field representing column `data` diff --git a/test/create_update_str_cow/models/todos/generated.rs b/test/create_update_str_cow/models/todos/generated.rs index 94674ecd..55f6b561 100644 --- a/test/create_update_str_cow/models/todos/generated.rs +++ b/test/create_update_str_cow/models/todos/generated.rs @@ -7,7 +7,7 @@ use crate::schema::*; pub type ConnectionType = diesel::r2d2::PooledConnection>; /// Struct representing a row in table `todos` -#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName)] +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName, diesel::Identifiable)] #[diesel(table_name=todos, primary_key(text))] pub struct Todos { /// Field representing column `text` diff --git a/test/create_update_str_str/models/todos/generated.rs b/test/create_update_str_str/models/todos/generated.rs index 2a752d0a..81d5751c 100644 --- a/test/create_update_str_str/models/todos/generated.rs +++ b/test/create_update_str_str/models/todos/generated.rs @@ -7,7 +7,7 @@ use crate::schema::*; pub type ConnectionType = diesel::r2d2::PooledConnection>; /// Struct representing a row in table `todos` -#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName)] +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName, diesel::Identifiable)] #[diesel(table_name=todos, primary_key(text))] pub struct Todos { /// Field representing column `text` diff --git a/test/custom_model_and_schema_path/data/models/table_a/generated.rs b/test/custom_model_and_schema_path/data/models/table_a/generated.rs index 51550bb0..1a779035 100644 --- a/test/custom_model_and_schema_path/data/models/table_a/generated.rs +++ b/test/custom_model_and_schema_path/data/models/table_a/generated.rs @@ -7,7 +7,7 @@ use crate::data::schema::*; pub type ConnectionType = diesel::r2d2::PooledConnection>; /// Struct representing a row in table `tableA` -#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName)] +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName, diesel::Identifiable)] #[diesel(table_name=tableA, primary_key(_id))] pub struct TableA { /// Field representing column `_id` diff --git a/test/custom_model_path/models/table_a/generated.rs b/test/custom_model_path/models/table_a/generated.rs index ec14d67a..c2de061e 100644 --- a/test/custom_model_path/models/table_a/generated.rs +++ b/test/custom_model_path/models/table_a/generated.rs @@ -7,7 +7,7 @@ use crate::schema::*; pub type ConnectionType = diesel::r2d2::PooledConnection>; /// Struct representing a row in table `tableA` -#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName)] +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName, diesel::Identifiable)] #[diesel(table_name=tableA, primary_key(_id))] pub struct TableA { /// Field representing column `_id` diff --git a/test/manual_primary_keys/models/todos/generated.rs b/test/manual_primary_keys/models/todos/generated.rs index e95a7237..9dcec039 100644 --- a/test/manual_primary_keys/models/todos/generated.rs +++ b/test/manual_primary_keys/models/todos/generated.rs @@ -7,7 +7,7 @@ use crate::schema::*; pub type ConnectionType = diesel::r2d2::PooledConnection>; /// Struct representing a row in table `todos` -#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName)] +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName, diesel::Identifiable)] #[diesel(table_name=todos, primary_key(id))] pub struct Todos { /// Field representing column `id` diff --git a/test/multiple_primary_keys/models/users/generated.rs b/test/multiple_primary_keys/models/users/generated.rs index c89ea257..1c833653 100644 --- a/test/multiple_primary_keys/models/users/generated.rs +++ b/test/multiple_primary_keys/models/users/generated.rs @@ -7,7 +7,7 @@ use crate::schema::*; pub type ConnectionType = diesel::r2d2::PooledConnection>; /// Struct representing a row in table `users` -#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName)] +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName, diesel::Identifiable)] #[diesel(table_name=users, primary_key(name,address))] pub struct Users { /// Field representing column `name` diff --git a/test/no_default_features/models/todos/generated.rs b/test/no_default_features/models/todos/generated.rs index 464c9253..74dcf750 100644 --- a/test/no_default_features/models/todos/generated.rs +++ b/test/no_default_features/models/todos/generated.rs @@ -7,7 +7,7 @@ use crate::schema::*; pub type ConnectionType = diesel::r2d2::PooledConnection>; /// Struct representing a row in table `todos` -#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable)] +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::Identifiable)] #[diesel(table_name=todos, primary_key(id))] pub struct Todos { /// Field representing column `id` diff --git a/test/once_common_structs/models/table1/generated.rs b/test/once_common_structs/models/table1/generated.rs index afda5bc2..a0f8efa3 100644 --- a/test/once_common_structs/models/table1/generated.rs +++ b/test/once_common_structs/models/table1/generated.rs @@ -8,7 +8,7 @@ use crate::models::common::*; pub type ConnectionType = diesel::r2d2::PooledConnection>; /// Struct representing a row in table `table1` -#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName)] +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName, diesel::Identifiable)] #[diesel(table_name=table1, primary_key(id))] pub struct Table1 { /// Field representing column `id` diff --git a/test/once_common_structs/models/table2/generated.rs b/test/once_common_structs/models/table2/generated.rs index 28acc135..c6d604a6 100644 --- a/test/once_common_structs/models/table2/generated.rs +++ b/test/once_common_structs/models/table2/generated.rs @@ -8,7 +8,7 @@ use crate::models::common::*; pub type ConnectionType = diesel::r2d2::PooledConnection>; /// Struct representing a row in table `table2` -#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName)] +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName, diesel::Identifiable)] #[diesel(table_name=table2, primary_key(id))] pub struct Table2 { /// Field representing column `id` diff --git a/test/once_common_structs_once_connection_type/models/table1/generated.rs b/test/once_common_structs_once_connection_type/models/table1/generated.rs index 82f08d9f..f787e25f 100644 --- a/test/once_common_structs_once_connection_type/models/table1/generated.rs +++ b/test/once_common_structs_once_connection_type/models/table1/generated.rs @@ -6,7 +6,7 @@ use crate::schema::*; use crate::models::common::*; /// Struct representing a row in table `table1` -#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName)] +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName, diesel::Identifiable)] #[diesel(table_name=table1, primary_key(id))] pub struct Table1 { /// Field representing column `id` diff --git a/test/once_common_structs_once_connection_type/models/table2/generated.rs b/test/once_common_structs_once_connection_type/models/table2/generated.rs index 1d3cdcde..639ab7e8 100644 --- a/test/once_common_structs_once_connection_type/models/table2/generated.rs +++ b/test/once_common_structs_once_connection_type/models/table2/generated.rs @@ -6,7 +6,7 @@ use crate::schema::*; use crate::models::common::*; /// Struct representing a row in table `table2` -#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName)] +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName, diesel::Identifiable)] #[diesel(table_name=table2, primary_key(id))] pub struct Table2 { /// Field representing column `id` diff --git a/test/once_common_structs_once_connection_type_single_file/models/table1.rs b/test/once_common_structs_once_connection_type_single_file/models/table1.rs index 82f08d9f..f787e25f 100644 --- a/test/once_common_structs_once_connection_type_single_file/models/table1.rs +++ b/test/once_common_structs_once_connection_type_single_file/models/table1.rs @@ -6,7 +6,7 @@ use crate::schema::*; use crate::models::common::*; /// Struct representing a row in table `table1` -#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName)] +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName, diesel::Identifiable)] #[diesel(table_name=table1, primary_key(id))] pub struct Table1 { /// Field representing column `id` diff --git a/test/once_common_structs_once_connection_type_single_file/models/table2.rs b/test/once_common_structs_once_connection_type_single_file/models/table2.rs index 1d3cdcde..639ab7e8 100644 --- a/test/once_common_structs_once_connection_type_single_file/models/table2.rs +++ b/test/once_common_structs_once_connection_type_single_file/models/table2.rs @@ -6,7 +6,7 @@ use crate::schema::*; use crate::models::common::*; /// Struct representing a row in table `table2` -#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName)] +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName, diesel::Identifiable)] #[diesel(table_name=table2, primary_key(id))] pub struct Table2 { /// Field representing column `id` diff --git a/test/once_connection_type/models/table1/generated.rs b/test/once_connection_type/models/table1/generated.rs index 082ce697..080f33a5 100644 --- a/test/once_connection_type/models/table1/generated.rs +++ b/test/once_connection_type/models/table1/generated.rs @@ -6,7 +6,7 @@ use crate::schema::*; use crate::models::common::*; /// Struct representing a row in table `table1` -#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName)] +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName, diesel::Identifiable)] #[diesel(table_name=table1, primary_key(id))] pub struct Table1 { /// Field representing column `id` diff --git a/test/once_connection_type/models/table2/generated.rs b/test/once_connection_type/models/table2/generated.rs index 51c88e3a..d4981b43 100644 --- a/test/once_connection_type/models/table2/generated.rs +++ b/test/once_connection_type/models/table2/generated.rs @@ -6,7 +6,7 @@ use crate::schema::*; use crate::models::common::*; /// Struct representing a row in table `table2` -#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName)] +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName, diesel::Identifiable)] #[diesel(table_name=table2, primary_key(id))] pub struct Table2 { /// Field representing column `id` diff --git a/test/postgres_array_column/models/user/generated.rs b/test/postgres_array_column/models/user/generated.rs index 6f621421..6a92dd59 100644 --- a/test/postgres_array_column/models/user/generated.rs +++ b/test/postgres_array_column/models/user/generated.rs @@ -7,7 +7,7 @@ use crate::schema::*; pub type ConnectionType = diesel::r2d2::PooledConnection>; /// Struct representing a row in table `user` -#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName)] +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName, diesel::Identifiable)] #[diesel(table_name=user, primary_key(id))] pub struct User { /// Field representing column `id` diff --git a/test/readonly/models/normal/generated.rs b/test/readonly/models/normal/generated.rs index 00e173fe..8b46fb80 100644 --- a/test/readonly/models/normal/generated.rs +++ b/test/readonly/models/normal/generated.rs @@ -7,7 +7,7 @@ use crate::schema::*; pub type ConnectionType = diesel::r2d2::PooledConnection>; /// Struct representing a row in table `normal` -#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName)] +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName, diesel::Identifiable)] #[diesel(table_name=normal, primary_key(id))] pub struct Normal { /// Field representing column `id` diff --git a/test/readonly/models/prefix_table/generated.rs b/test/readonly/models/prefix_table/generated.rs index 1351168d..7195dee6 100644 --- a/test/readonly/models/prefix_table/generated.rs +++ b/test/readonly/models/prefix_table/generated.rs @@ -7,7 +7,7 @@ use crate::schema::*; pub type ConnectionType = diesel::r2d2::PooledConnection>; /// Struct representing a row in table `prefixTable` -#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName)] +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName, diesel::Identifiable)] #[diesel(table_name=prefixTable, primary_key(id))] pub struct PrefixTable { /// Field representing column `id` diff --git a/test/readonly/models/prefix_table_suffix/generated.rs b/test/readonly/models/prefix_table_suffix/generated.rs index 3c3190c0..5bba3113 100644 --- a/test/readonly/models/prefix_table_suffix/generated.rs +++ b/test/readonly/models/prefix_table_suffix/generated.rs @@ -7,7 +7,7 @@ use crate::schema::*; pub type ConnectionType = diesel::r2d2::PooledConnection>; /// Struct representing a row in table `prefixTableSuffix` -#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName)] +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName, diesel::Identifiable)] #[diesel(table_name=prefixTableSuffix, primary_key(id))] pub struct PrefixTableSuffix { /// Field representing column `id` diff --git a/test/readonly/models/table_suffix/generated.rs b/test/readonly/models/table_suffix/generated.rs index cf2a6ec8..b4717cc5 100644 --- a/test/readonly/models/table_suffix/generated.rs +++ b/test/readonly/models/table_suffix/generated.rs @@ -7,7 +7,7 @@ use crate::schema::*; pub type ConnectionType = diesel::r2d2::PooledConnection>; /// Struct representing a row in table `tableSuffix` -#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName)] +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName, diesel::Identifiable)] #[diesel(table_name=tableSuffix, primary_key(id))] pub struct TableSuffix { /// Field representing column `id` diff --git a/test/simple_table_async/models/todos/generated.rs b/test/simple_table_async/models/todos/generated.rs index 2583e238..92281cb4 100644 --- a/test/simple_table_async/models/todos/generated.rs +++ b/test/simple_table_async/models/todos/generated.rs @@ -8,7 +8,7 @@ use crate::schema::*; pub type ConnectionType = diesel_async::pooled_connection::deadpool::Object; /// Struct representing a row in table `todos` -#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName)] +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName, diesel::Identifiable)] #[diesel(table_name=todos, primary_key(id))] pub struct Todos { /// Field representing column `id` diff --git a/test/simple_table_custom_schema_path/models/todos/generated.rs b/test/simple_table_custom_schema_path/models/todos/generated.rs index b54bf349..42de6059 100644 --- a/test/simple_table_custom_schema_path/models/todos/generated.rs +++ b/test/simple_table_custom_schema_path/models/todos/generated.rs @@ -7,7 +7,7 @@ use crate::data::schema::*; pub type ConnectionType = diesel::r2d2::PooledConnection>; /// Struct representing a row in table `todos` -#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName)] +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName, diesel::Identifiable)] #[diesel(table_name=todos, primary_key(id))] pub struct Todos { /// Field representing column `id` diff --git a/test/simple_table_mysql/models/todos/generated.rs b/test/simple_table_mysql/models/todos/generated.rs index c1192352..b19c367d 100644 --- a/test/simple_table_mysql/models/todos/generated.rs +++ b/test/simple_table_mysql/models/todos/generated.rs @@ -5,7 +5,7 @@ use crate::diesel::*; use crate::schema::*; /// Struct representing a row in table `todos` -#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName)] +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName, diesel::Identifiable)] #[diesel(table_name=todos, primary_key(id))] pub struct Todos { /// Field representing column `id` diff --git a/test/simple_table_no_crud/models/todos/generated.rs b/test/simple_table_no_crud/models/todos/generated.rs index 24d04296..0f00ce0d 100644 --- a/test/simple_table_no_crud/models/todos/generated.rs +++ b/test/simple_table_no_crud/models/todos/generated.rs @@ -5,7 +5,7 @@ use crate::diesel::*; use crate::schema::*; /// Struct representing a row in table `todos` -#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName)] +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName, diesel::Identifiable)] #[diesel(table_name=todos, primary_key(id))] pub struct Todos { /// Field representing column `id` diff --git a/test/simple_table_no_serde/models/todos/generated.rs b/test/simple_table_no_serde/models/todos/generated.rs index 08e61bff..d026655f 100644 --- a/test/simple_table_no_serde/models/todos/generated.rs +++ b/test/simple_table_no_serde/models/todos/generated.rs @@ -7,7 +7,7 @@ use crate::schema::*; pub type ConnectionType = diesel::r2d2::PooledConnection>; /// Struct representing a row in table `todos` -#[derive(Debug, Clone, diesel::Queryable, diesel::Selectable, diesel::QueryableByName)] +#[derive(Debug, Clone, diesel::Queryable, diesel::Selectable, diesel::QueryableByName, diesel::Identifiable)] #[diesel(table_name=todos, primary_key(id))] pub struct Todos { /// Field representing column `id` diff --git a/test/simple_table_pg/models/todos/generated.rs b/test/simple_table_pg/models/todos/generated.rs index 727efc5c..ed6ba5dc 100644 --- a/test/simple_table_pg/models/todos/generated.rs +++ b/test/simple_table_pg/models/todos/generated.rs @@ -7,7 +7,7 @@ use crate::schema::*; pub type ConnectionType = diesel::r2d2::PooledConnection>; /// Struct representing a row in table `todos` -#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName)] +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName, diesel::Identifiable)] #[diesel(table_name=todos, primary_key(id))] pub struct Todos { /// Field representing column `id` diff --git a/test/simple_table_sqlite/models/todos/generated.rs b/test/simple_table_sqlite/models/todos/generated.rs index eccd751b..447c83de 100644 --- a/test/simple_table_sqlite/models/todos/generated.rs +++ b/test/simple_table_sqlite/models/todos/generated.rs @@ -7,7 +7,7 @@ use crate::schema::*; pub type ConnectionType = diesel::r2d2::PooledConnection>; /// Struct representing a row in table `todos` -#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName)] +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName, diesel::Identifiable)] #[diesel(table_name=todos, primary_key(id))] pub struct Todos { /// Field representing column `id` diff --git a/test/single_model_file/models/table1.rs b/test/single_model_file/models/table1.rs index 3a9e1835..53ca10d4 100644 --- a/test/single_model_file/models/table1.rs +++ b/test/single_model_file/models/table1.rs @@ -7,7 +7,7 @@ use crate::schema::*; pub type ConnectionType = diesel::r2d2::PooledConnection>; /// Struct representing a row in table `table1` -#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName)] +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName, diesel::Identifiable)] #[diesel(table_name=table1, primary_key(id))] pub struct Table1 { /// Field representing column `id` diff --git a/test/single_model_file/models/table2.rs b/test/single_model_file/models/table2.rs index 6fad4f9e..cbc08c3e 100644 --- a/test/single_model_file/models/table2.rs +++ b/test/single_model_file/models/table2.rs @@ -7,7 +7,7 @@ use crate::schema::*; pub type ConnectionType = diesel::r2d2::PooledConnection>; /// Struct representing a row in table `table2` -#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName)] +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName, diesel::Identifiable)] #[diesel(table_name=table2, primary_key(id))] pub struct Table2 { /// Field representing column `id` diff --git a/test/use_statements/models/fang_tasks/generated.rs b/test/use_statements/models/fang_tasks/generated.rs index 987c12b7..de9fd226 100644 --- a/test/use_statements/models/fang_tasks/generated.rs +++ b/test/use_statements/models/fang_tasks/generated.rs @@ -7,7 +7,7 @@ use crate::schema::*; pub type ConnectionType = diesel::r2d2::PooledConnection>; /// Struct representing a row in table `fang_tasks` -#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName)] +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::Queryable, diesel::Selectable, diesel::QueryableByName, diesel::Identifiable)] #[diesel(table_name=fang_tasks, primary_key(id))] pub struct FangTasks { /// Field representing column `id`