License
The License
table is designed to store license information for the system. It includes columns for the brand ID, package ID, subscription type ID, license key, source ID, reference license, description, start date, end date, status, used by, used date, modified by, and flags to indicate the user who created or last modified the license, along with the corresponding date and time.
Table Structure
[ID]
(bigint
,auto-incrementing
,primary key
): Represents the unique identifier for each license record.[Brand_ID]
(bigint
,not null
): Foreign key referencing the[ID]
column of theBrand
table.[Package_ID]
(bigint
,not null
): Foreign key referencing the[ID]
column of thePackage
table.[SubscriptionType_ID]
(bigint
,not null
): Foreign key referencing the[ID]
column of theSubscriptionType
table.[License_Key]
(varchar(30)
,not null
): Represents the license key. The default format of the license key is as follows:
**Brand Prefix**: The initial part of the code represents the brand's prefix. For example, "JFW" indicates the brand.
**Package Prefix**: The next segment is the first character of the package code. For example, "S" for Standard, "G" for Gold.
**[Subscription Type](../../../jfw-whitepaper/the-core-concept/plans-and-pricing/subscription-type.md) ID**: This part denotes the subscription duration with a numerical ID. For example, 1 for 30 days.
**Month Compatibility**: Each month is represented by a unique letter from A to M. For example, A represents January, B represents February, and so on.
**Random Characters**: The code concludes with 6 randomly generated alphanumeric characters (A-Z, 0-9).
Example:
For a code like "JFWG1IA1B2C3":
JFW represents the brand.
G indicates a Gold package.
1 signifies a 30-day subscription.
I denotes September.
A1B2C3 are the randomly generated characters.
[Source_ID]
(tinyint
,not null
): Represents the source of the license. The possible values are:
- Fully Generated License (1): Created from an admin tool, or manually generated by the JFW API.
- Partly Generated License (2): Automatically generated from the system when deleting a user which has an active license.
[Ref_License]
(varchar(30)
,not null
): Represents the reference license. The default format of the reference license is as follows:
The reference license is a 15-digit number that is generated when a license is used. It is used to track the original license that was used to create the new license.
[Description]
(nvarchar(255)
,nullable
): Represents the description of the license.[Start_Date]
(datetime
,not null
): Represents the start date of the license.[End_Date]
(datetime
,not null
): Represents the end date of the license.[Status]
(smallint
,not null
): Represents the status of the license.[Used_By]
(bigint
,nullable
): Represents the user who used the license.[Used_Date]
(datetime
,nullable
): Represents the date and time when the license was used.[Modified_By]
(bigint
,nullable
): Represents the user who last modified the license.[Modified_Date]
(datetime
,not null
): Represents the date and time when the license was last modified.[Created_By]
(bigint
,nullable
): Represents the user who created the license.[Created_Date]
(datetime
,not null
): Represents the date and time when the license was created.
Constraints
[PK_License]
: Primary key constraint on the[ID]
column.[DF_License_ModifiedDate]
: Default constraint on the[Modified_Date]
column with a default value of the current UTC date and time.[DF_License_CreatedDate]
: Default constraint on the[Created_Date]
column with a default value of the current UTC date and time.
Example Data
1
3
1
JFWP1JWUXTX7
1
221017041530891
This is an auto generated license.
2024-01-01
2024-12-31
1
Last updated
Was this helpful?