2020-11-28 11:12:32 +00:00
import Config
2020-11-06 17:57:15 +00:00
2020-12-21 15:52:33 +00:00
#### Base configuration
# Choose password hashing backend
# Note that this corresponds with our dependencies in mix.exs
hasher = if config_env ( ) in [ :dev , :test ] , do : Pbkdf2 , else : Argon2
config :bonfire_data_identity , Bonfire.Data.Identity.Credential ,
hasher_module : hasher
2020-12-10 12:50:56 +00:00
#### Sentinel Data Services
2020-11-06 17:57:15 +00:00
2021-06-15 18:48:36 +00:00
# Search these apps/extensions for Pointable ecto schema definitions to index
pointable_schema_extensions = [
2020-11-28 11:12:32 +00:00
:bonfire_data_access_control ,
2020-12-10 12:50:56 +00:00
:bonfire_data_activity_pub ,
2020-11-28 11:12:32 +00:00
:bonfire_data_identity ,
:bonfire_data_social ,
2020-11-07 14:05:06 +00:00
:bonfire ,
2020-12-29 11:31:27 +00:00
:bonfire_quantify ,
:bonfire_geolocate ,
:bonfire_valueflows ,
:bonfire_tag ,
2021-01-02 16:02:47 +00:00
:bonfire_classify ,
:bonfire_data_shared_users ,
2021-05-29 16:34:44 +00:00
:bonfire_files
2020-11-06 17:57:15 +00:00
]
2021-06-15 18:48:36 +00:00
config :pointers , :search_path , pointable_schema_extensions
# Search these apps/extensions for context or queries modules to index (i.e. they contain modules with a queries_module/0 or context_modules/0 function)
context_and_queries_extensions = pointable_schema_extensions ++ [
:bonfire_common ,
:bonfire_me ,
:bonfire_social ,
:bonfire_valueflows
]
config :bonfire , :query_modules_search_path , context_and_queries_extensions
config :bonfire , :context_modules_search_path , context_and_queries_extensions
2020-11-06 17:57:15 +00:00
2021-06-15 18:48:36 +00:00
# Search these apps/extensions for Verbs to index (i.e. they contain modules with a declare_verbs/0 function)
2020-12-10 12:50:56 +00:00
config :bonfire_data_access_control ,
search_path : [
2021-06-15 18:48:36 +00:00
# :bonfire_me,
2021-03-16 15:54:01 +00:00
:bonfire_boundaries ,
2021-06-15 18:48:36 +00:00
# :bonfire_social,
# :bonfire,
2020-12-10 12:50:56 +00:00
]
2021-06-01 12:44:06 +00:00
#### Alias modules for readability
alias Pointers . { Pointer , Table }
alias Bonfire.Data.AccessControl . {
Access , Acl , Controlled , InstanceAdmin , Grant , Interact , Verb
}
alias Bonfire.Data.ActivityPub . { Actor , Peer , Peered }
alias Bonfire.Data.Identity . {
Account , Accounted , Caretaker , Character , Credential , Email , Self , User , Named
}
alias Bonfire.Data.Social . {
Activity , Article , Block , Bookmark , Circle , Created , Encircle , Feed , FeedPublish , Inbox , Message , Follow , FollowCount , Boost , BoostCount , Like , LikeCount , Flag , FlagCount , Mention , Post , PostContent , Profile , Replied
}
2020-12-10 12:50:56 +00:00
2020-11-06 17:57:15 +00:00
#### Flexto Stitching
## WARNING: This is the flaky magic bit. We use configuration to
## compile extra stuff into modules. If you add new fields or
## relations to ecto models in a dependency, you must recompile that
## dependency for it to show up! You will probably find you need to
2020-11-30 10:00:11 +00:00
## `rm -Rf _build/*/lib/bonfire_data_*` a lot.
2020-11-06 17:57:15 +00:00
## Note: This does not apply to configuration for
## `Pointers.Changesets`, which is read at runtime, not compile time
2020-12-10 12:50:56 +00:00
# first up, pointers could have all the mixins we're using. TODO
2021-05-22 18:41:36 +00:00
config :pointers , Pointer ,
has_one : [ controlled : { Controlled , foreign_key : :id } ] ,
has_one : [ created : { Created , foreign_key : :id } ] ,
has_one : [ activity : { Activity , foreign_key : :object_id , references : :id } ] , # needs ON clause
has_one : [ post_content : { PostContent , foreign_key : :id } ] ,
has_one : [ like_count : { LikeCount , foreign_key : :id } ] ,
has_many : [ likes : { Like , foreign_key : :liked_id , references : :id } ] ,
has_one : [ my_like : { Like , foreign_key : :liked_id , references : :id } ] ,
has_one : [ my_flag : { Flag , foreign_key : :flagged_id , references : :id } ] ,
has_one : [ replied : { Replied , foreign_key : :id } ] ,
has_many : [ direct_replies : { Replied , foreign_key : :reply_to_id } ] ,
has_one : [ profile : { Profile , foreign_key : :id } ] ,
has_one : [ character : { Character , foreign_key : :id } ] ,
has_one : [ actor : { Actor , foreign_key : :id } ] ,
# add references of tags to any tagged Pointer
many_to_many : [
tags : {
Bonfire.Tag ,
join_through : " bonfire_tagged " ,
unique : true ,
join_keys : [ pointer_id : :id , tag_id : :id ] ,
on_replace : :delete
}
]
2020-12-10 12:50:56 +00:00
config :pointers , Table , [ ]
# now let's weave everything else together for convenience
2020-11-28 11:12:32 +00:00
# bonfire_data_access_control
2020-11-06 17:57:15 +00:00
2020-12-10 12:50:56 +00:00
config :bonfire_data_access_control , Access ,
2021-03-20 13:30:55 +00:00
has_one : [ named : { Named , foreign_key : :id } ] ,
has_one : [ caretaker : { Caretaker , foreign_key : :id } ]
2020-12-10 12:50:56 +00:00
config :bonfire_data_access_control , Acl ,
2021-03-16 15:54:01 +00:00
has_one : [ named : { Named , foreign_key : :id } ] ,
has_one : [ caretaker : { Caretaker , foreign_key : :id } ]
2020-12-10 12:50:56 +00:00
2020-11-28 14:22:03 +00:00
config :bonfire_data_access_control , Controlled , [ ]
2021-03-20 22:21:00 +00:00
config :bonfire_data_access_control , Grant ,
belongs_to : [ subject_character : { Character , foreign_key : :subject_id , define_field : false } ] ,
belongs_to : [ subject_profile : { Profile , foreign_key : :subject_id , define_field : false } ] ,
belongs_to : [ subject_circle : { Circle , foreign_key : :subject_id , define_field : false } ] ,
belongs_to : [ subject_named : { Named , foreign_key : :subject_id , define_field : false } ]
2020-12-01 13:06:01 +00:00
config :bonfire_data_access_control , Interact , [ ]
config :bonfire_data_access_control , Verb , [ ]
2020-11-28 14:22:03 +00:00
# bonfire_data_activity_pub
config :bonfire_data_activity_pub , Actor ,
2021-06-22 20:48:22 +00:00
belongs_to : [ character : { Character , foreign_key : :id , define_field : false } ] ,
has_one : [ peered : { Peered , references : :id , foreign_key : :id } ] ,
2020-11-28 14:22:03 +00:00
belongs_to : [ user : { User , foreign_key : :id , define_field : false } ]
2020-12-10 12:50:56 +00:00
config :bonfire_data_activity_pub , Peer , [ ]
config :bonfire_data_activity_pub , Peered , [ ]
2020-11-28 11:12:32 +00:00
# bonfire_data_identity
2020-11-06 17:57:15 +00:00
2020-11-28 11:12:32 +00:00
config :bonfire_data_identity , Account ,
2021-01-02 16:02:47 +00:00
has_one : [ credential : { Credential , foreign_key : :id } ] ,
has_one : [ email : { Email , foreign_key : :id } ] ,
2021-03-04 15:40:58 +00:00
has_one : [ inbox : { Inbox , foreign_key : :id } ] ,
2021-01-02 16:02:47 +00:00
many_to_many : [ users : { User , join_through : " bonfire_data_identity_accounted " , join_keys : [ account_id : :id , id : :id ] } ] ,
many_to_many : [ shared_users : { User , join_through : " bonfire_data_shared_user_accounts " , join_keys : [ account_id : :id , shared_user_id : :id ] } ]
2020-11-06 17:57:15 +00:00
2020-12-10 12:50:56 +00:00
config :bonfire_data_identity , Accounted ,
belongs_to : [ user : { User , foreign_key : :id , define_field : false } ]
config :bonfire_data_identity , Caretaker , [ ]
2021-01-30 15:48:59 +00:00
config :bonfire_data_identity , Character ,
2021-06-22 20:48:22 +00:00
has_one : [ peered : { Peered , references : :id , foreign_key : :id } ] ,
2021-02-11 09:27:30 +00:00
has_one : [ actor : { Actor , foreign_key : :id } ] ,
2021-04-03 13:27:44 +00:00
has_one : [ profile : { Profile , foreign_key : :id } ] ,
has_one : [ user : { User , foreign_key : :id } ] ,
2021-02-11 09:27:30 +00:00
has_one : [ feed : { Feed , foreign_key : :id } ] ,
2021-03-04 14:23:50 +00:00
has_one : [ inbox : { Inbox , foreign_key : :id } ] ,
2021-02-11 09:27:30 +00:00
has_many : [ feed_publishes : { FeedPublish , references : :id , foreign_key : :feed_id } ] ,
has_many : [ followers : { Follow , foreign_key : :following_id , references : :id } ] ,
has_many : [ followings : { Follow , foreign_key : :follower_id , references : :id } ] ,
has_one : [ follow_count : { FollowCount , foreign_key : :id } ]
2020-11-06 17:57:15 +00:00
2020-11-28 11:12:32 +00:00
config :bonfire_data_identity , Credential ,
2020-12-16 10:33:57 +00:00
belongs_to : [ account : { Account , foreign_key : :id , define_field : false } ]
2020-11-06 17:57:15 +00:00
2020-11-28 11:12:32 +00:00
config :bonfire_data_identity , Email ,
2020-12-16 10:33:57 +00:00
must_confirm : true ,
2020-11-28 11:12:32 +00:00
belongs_to : [ account : { Account , foreign_key : :id , define_field : false } ]
2020-11-06 17:57:15 +00:00
2020-12-16 10:33:57 +00:00
config :bonfire_data_identity , Self , [ ]
2020-11-28 11:12:32 +00:00
config :bonfire_data_identity , User ,
2021-03-11 16:00:56 +00:00
has_one : [ accounted : { Accounted , foreign_key : :id } ] ,
has_one : [ profile : { Profile , foreign_key : :id } ] ,
has_one : [ character : { Character , foreign_key : :id } ] ,
has_one : [ actor : { Actor , foreign_key : :id } ] ,
has_one : [ instance_admin : { InstanceAdmin , foreign_key : :id } ] ,
has_many : [ likes : { Like , foreign_key : :liker_id , references : :id } ] ,
has_one : [ self : { Self , foreign_key : :id } ] ,
2021-06-22 20:48:22 +00:00
has_one : [ peered : { Peered , references : :id , foreign_key : :id } ] ,
2021-03-11 16:00:56 +00:00
has_many : [ encircles : { Encircle , foreign_key : :subject_id } ] ,
has_one : [ shared_user : { Bonfire.Data.SharedUser , foreign_key : :id } ] ,
2021-01-02 16:02:47 +00:00
many_to_many : [ caretaker_accounts : { Account , join_through : " bonfire_data_shared_user_accounts " , join_keys : [ shared_user_id : :id , account_id : :id ] } ]
2021-01-08 13:03:09 +00:00
# has_one: [geolocation: {Bonfire.Geolocate.Geolocation}]
2020-11-28 11:12:32 +00:00
# bonfire_data_social
2021-01-30 14:07:52 +00:00
config :bonfire_data_social , Activity ,
2021-02-11 09:27:30 +00:00
belongs_to : [ subject_user : { User , foreign_key : :subject_id , define_field : false } ] ,
belongs_to : [ subject_character : { Character , foreign_key : :subject_id , define_field : false } ] ,
belongs_to : [ subject_profile : { Profile , foreign_key : :subject_id , define_field : false } ] ,
2021-06-22 20:48:22 +00:00
belongs_to : [ object_peered : { Peered , foreign_key : :object_id , define_field : false } ] ,
2021-02-11 09:27:30 +00:00
belongs_to : [ object_post : { Post , foreign_key : :object_id , define_field : false } ] ,
2021-06-01 12:44:06 +00:00
# belongs_to: [object_post_content: {PostContent, foreign_key: :object_id, define_field: false}],
2021-04-07 11:23:14 +00:00
belongs_to : [ object_message : { Message , foreign_key : :object_id , define_field : false } ] ,
2021-03-30 13:56:10 +00:00
has_one : [ boost_count : { BoostCount , foreign_key : :id , references : :object_id } ] ,
2021-02-18 13:45:59 +00:00
has_one : [ like_count : { LikeCount , foreign_key : :id , references : :object_id } ] ,
2021-03-30 13:56:10 +00:00
has_many : [ boosts : { Boost , foreign_key : :boosted_id , references : :object_id } ] ,
2021-02-18 13:45:59 +00:00
has_many : [ likes : { Like , foreign_key : :liked_id , references : :object_id } ] ,
has_one : [ my_like : { Like , foreign_key : :liked_id , references : :object_id } ] ,
2021-03-04 09:47:35 +00:00
has_one : [ my_boost : { Boost , foreign_key : :boosted_id , references : :object_id } ] ,
2021-03-04 12:24:38 +00:00
has_one : [ my_flag : { Flag , foreign_key : :flagged_id , references : :object_id } ] ,
2021-02-18 13:45:59 +00:00
has_one : [ replied : { Replied , foreign_key : :id , references : :object_id } ] ,
2021-04-01 18:49:54 +00:00
# has_one: [reply_to: {[through: [:replied, :reply_to]]}],
# has_one: [reply_to_post: {[through: [:replied, :reply_to_post]]}],
# has_one: [reply_to_post_content: {[through: [:replied, :reply_to_post_content]]}],
# has_one: [reply_to_creator_character: {[through: [:replied, :reply_to_creator_character]]}],
# has_one: [reply_to_creator_profile: {[through: [:replied, :reply_to_creator_profile]]}],
# has_one: [thread_post: {[through: [:replied, :thread_post]]}],
# has_one: [thread_post_content: {[through: [:replied, :thread_post_content]]}],
2021-02-18 13:45:59 +00:00
has_one : [ object_created : { Created , foreign_key : :id , references : :object_id } ] ,
2021-04-01 18:49:54 +00:00
# has_one: [object_creator_user: {[through: [:object_created, :creator_user]]}],
# has_one: [object_creator_character: {[through: [:object_created, :creator_character]]}],
# has_one: [object_creator_profile: {[through: [:object_created, :creator_profile]]}],
2021-04-17 19:51:10 +00:00
has_one : [ controlled : { Controlled , foreign_key : :id , references : :object_id } ] ,
many_to_many : [
tags : {
Bonfire.Tag ,
join_through : " bonfire_tagged " ,
unique : true ,
join_keys : [ pointer_id : :object_id , tag_id : :id ] ,
on_replace : :delete
}
]
2021-01-30 14:07:52 +00:00
2020-12-10 12:50:56 +00:00
config :bonfire_data_social , Circle ,
has_one : [ caretaker : { Caretaker , foreign_key : :id } ] ,
has_one : [ named : { Named , foreign_key : :id } ]
2021-03-11 16:00:56 +00:00
# has_many: [encircles: {Encircle, foreign_key: :circle_id}]
2020-12-10 12:50:56 +00:00
2021-03-11 16:00:56 +00:00
config :bonfire_data_social , Encircle ,
2021-04-06 19:42:23 +00:00
belongs_to : [ subject_user : { User , foreign_key : :subject_id , define_field : false } ] ,
belongs_to : [ subject_character : { Character , foreign_key : :subject_id , define_field : false } ] ,
belongs_to : [ subject_profile : { Profile , foreign_key : :subject_id , define_field : false } ]
2021-01-30 15:48:59 +00:00
config :bonfire_data_social , Feed ,
belongs_to : [ character : { Character , foreign_key : :id , define_field : false } ] ,
belongs_to : [ user : { User , foreign_key : :id , define_field : false } ]
2020-12-16 10:33:57 +00:00
config :bonfire_data_social , FeedPublish , [ ]
2021-03-20 13:30:55 +00:00
config :bonfire_data_social , Follow ,
belongs_to : [ follower_character : { Character , foreign_key : :follower_id , define_field : false } ] ,
belongs_to : [ follower_profile : { Profile , foreign_key : :follower_id , define_field : false } ] ,
belongs_to : [ followed_character : { Character , foreign_key : :followed_id , define_field : false } ] ,
belongs_to : [ followed_profile : { Profile , foreign_key : :followed_id , define_field : false } ]
2020-11-28 11:12:32 +00:00
config :bonfire_data_social , FollowCount , [ ]
2021-01-30 15:48:59 +00:00
config :bonfire_data_social , Block , [ ]
2021-06-12 13:51:39 +00:00
config :bonfire_data_social , Like ,
has_one : [ activity : { Activity , foreign_key : :object_id , references : :liked_id } ] # requires an ON clause
config :bonfire_data_social , LikeCount , [ ]
2021-01-30 15:48:59 +00:00
config :bonfire_data_social , Bookmark , [ ]
2021-04-07 11:23:14 +00:00
config :bonfire_data_social , Message ,
has_one : [ post_content : { PostContent , foreign_key : :id } ] ,
has_one : [ created : { Created , foreign_key : :id } ] ,
2021-06-22 20:48:22 +00:00
has_one : [ peered : { Peered , references : :id , foreign_key : :id } ] ,
2021-04-07 11:23:14 +00:00
has_many : [ activities : { Activity , foreign_key : :object_id , references : :id } ] ,
2021-06-12 13:51:39 +00:00
has_one : [ activity : { Activity , foreign_key : :object_id , references : :id } ] , # requires an ON clause
2021-04-07 11:23:14 +00:00
has_one : [ like_count : { LikeCount , foreign_key : :id } ] ,
has_many : [ likes : { Like , foreign_key : :liked_id , references : :id } ] ,
has_one : [ my_like : { Like , foreign_key : :liked_id , references : :id } ] ,
has_one : [ my_flag : { Flag , foreign_key : :flagged_id , references : :id } ] ,
has_one : [ replied : { Replied , foreign_key : :id } ] ,
has_many : [ direct_replies : { Replied , foreign_key : :reply_to_id } ] ,
has_one : [ controlled : { Controlled , foreign_key : :id } ]
2020-12-16 10:33:57 +00:00
config :bonfire_data_social , Mention , [ ]
config :bonfire_data_social , Named , [ ]
2020-11-28 11:12:32 +00:00
2020-12-01 13:12:03 +00:00
config :bonfire_data_social , Post ,
2021-02-18 13:45:59 +00:00
has_one : [ post_content : { PostContent , foreign_key : :id } ] ,
has_one : [ created : { Created , foreign_key : :id } ] ,
2021-06-22 20:48:22 +00:00
has_one : [ peered : { Peered , references : :id , foreign_key : :id } ] ,
2021-04-01 18:49:54 +00:00
# has_one: [creator_user: {[through: [:created, :creator_user]]}],
# has_one: [creator_character: {[through: [:created, :creator_character]]}],
# has_one: [creator_profile: {[through: [:created, :creator_profile]]}],
2021-03-13 11:54:03 +00:00
has_many : [ activities : { Activity , foreign_key : :object_id , references : :id } ] ,
2021-06-12 13:51:39 +00:00
has_one : [ activity : { Activity , foreign_key : :object_id , references : :id } ] , # requires an ON clause
2021-02-11 09:27:30 +00:00
has_one : [ like_count : { LikeCount , foreign_key : :id } ] ,
has_many : [ likes : { Like , foreign_key : :liked_id , references : :id } ] ,
2021-02-18 13:45:59 +00:00
has_one : [ my_like : { Like , foreign_key : :liked_id , references : :id } ] ,
2021-03-04 12:24:38 +00:00
has_one : [ my_boost : { Boost , foreign_key : :boosted_id , references : :id } ] ,
has_one : [ my_flag : { Flag , foreign_key : :flagged_id , references : :id } ] ,
2021-02-18 13:45:59 +00:00
has_one : [ replied : { Replied , foreign_key : :id } ] ,
2021-04-01 18:49:54 +00:00
# has_one: [reply_to: {[through: [:replied, :reply_to]]}],
# has_one: [reply_to_post: {[through: [:replied, :reply_to_post]]}],
# has_one: [reply_to_post_content: {[through: [:replied, :reply_to_post_content]]}],
# has_one: [reply_to_creator_character: {[through: [:replied, :reply_to_creator_character]]}],
# has_one: [reply_to_creator_profile: {[through: [:replied, :reply_to_creator_profile]]}],
2021-02-18 13:45:59 +00:00
has_many : [ direct_replies : { Replied , foreign_key : :reply_to_id } ] ,
2021-04-01 18:49:54 +00:00
# has_one: [thread_post: {[through: [:replied, :thread_post]]}],
# has_one: [thread_post_content: {[through: [:replied, :thread_post_content]]}],
2021-03-20 19:41:55 +00:00
has_one : [ controlled : { Controlled , foreign_key : :id } ]
2020-12-01 13:12:03 +00:00
2020-12-01 13:06:01 +00:00
config :bonfire_data_social , PostContent , [ ]
2020-12-16 10:33:57 +00:00
2021-02-02 15:36:12 +00:00
config :bonfire_data_social , Replied ,
belongs_to : [ post : { Post , foreign_key : :id , define_field : false } ] ,
2021-03-13 11:54:03 +00:00
belongs_to : [ post_content : { PostContent , foreign_key : :id , define_field : false } ] ,
has_many : [ activities : { Activity , foreign_key : :object_id , references : :id } ] ,
has_one : [ activity : { Activity , foreign_key : :object_id , references : :id } ] ,
2021-02-18 13:45:59 +00:00
has_one : [ reply_to_post : { Post , foreign_key : :id , references : :reply_to_id } ] ,
has_one : [ reply_to_post_content : { PostContent , foreign_key : :id , references : :reply_to_id } ] ,
has_one : [ reply_to_created : { Created , foreign_key : :id , references : :reply_to_id } ] ,
2021-04-01 18:49:54 +00:00
# has_one: [reply_to_creator_user: {[through: [:reply_to_created, :creator_user]]}],
# has_one: [reply_to_creator_character: {[through: [:reply_to_created, :creator_character]]}],
# has_one: [reply_to_creator_profile: {[through: [:reply_to_created, :creator_profile]]}],
2021-02-18 13:45:59 +00:00
# has_one: [like_count: {LikeCount, foreign_key: :id}],
2021-02-11 09:27:30 +00:00
has_many : [ direct_replies : { Replied , foreign_key : :reply_to_id , references : :id } ] ,
2021-02-18 13:45:59 +00:00
has_many : [ thread_replies : { Replied , foreign_key : :thread_id , references : :id } ] ,
has_one : [ thread_post : { Post , foreign_key : :id , references : :thread_id } ] ,
2021-03-20 19:41:55 +00:00
has_one : [ thread_post_content : { PostContent , foreign_key : :id , references : :thread_id } ] ,
has_one : [ controlled : { Controlled , foreign_key : :id , references : :id } ]
2021-02-02 15:36:12 +00:00
2021-02-13 11:50:05 +00:00
config :bonfire_data_social , Created ,
2021-06-22 20:48:22 +00:00
has_one : [ peered : { Peered , references : :id , foreign_key : :id } ] ,
2021-02-13 11:50:05 +00:00
belongs_to : [ creator_user : { User , foreign_key : :creator_id , define_field : false } ] ,
belongs_to : [ creator_character : { Character , foreign_key : :creator_id , define_field : false } ] ,
belongs_to : [ creator_profile : { Profile , foreign_key : :creator_id , define_field : false } ]
2020-12-16 10:54:35 +00:00
2020-12-16 10:33:57 +00:00
config :bonfire_data_social , Profile ,
2021-03-20 19:41:55 +00:00
belongs_to : [ user : { User , foreign_key : :id , define_field : false } ] ,
has_one : [ controlled : { Controlled , foreign_key : :id , references : :id } ]
2020-12-31 13:17:10 +00:00
2021-04-13 19:24:31 +00:00
######### other extensions
# optional mixin relations for tags that are characters (eg Category) or any other type of objects
config :bonfire_tag , Bonfire.Tag ,
# for objects that are follow-able and can federate activities
has_one : [ character : { Bonfire.Data.Identity.Character , references : :id , foreign_key : :id } ] ,
2021-06-22 20:48:22 +00:00
has_one : [ peered : { Peered , references : :id , foreign_key : :id } ] ,
2021-04-13 19:24:31 +00:00
# has_one: [actor: {Bonfire.Data.ActivityPub.Actor, references: :id, foreign_key: :id}],
has_one : [ follow_count : { Bonfire.Data.Social.FollowCount , references : :id , foreign_key : :id } ] ,
# for likeable objects
has_one : [ like_count : { Bonfire.Data.Social.LikeCount , references : :id , foreign_key : :id } ] ,
# name/description
has_one : [ profile : { Bonfire.Data.Social.Profile , references : :id , foreign_key : :id } ] ,
# for taxonomy categories/topics
has_one : [ category : { Bonfire.Classify.Category , references : :id , foreign_key : :id } ] ,
# for locations
has_one : [ geolocation : { Bonfire.Geolocate.Geolocation , references : :id , foreign_key : :id } ]
2021-05-22 18:41:36 +00:00
2021-04-13 19:24:31 +00:00
# add references of tagged objects to any Category
2021-04-26 14:49:37 +00:00
config :bonfire_classify , Bonfire.Classify.Category ,
many_to_many : [
tags : {
Bonfire.Tag ,
join_through : " bonfire_tagged " ,
unique : true ,
join_keys : [ tag_id : :id , pointer_id : :id ] ,
on_replace : :delete
}
]
2021-04-13 19:24:31 +00:00
# add references of tagged objects to any Geolocation
2021-04-26 14:49:37 +00:00
config :bonfire_geolocate , Bonfire.Geolocate.Geolocation ,
many_to_many : [
tags : {
Bonfire.Tag ,
join_through : " bonfire_tagged " ,
unique : true ,
join_keys : [ tag_id : :id , pointer_id : :id ] ,
on_replace : :delete
}
]
2021-04-13 19:24:31 +00:00
2020-12-31 13:17:10 +00:00
# all data types included in federation
config :bonfire , :all_types , [ User , Post ]
2021-04-06 10:53:28 +00:00
2021-04-22 20:11:26 +00:00
config :bonfire_files , Bonfire.Files.Media ,
field : [
url : { :string , virtual : true }
]
2021-05-24 17:25:21 +00:00
config :bonfire_valueflows , ValueFlows.Planning.Intent ,
has_one : [ like_count : { LikeCount , foreign_key : :id } ]