Correct database design #11

Closed
pitmutt wants to merge 0 commits from rav001 into rvv001
Owner
No description provided.
pitmutt added the
enhancement
label 2024-08-12 15:44:31 +00:00
pitmutt self-assigned this 2024-08-12 15:44:31 +00:00
reneve was assigned by pitmutt 2024-08-12 15:44:31 +00:00
pitmutt added 4 commits 2024-08-12 15:44:34 +00:00
pitmutt reviewed 2024-08-12 15:45:53 +00:00
@ -39,4 +53,2 @@
[mkPersist sqlSettings, mkMigrate "migrateAll"]
[persistLowerCase|
ZgoBlock
block_id Int --Block Id number
Author
Owner

Persistent creates IDs automatically

Persistent creates IDs automatically
pitmutt reviewed 2024-08-12 15:46:10 +00:00
@ -51,3 +61,1 @@
blocktx_id Int -- Block Tx record Id
blocktx_txid String -- Block Tx Id
UniqueBlockTx blocktx_block_id blocktx_id
ZgoBlockTx
Author
Owner

What is this table for?

What is this table for?
pitmutt reviewed 2024-08-12 15:47:13 +00:00
@ -54,3 +64,2 @@
blocktx_txid String
deriving Show Eq
ZgoCountry
country_code String -- Two Character Country Code
Author
Owner

There is no need to add the country_ prefix. Persistent will automatically create a zgoCountryCode accessor

There is no need to add the `country_` prefix. Persistent will automatically create a `zgoCountryCode` accessor
pitmutt reviewed 2024-08-12 15:47:50 +00:00
@ -66,1 +71,3 @@
UniqueItemId item_owner item_id
ZgoItem json
owner_id Int
name T.Text
Author
Owner

Text values should be T.Text instead of String

Text values should be `T.Text` instead of `String`
pitmutt reviewed 2024-08-12 15:48:38 +00:00
@ -91,2 +83,2 @@
order_vatamount Float default=0.0 -- Orcer VAT amount'
UniqueOrderId order_id
ZgoOrder json
owner ZgoOwnerId
Author
Owner

Using the ZgoOwnerId automatically created by Persistent, we can declare relationships between tables.

Using the `ZgoOwnerId` automatically created by Persistent, we can declare relationships between tables.
pitmutt reviewed 2024-08-12 15:49:10 +00:00
@ -93,0 +86,4 @@
timestamp Int
closed Word8
currency T.Text
price Double
Author
Owner

Persistent uses Double instead of Float

Persistent uses `Double` instead of `Float`
pitmutt reviewed 2024-08-12 15:49:35 +00:00
@ -93,0 +89,4 @@
price Double
total Double
totalzec Double
paid Bool
Author
Owner

Flags should be Bool not Word8

Flags should be `Bool` not `Word8`
pitmutt reviewed 2024-08-12 15:50:08 +00:00
@ -131,0 +128,4 @@
invoices Bool
tips Bool
paid Bool
expiration UTCTime
Author
Owner

Dates should be UTCTime

Dates should be `UTCTime`
pitmutt reviewed 2024-08-12 15:51:17 +00:00
@ -143,2 +140,4 @@
txid HexStringDB
memo T.Text
deriving Show Eq
ZgoPrice
Author
Owner

These fields do not correspond with the definition in Mantis #56

These fields do not correspond with the definition in [Mantis #56](https://mantis.vergara.tech/view.php?id=56)
pitmutt reviewed 2024-08-12 16:02:58 +00:00
@ -167,3 +159,1 @@
tx_expiration Int default=0 -- Transaction Expiration Date/Time
tx_closed Word8 default=0 -- Transaction Closed flag
UniqueTxId tx_id
zaddress T.Text default=""
Author
Owner

These fields do not correspond with the definition in Mantis #58.

These fields do not correspond with the definition in [Mantis #58](https://mantis.vergara.tech/view.php?id=58).
pitmutt reviewed 2024-08-12 16:03:53 +00:00
@ -198,0 +176,4 @@
access_token T.Text
expires Int
refreshtoken T.Text
accexpires Int
Author
Owner

Should be UTCTime

Should be `UTCTime`
pitmutt reviewed 2024-08-12 16:04:06 +00:00
@ -198,0 +178,4 @@
refreshtoken T.Text
accexpires Int
accCode T.Text
refexpires Int
Author
Owner

Should be UTCTime

Should be `UTCTime`
pitmutt changed title from WIP: Correct database design to Correct database design 2024-08-12 17:47:02 +00:00
pitmutt closed this pull request 2024-10-10 18:16:03 +00:00

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Vergara_Tech/zgo-backend#11
No description provided.