sitefinity create a unscribers table in the database - sitefinity

Sitefinity by default create many necessary tables automatically for users , but it wont store the deleted subscriber information by creating a unsubscribes table. Are they any way to customize a new table in back end code to store deleted information?

When a user unsubscribes from a newsletter, then the user is removed from the relevant Mailing List (sf_notif_subscriptions table, which is a linking table containing subscriber_id and mailing_list_id).
Then, a record is being added to the sf_unsubscription_info table.

Related

How to assign the IDs to the referring table and how to display this correctly? (SSMS)

I am in the process of creating an audit plan using ERD, going off the below image you can see that there's a permissions table with four FK columns referring to the other four tables PK column. I am just confused as to how the IDs will relate to the other tables and how will it show up correctly in the permissions table?
For the Users table, I imported the data from 'master.sys.server_principals.
For the Instance table, I imported the data by using ##SERVERNAME.
For the Databases table, I imported the data from master.sys.databases.
For the Object Types table, I imported the data from master.sys.objects.
Now, I am currently on the permissions table and stuck at this point because I am wondering how will the IDs match from the four other tables (mentioned above and shown in the image link below) to this permissions table. I know I need to query from master.sys.database_permissions to get the information for both columns 'Permissions_Permission_Name' and 'Permissions_Object_Name' but it's just the other four ID columns which I am confused about...(you can ignore the column Permissions_ID)
I'm going to use the Answer field, because there is no space in the Comment editor. This answer is an answer to only part your question, two of the four tables (Databases and Users) I can relate to system tables.
First and foremost: when filling in Id's, you would generate the other table records first, keep the Identity Id's generated, and finally create a new Permission record and fillin the correct indexes there, in each Id field. That counts for any such change when a table contains indexes to other tables. Suppose you know.
Issue is, your structure differs from the system tables. You will need more "permission" records than master.sys.database_permissions, because MsSQL registers these as permissions per principal (role) not permissions per user.
I solved two of the four:
The user is connected to a principal role via master.sys.database_role_members. The Id of the user role can be found in your source as master.sys.database_permissions.grantee_principal_id and the corresponding users that have this principal_id are listed in master.sys.database_role_members.
Your permission a database (ONE database) is defined in your Permission record. The database name in this database record should map to a database on your server. In that database, you will find database_permissions.sys.server_principals. users that have the permissions are (again) found in master.sys.database_role_members.
I'm not sure what you intend to do with the other 2 tables, Instances and Object Types.
Refer ms-docs about the subject at https://learn.microsoft.com/en-us/sql/relational-databases/system-catalog-views/sys-database-permissions-transact-sql?view=sql-server-ver15

SQL Create Trigger On Tables That Are Added By New Users?

Hope someone can guide a noob as I have done alot of googling and searching here as well but here's what I am trying to accomplish.
I have a program that upon registering it creates a table that is yours in the database. A workerID is generated upon registration on that workerID gets attached the table name that gets created for you.
For example after you register you get assigned a worker ID number of 10001. A table is then created for you named DB_10001.
Easy enough.
Within Table DB_10001 there is a column that Identifies who the project creator was (ID'd by workerID).
Worker ID: 10001 creates his or her own projects but sometimes, a project is assigned by another workerID and it is placed in DB_10001 table.
I want to create a trigger that if the PROJECT CREATOR (which is a column in DB_10001) is not the owner of the table (WorkerID: 10001), to be notified that the owner of that table (10001) of a pending project to they can either accept or reject.
Is it possible to put this trigger when the table is created???
Thanks in advance,

How to link User Data in aspnet_Users and Users tables in DotNetNuke

I'm creating a module for DNN 7.3.4. Another bought module creates new users. I need to display a list of those users in my module using an SQL statement. However the other module creates them in the table aspnet_Users and also adds their details into the Users table.
I cant see how I can link the records in both tables as the userid in the aspnet_Users table takes the form of "6c9c37b9-0a9a-4394-aad5-715e63681024" whereas the Users table UserID field contains "1".
The link there is the "username" field in both tables.
If you are trying to display users from your own module, you should only look at the DNN Users table, and UserPortals, I would ignore everything in the ASPNET_ tables, just let DNN maintain that link.

Counting the number of downloads on a database oracle

I am creating a database for an online store which is going to sell, movies, music and books as a final project in the Uni.
I have created all tables already and made sure they were all working. The database is supposed to have a "Historical" table. I want to have on thistab the number of downloads an specific client makes.
The primary keys on the table "Clients" are suscriber_number and id_download. These 2 are foreign keys-primary key on the historical tab. How can I make sure thatevery download a client makes it gets store on the historical tab as a new download and not just a replacement of the previous data? I am afraid it will just override the previous information and will not keep a count of the downloads on each suscriber. Are we able to keep track in oracle of the times I am using an update statement on existing data to retrieve it later on?

Table with user activities - design issue

On my site user can make some items and those items goes in Items table.
Users can also follow each other and those data I store in Followings table.
Now I need one table that keep track of user activities, so I have created:
Users{UserId, Username, FirstName, LastName}
Items{ItemId, Title, CreatedByUserId}
Activity{ActivityId, ActivityTypeId, UserId, ItemId}
Here ItemId can be or ItemId from Items table or UserId from Users table.
Is this design good or there is better approach to do this?
Edit: I have added table structures. The point is that I wan't to add record to that Activity table every time when user create item or start to follow some user. So I can always track what user did on the site.
Here ItemId can be or ItemId from Items table or UserId from Users table.
This will prevent the DBMS from enforcing the foreign key. If you go down that route, better separate these fields (so you can make foreign keys towards their respective tables) and use a CHECK to ensure exactly one of them is non-NULL:
CHECK (
(ITEM_ID IS NOT NULL AND FOLLOWED_USER_ID IS NULL)
OR (ITEM_ID IS NULL AND FOLLOWED_USER_ID IS NOT NULL)
)
The ACTIVITY PK is crafted so it is easy to query for a "timeline" of a specific user and is friendly to clustering.
(You may or may not need ACTIVITY.TYPE depending on what exactly you want to track.)
The alternative would be to have a separate table for each kind of activity:
(And you could add a TYPE field in FOLLOW_ACTIVITY to distinguish between "follow" and "unfollow".)
Another alternative would be to inherit users and items from a common parent "class" and then link to that class:
This design is probably an overkill in this case, but could be useful if you later add many other kinds of objects that could be tracked.
Items{ItemID,descr,UserIDCreator,date-time}
User{UserID,descr}
Followings{UserIDFollowed,UserIDFollower,date-time}
now if you wont all items created by eser use user code on items
the same on followings I add date-time for chrono select
You can create atriggered table or a view this depends on cardinality of data
If the same object can be share between users
Items{ItemID,descr,}
UserItems{UserID,descr,ItemId,date-time}
User{UserID,descr}
Followings{UserIDFollowed,UserIDFollower,date-time}
I hope to be useful