comment count tables

This commit is contained in:
Mayel de Borniol 2021-12-24 22:44:29 +13:00
parent 39f625795e
commit cff580dcd1
3 changed files with 13 additions and 29 deletions

View file

@ -124,7 +124,7 @@ db.migrate: mix~ecto.migrate ## Run latest database migrations (eg. after adding
db.seeds: mix~ecto.migrate mix~ecto.seeds ## Run latest database seeds (eg. inserting required data after adding/upgrading an app/extension)
db.reset: dev.search.reset db.pre-migrations mix~ecto.reset ## Reset the DB (caution: this means DATA LOSS)
db.reset: init dev.search.reset db.pre-migrations mix~ecto.reset ## Reset the DB (caution: this means DATA LOSS)
dev.search.reset:
ifeq ($(WITH_DOCKER), no)

View file

@ -82,7 +82,7 @@ config :pointers, Pointer,
has_one: [peered: {Peered, references: :id, 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_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}],
@ -157,10 +157,10 @@ config :bonfire_data_identity, Character,
has_one: [user: {User, foreign_key: :id}],
has_one: [feed: {Feed, foreign_key: :id}],
has_one: [inbox: {Inbox, foreign_key: :id}],
has_many: [feed_publishes: {FeedPublish, references: :id, foreign_key: :feed_id}],
has_many: [followers: {Follow, foreign_key: :following_id, references: :id}],
has_many: [followed: {Follow, foreign_key: :follower_id, references: :id}],
has_one: [follow_count: {FollowCount, foreign_key: :id}]
has_many: [feed_publishes: {FeedPublish, references: :id, foreign_key: :feed_id}]
# has_many: [followers: {Follow, foreign_key: :following_id, references: :id}],
# has_many: [followed: {Follow, foreign_key: :follower_id, references: :id}],
# has_one: [follow_count: {FollowCount, foreign_key: :id}]
config :bonfire_data_identity, Credential,
belongs_to: [account: {Account, foreign_key: :id, define_field: false}]
@ -206,8 +206,8 @@ config :bonfire_data_social, Activity,
belongs_to: [object_post: {Post, foreign_key: :id, define_field: false}],
# belongs_to: [object_post_content: {PostContent, foreign_key: :id, define_field: false}],
belongs_to: [object_message: {Message, foreign_key: :id, define_field: false}],
has_one: [boost_count: {BoostCount, foreign_key: :id}],
has_one: [like_count: {LikeCount, foreign_key: :id}],
# has_one: [boost_count: {BoostCount, foreign_key: :id}],
# has_one: [like_count: {LikeCount, foreign_key: :id}],
# has_many: [boosts: {Boost, foreign_key: :boosted_id, references: :id}],
# has_many: [likes: {Like, foreign_key: :liked_id, references: :id}],
# has_one: [my_like: {Like, foreign_key: :liked_id, references: :id}],
@ -252,7 +252,7 @@ config :bonfire_data_social, Edge,
belongs_to: [subject_profile: {Profile, foreign_key: :subject_id, define_field: false}],
belongs_to: [object_character: {Character, foreign_key: :object_id, define_field: false}],
belongs_to: [object_profile: {Profile, foreign_key: :object_id, define_field: false}]
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}]
@ -305,7 +305,7 @@ config :bonfire_data_social, Post,
# has_one: [creator_profile: {[through: [:created, :creator_profile]]}],
has_many: [activities: {Activity, foreign_key: :object_id, references: :id}],
has_one: [activity: {Activity, foreign_key: :object_id, references: :id}], # requires an ON clause
has_one: [like_count: {LikeCount, 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_boost: {Boost, foreign_key: :boosted_id, references: :id}],
@ -360,9 +360,9 @@ config :bonfire_tag, Bonfire.Tag,
has_one: [character: {Bonfire.Data.Identity.Character, references: :id, foreign_key: :id}],
has_one: [peered: {Peered, references: :id, foreign_key: :id}],
# 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}],
# 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}],
# 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
@ -384,23 +384,7 @@ config :bonfire_classify, Bonfire.Classify.Category,
}
]
# add references of tagged objects to any Geolocation
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
}
]
config :bonfire_files, Bonfire.Files.Media,
field: [
url: {:string, virtual: true}
]
config :bonfire_valueflows, ValueFlows.Planning.Intent,
has_one: [like_count: {LikeCount, foreign_key: :id}]

View file

@ -13,7 +13,7 @@
"bonfire_common": {:git, "https://github.com/bonfire-networks/bonfire_common", "445225477f3e5866ef640b0fa1e09b5fd9b75094", [branch: "main"]},
"bonfire_data_access_control": {:git, "https://github.com/bonfire-networks/bonfire_data_access_control", "cae2c7a5dd617f7dcf5ee4ebd882dd3e4dc64e1d", [branch: "main"]},
"bonfire_data_activity_pub": {:git, "https://github.com/bonfire-networks/bonfire_data_activity_pub", "5522116c8e5b1a6264fe87139c0a0345aa715cd9", [branch: "main"]},
"bonfire_data_edges": {:git, "https://github.com/bonfire-networks/bonfire_data_edges", "d7c987d4414c69a737358311db92434dc8bebbe7", [branch: "main"]},
"bonfire_data_edges": {:git, "https://github.com/bonfire-networks/bonfire_data_edges", "d9ad355a3b06838fea9d8c874e40ad730042053f", [branch: "main"]},
"bonfire_data_identity": {:git, "https://github.com/bonfire-networks/bonfire_data_identity", "fa2db2928b233e5c3ee9b71b1ccef1f6e58011b0", [branch: "main"]},
"bonfire_data_social": {:git, "https://github.com/bonfire-networks/bonfire_data_social", "f17423506a08b504556292847487575bd2668bd5", [branch: "main"]},
"bonfire_editor_ck": {:git, "https://github.com/bonfire-networks/bonfire_editor_ck", "9e80bcebf7f3b3260b7e3977dcd761f8af7332e7", []},