Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove all legacy notification/subscription models #9068

Merged
merged 16 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions libs/model/src/community/CreateCommunity.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,6 @@ export function CreateCommunity(): Command<typeof schemas.CreateCommunity> {
active: true,
chain_node_id: node.id,
token_name,
has_chain_events_listener:
network === 'aave' || network === 'compound',
default_page: DefaultPage.Discussions,
has_homepage: 'true',
collapsed_on_homepage: false,
Expand Down
1 change: 0 additions & 1 deletion libs/model/src/community/GetCommunities.query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ export function GetCommunities(): Query<typeof schemas.GetCommunities> {
"Community"."block_explorer_ids",
"Community"."collapsed_on_homepage",
"Community"."type",
"Community"."has_chain_events_listener",
"Community"."default_summary_view",
"Community"."default_page",
"Community"."has_homepage",
Expand Down
26 changes: 0 additions & 26 deletions libs/model/src/feed/GetChainActivity.query.ts

This file was deleted.

87 changes: 0 additions & 87 deletions libs/model/src/feed/GetUserActivity.query.ts

This file was deleted.

2 changes: 0 additions & 2 deletions libs/model/src/feed/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
export * from './GetChainActivity.query';
export * from './GetGlobalActivity.query';
export * from './GetUserActivity.query';
28 changes: 0 additions & 28 deletions libs/model/src/models/associations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import type { DB } from './factories';
export const buildAssociations = (db: DB) => {
db.User.withMany(db.Address)
.withMany(db.ProfileTags)
.withMany(db.Subscription, { foreignKey: 'subscriber_id' })
.withMany(db.NotificationsRead)
.withMany(db.SubscriptionPreference, {
asMany: 'SubscriptionPreferences',
onDelete: 'CASCADE',
Expand Down Expand Up @@ -59,7 +57,6 @@ export const buildAssociations = (db: DB) => {
onUpdate: 'CASCADE',
onDelete: 'CASCADE',
})
.withMany(db.Notification)
.withMany(db.Webhook)
.withMany(db.CommunityTags, {
onDelete: 'CASCADE',
Expand Down Expand Up @@ -96,7 +93,6 @@ export const buildAssociations = (db: DB) => {
asMany: 'reactions',
})
.withMany(db.Comment)
.withMany(db.Notification)
.withMany(db.ThreadVersionHistory);

db.Comment.withMany(db.Reaction, {
Expand Down Expand Up @@ -128,10 +124,6 @@ export const buildAssociations = (db: DB) => {
onDelete: 'CASCADE',
});

db.NotificationCategory.withMany(db.Subscription, {
foreignKey: 'category_id',
}).withMany(db.Notification, { foreignKey: 'category_id' });

db.Group.withMany(db.GroupPermission);

// Many-to-many associations (cross-references)
Expand Down Expand Up @@ -201,24 +193,4 @@ export const buildAssociations = (db: DB) => {
onDelete: 'CASCADE',
},
);

db.NotificationsRead.withManyToMany(
{ model: db.Subscription, onDelete: 'CASCADE' },
{
model: db.Notification,
onDelete: 'CASCADE',
hooks: true,
},
);

// subscriptions
db.Subscription.belongsTo(db.Community, {
foreignKey: 'community_id',
});
db.Subscription.belongsTo(db.Thread, {
foreignKey: 'thread_id',
});
db.Subscription.belongsTo(db.Comment, {
foreignKey: 'comment_id',
});
};
5 changes: 0 additions & 5 deletions libs/model/src/models/community.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,6 @@ export default (
defaultValue: false,
},
type: { type: Sequelize.STRING, allowNull: false, defaultValue: 'chain' },
has_chain_events_listener: {
type: Sequelize.BOOLEAN,
allowNull: false,
defaultValue: false,
},
default_summary_view: { type: Sequelize.BOOLEAN, allowNull: true },
default_page: { type: Sequelize.STRING, allowNull: true },
has_homepage: {
Expand Down
8 changes: 0 additions & 8 deletions libs/model/src/models/factories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,13 @@ import Group from './group';
import GroupPermission from './groupPermission';
import LastProcessedEvmBlock from './lastProcessedEvmBlock';
import Membership from './membership';
import Notification from './notification';
import NotificationCategory from './notification_category';
import NotificationsRead from './notifications_read';
import Outbox from './outbox';
import Poll from './poll';
import ProfileTags from './profile_tags';
import Reaction from './reaction';
import SsoToken from './sso_token';
import StakeTransaction from './stake_transaction';
import StarredCommunity from './starred_community';
import Subscription from './subscription';
import SubscriptionPreference from './subscription_preference';
import Tags from './tags';
import Thread from './thread';
Expand Down Expand Up @@ -72,17 +68,13 @@ export const Factories = {
GroupPermission,
LastProcessedEvmBlock,
Membership,
Notification,
NotificationCategory,
NotificationsRead,
Outbox,
Poll,
ProfileTags,
Reaction,
SsoToken,
StakeTransaction,
StarredCommunity,
Subscription,
Tags,
SubscriptionPreference,
Thread,
Expand Down
4 changes: 0 additions & 4 deletions libs/model/src/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,6 @@ export * from './evmEventSource';
export * from './group';
export * from './lastProcessedEvmBlock';
export * from './membership';
export * from './notification';
export * from './notification_category';
export * from './notifications_read';
export * from './outbox';
export * from './poll';
export * from './profile_tags';
Expand All @@ -74,7 +71,6 @@ export * from './role_assignment';
export * from './sso_token';
export * from './stake_transaction';
export * from './starred_community';
export * from './subscription';
export * from './tags';
export * from './thread';
export * from './thread_version_history';
Expand Down
83 changes: 0 additions & 83 deletions libs/model/src/models/notification.ts

This file was deleted.

31 changes: 0 additions & 31 deletions libs/model/src/models/notification_category.ts

This file was deleted.

Loading
Loading