Remove ID fields

Persistent adds them automatically
This commit is contained in:
Rene Vergara 2024-08-12 09:23:36 -05:00
parent 9b48ce2b68
commit e24581eb5d
Signed by: pitmutt
GPG key ID: 65122AD495A7F5B2
2 changed files with 2 additions and 32 deletions

View file

@ -27,30 +27,26 @@ import qualified Data.ByteString as BS
import Data.HexString
import Data.List (group, sort)
import Data.Maybe (catMaybes, fromJust, isJust)
import Data.Pool (Pool)
import qualified Data.Text as T
import qualified Data.Text.Encoding as TE
import Data.Word
import Database.Esqueleto.Experimental
import qualified Database.Persist.Sqlite as PS
import qualified Database.Persist.MySQL as PM
import Database.Persist.TH
share
[mkPersist sqlSettings, mkMigrate "migrateAll"]
[persistLowerCase|
ZgoBlock
block_id Int
block_confs Int default=0
block_network String default=""
block_height Int default=0
block_time Int default=0
UniqueBlock block_id
deriving Show Eq
ZgoBlockTx
blocktx_block_id Int
blocktx_id Int
blocktx_txid String
UniqueBlockTx blocktx_block_id blocktx_id
deriving Show Eq
ZgoCountry
country_code String
@ -59,21 +55,17 @@ share
deriving Show Eq
ZgoItem
item_owner_id Int
item_id String
item_name String
item_description T.Text default=""
item_cost Float default=0.0
UniqueItemId item_owner item_id
deriving Show Eq
ZgoLanguages
encode_id String
view_name String default-""
view_element String default=""
view_element_text T.Text default=""
UniqueLanguage encode_id view_name view_element
deriving Show Eq
ZgoOrders
order_id Int
order_zaddress T.Text
order_session T.Text
order_timestamp Int
@ -89,18 +81,14 @@ share
order_taxamount Float default=0.0
order_tipamount Float default=0.0
order_vatamount Float default=0.0
UniqueOrderId order_id
deriving Show Eq
ZgoOrderLines
orderline_orderid Int default=0
orderline_line Int default=0
orderline_qty Int default=0
orderline_name T.Text default=""
orderline_cost Float default=0.0
UniqueOrderLine orderline_orderid orderline_line
deriving Show Eq
ZgoOwner
owner_id Int
owner_co_name String default=""
owner_firstname String
owner_lastname String
@ -126,11 +114,8 @@ share
owner_tips Word8
owner_paid Word8
owner_expiration Int
UniqueOwnerId owner_id
UniqueOwnerZcashAddr owner_zcaddress
deriving Show Eq
ZgoPayment
payment_id Int
payment_delta Int
payment_done Word8
payment_zaddress T.Text
@ -139,10 +124,8 @@ share
payment_amount Float default=0.0
payment_txid String default =""
payment_memo T.Text default=""
UniquePaymentId payment_id
deriving Show Eq
ZgoPrice
price_id Int
price_delta Int default=0
price_done Word8 default=0
price_zaddress T.Text default=""
@ -151,42 +134,29 @@ share
price_amount Float default=0.0
price_txid String default=""
price_memo T.Text default=""
UniquePriceId price_id
deriving Show Eq
ZgoProsession
pro_id Int
pro_zaddress T.Text default=""
pro_expiration Int default=0
pro_closed Word8 default=0
UniqueProSesId pro_id
UniqueProSesZad pro_zaddress
deriving Show Eq
ZgoTransaction
tx_id Int
tx_zaddress T.Text default=""
tx_expiration Int default=0
tx_closed Word8 default=0
UniqueTxId tx_id
deriving Show Eq
ZgoUser
user_id Int
user_zaddress T.Text
user_session String
user_blocktime Int
user_pin String
user_validated Word8 default=0
UniqueUserId user_id
UniqueUserZad user_zaddress
deriving Show Eq
ZgoXero
xero_id Int
xero_client_id String default=""
xero_client_secret String default=""
UniqueXeroId xero_id
UniqueXeroClientId xero_client_id
deriving Show Eq
ZgoXeroToken
xerotoken_id Int
xerotoken_zaddress T.Text
xerotoken_access_token T.Text
xerotoken_expires Int
@ -194,6 +164,5 @@ share
xerotoken_accexpires Int
xerotoken_accCode String
xerotoken_refexpires Int
UniqueXeroTokenId xerotoken_id
deriving Show Eq
|]

View file

@ -59,6 +59,7 @@ library
, jwt
, megaparsec
, memory
, monad-logger
, mongoDB
, network
, quickcheck-instances