Wallet
The UserWallet
table is designed to store wallet information for users. It includes columns for the user ID, currency code, balance, status, default wallet indicator, and flags to indicate the user who created or last modified the wallet, along with the corresponding date and time.
Table Structure
[ID]
(bigint
,auto-incrementing
,primary key
): Represents the unique identifier for each wallet record.[User_ID]
(bigint
,not null
): Foreign key referencing the[ID]
column of theUser
table.[Currency_Code]
(varchar(5)
,not null
): Foreign key referencing the[Code]
column of theCurrency
table.[Balance]
(float
,not null
): Represents the wallet balance.[Status]
(smallint
,not null
): Represents the status of the wallet.[Is_Default]
(bit
,not null
): Indicates whether the wallet is the default wallet for the user.[Modified_By]
(bigint
,nullable
): Represents the user who last modified the wallet.[Modified_Date]
(datetime
,not null
): Represents the date and time when the wallet was last modified.[Created_By]
(bigint
,nullable
): Represents the user who created the wallet.[Created_Date]
(datetime
,not null
): Represents the date and time when the wallet was created.
Constraints
[PK_Wallet2022]
: Primary key constraint on the[ID]
column.[DF_Wallet_Balance]
: Default constraint on the[Balance]
column with a default value of 0.[DF_Wallet_IsDefault]
: Default constraint on the[Is_Default]
column with a default value of 0.[DF_Wallet_ModifiedDate]
: Default constraint on the[Modified_Date]
column with the current UTC date and time as the default value.[DF_Wallet_CreatedDate]
: Default constraint on the[Created_Date]
column with the current UTC date and time as the default value.[FK_UserWallet_Currency]
: Foreign key constraint on the[Currency_Code]
column referencing the[Code]
column of theCurrency
table.[FK_UserWallet_UserID]
: Foreign key constraint on the[User_ID]
column referencing the[ID]
column of theUser
table.
Example Data
1
USD
100.00
1
1
2
VAR
0.00
1
0
3
USD
100.00
1
0
Last updated
Was this helpful?