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