correct query

This commit is contained in:
nek0 2019-07-21 16:39:23 +02:00
parent 4a3c2cbf58
commit 9a74b75a50

View file

@ -11,12 +11,12 @@ import Opaleye.Constant as C
initAmount :: PGS.Query initAmount :: PGS.Query
initAmount = mconcat initAmount = mconcat
[ "CREATE TABLE IF NOT EXISTS \"amount\" (" [ "CREATE TABLE IF NOT EXISTS \"amount\" ("
, "amounts_product_id BIGINT NOT NULL REFERENCES product ON DELETE CASCADE," , "amount_product_id BIGINT NOT NULL REFERENCES \"product\"(\"product_id\") ON DELETE CASCADE,"
, "amounts_timestamp TIMESTAMPTZ NOT NULL," , "amount_timestamp TIMESTAMPTZ NOT NULL,"
, "amounts_amount INTEGER NOT NULL," , "amount_amount INTEGER NOT NULL,"
, "amounts_price INTEGER NOT NULL," , "amount_price INTEGER NOT NULL,"
, "amounts_verified BOOLEAN NOT NULL," , "amount_verified BOOLEAN NOT NULL,"
, "PRIMARY KEY (product_id, timestamp)" , "PRIMARY KEY (amount_product_id, amount_timestamp)"
, ")" , ")"
] ]
@ -35,10 +35,10 @@ amountTable :: Table
) )
amountTable = table "amount" ( amountTable = table "amount" (
p5 p5
( tableField "amonnts_product_id" ( tableField "amonnt_product_id"
, tableField "amounts_timestamp" , tableField "amount_timestamp"
, tableField "amounts_amount" , tableField "amount_amount"
, tableField "amounts_price" , tableField "amount_price"
, tableField "amounts_verified" , tableField "amount_verified"
) )
) )