Point History

The PointHistory table is designed to store the history of points earned by users in the system. It includes columns for the user ID, event ID, point value, description, status, modified by, modified date, created by, and created date.

Table Structure
  • [ID] (bigint, auto-incrementing, primary key): Represents the unique identifier for each point transaction.

  • [User_ID] (bigint, not null): Represents the ID of the user who earned the points.

  • [Earn_Point_Event_ID] (bigint, not null): Represents the ID of the event associated with the points earned.

  • [Point_Value] (int, not null): Represents the value of the points earned.

  • [Description] (nvarchar(max), nullable): Represents the optional description of the point transaction.

  • [Status] (smallint, not null): Represents the status of the point transaction.

  • [Modified_By] (bigint, nullable): Represents the ID of the user who last modified the point transaction.

  • [Modified_Date] (datetime, not null): Represents the date and time when the point transaction was last modified.

  • [Created_By] (bigint, nullable): Represents the ID of the user who created the point transaction.

  • [Created_Date] (datetime, not null): Represents the date and time when the point transaction was created.

Constraints
  • [PK_PointHistory]: Primary key constraint on the [ID] column

  • [DF_PointHistory_Status]: Default constraint on the [Status] column, default value is 0

  • [DF_PointHistory_ModifiedDate]: Default constraint on the [Modified_Date] column, default value is current UTC date and time

  • [DF_PointHistory_CreatedDate]: Default constraint on the [Created_Date] column, default value is current UTC date and time

  • [FK_PointHistory_PointEvent]: Foreign key constraint on the [Earn_Point_Event_ID] column, references [JFW].[PointEvent] table

  • [FK_PointHistory_User]: Foreign key constraint on the [User_ID] column, references [JFW].[User] table

Example Data

User_ID
Earn_Point_Event_ID
Point_Value
Description
Status

1

1

1

Earn 1 points after registering.

1

1

2

1

Earn 1 points for logging in daily.

1

1

3

1

Earn 1 points for filling out your profile.

1

1

4

30

Earn 30 points for purchasing a package.

1

2

1

1

Earn 1 points after registering.

1

2

2

1

Earn 1 points for logging in daily.

1

Last updated

Was this helpful?