WIP: In activity table, remove user_id column and add activity_id #98

Closed
nutomic wants to merge 1 commits from activity-columns into main
nutomic commented 1 year ago
Owner

I tried to implement a DB migration, but I'm stuck with an error now. No idea why its happening, I didnt change any json or bool columns.

Checking lemmy_db v0.1.0 (/home/felix/workspace/lemmy/server/lemmy_db)
error[E0277]: the trait bound `serde_json::Value: diesel::deserialize::FromSql<diesel::sql_types::Bool, _>` is not satisfied
--> lemmy_db/src/activity.rs:34:24
|
34 |     activity.find(aid).first::<Self>(conn)
|                        ^^^^^ the trait `diesel::deserialize::FromSql<diesel::sql_types::Bool, _>` is not implemented for `serde_json::Value`
|
= help: the following implementations were found:
<serde_json::Value as diesel::deserialize::FromSql<diesel::sql_types::Json, diesel::pg::Pg>>
<serde_json::Value as diesel::deserialize::FromSql<diesel::sql_types::Jsonb, diesel::pg::Pg>>
= note: required because of the requirements on the impl of `diesel::Queryable<diesel::sql_types::Bool, _>` for `serde_json::Value`
= note: required because of the requirements on the impl of `diesel::Queryable<(diesel::sql_types::Integer, diesel::sql_types::Jsonb, diesel::sql_types::Bool, diesel::sql_types::Timestamp, diesel::sql_types::Nullable<diesel::sql_types::Timestamp>, diesel::sql_types::Nullable<diesel::sql_types::Text>), _>` for `(i32, std::string::String, serde_json::Value, bool, chrono::NaiveDateTime, std::option::Option<chrono::NaiveDateTime>)`
= note: required because of the requirements on the impl of `diesel::Queryable<(diesel::sql_types::Integer, diesel::sql_types::Jsonb, diesel::sql_types::Bool, diesel::sql_types::Timestamp, diesel::sql_types::Nullable<diesel::sql_types::Timestamp>, diesel::sql_types::Nullable<diesel::sql_types::Text>), _>` for `activity::Activity`
= note: required because of the requirements on the impl of `diesel::query_dsl::LoadQuery<_, activity::Activity>` for `diesel::query_builder::SelectStatement<schema::activity::table, diesel::query_builder::select_clause::DefaultSelectClause, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::operators::Eq<schema::activity::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_clause::LimitClause<diesel::expression::bound::Bound<diesel::sql_types::BigInt, i64>>>`

error: could not compile `lemmy_db`.

To learn more, run the command again with --verbose.
I tried to implement a DB migration, but I'm stuck with an error now. No idea why its happening, I didnt change any json or bool columns. ``` Checking lemmy_db v0.1.0 (/home/felix/workspace/lemmy/server/lemmy_db) error[E0277]: the trait bound `serde_json::Value: diesel::deserialize::FromSql<diesel::sql_types::Bool, _>` is not satisfied --> lemmy_db/src/activity.rs:34:24 | 34 | activity.find(aid).first::<Self>(conn) | ^^^^^ the trait `diesel::deserialize::FromSql<diesel::sql_types::Bool, _>` is not implemented for `serde_json::Value` | = help: the following implementations were found: <serde_json::Value as diesel::deserialize::FromSql<diesel::sql_types::Json, diesel::pg::Pg>> <serde_json::Value as diesel::deserialize::FromSql<diesel::sql_types::Jsonb, diesel::pg::Pg>> = note: required because of the requirements on the impl of `diesel::Queryable<diesel::sql_types::Bool, _>` for `serde_json::Value` = note: required because of the requirements on the impl of `diesel::Queryable<(diesel::sql_types::Integer, diesel::sql_types::Jsonb, diesel::sql_types::Bool, diesel::sql_types::Timestamp, diesel::sql_types::Nullable<diesel::sql_types::Timestamp>, diesel::sql_types::Nullable<diesel::sql_types::Text>), _>` for `(i32, std::string::String, serde_json::Value, bool, chrono::NaiveDateTime, std::option::Option<chrono::NaiveDateTime>)` = note: required because of the requirements on the impl of `diesel::Queryable<(diesel::sql_types::Integer, diesel::sql_types::Jsonb, diesel::sql_types::Bool, diesel::sql_types::Timestamp, diesel::sql_types::Nullable<diesel::sql_types::Timestamp>, diesel::sql_types::Nullable<diesel::sql_types::Text>), _>` for `activity::Activity` = note: required because of the requirements on the impl of `diesel::query_dsl::LoadQuery<_, activity::Activity>` for `diesel::query_builder::SelectStatement<schema::activity::table, diesel::query_builder::select_clause::DefaultSelectClause, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::operators::Eq<schema::activity::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_clause::LimitClause<diesel::expression::bound::Bound<diesel::sql_types::BigInt, i64>>>` error: could not compile `lemmy_db`. To learn more, run the command again with --verbose. ```
nutomic closed this pull request 1 year ago
Please reopen this pull request to perform a merge.
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

This pull request currently doesn't have any dependencies.

Loading…
There is no content yet.