Added test base for postgres

This commit is contained in:
Niklas Fondberg
2021-04-29 14:37:48 +02:00
parent bf01ecba9c
commit b9b6abbec5
3 changed files with 48 additions and 46 deletions
+44 -42
View File
@@ -82,8 +82,10 @@
} }
{ {
order(id: 588274) { order(id: 579702) {
id id
localeName
marketName
market { market {
id id
name name
@@ -91,53 +93,53 @@
currency currency
priceAdjustment priceAdjustment
} }
deliveryInformation {
address {
recipientName
companyname
address1
address2
city
countryCode
stateCountyOrRegion
zipcode
}
email
phone
}
billingInformation {
address {
recipientName
companyname
address1
address2
city
countryCode
stateCountyOrRegion
zipcode
}
email
phone
}
rows { rows {
id id
order {
id
}
inserted
orderId
productId
productGroup
artNo artNo
path code
name commission
price
designerId
commissionAmount commissionAmount
status commissionResale
pwintyImageId designer
designerId
designerPath
discountType
discountValue
displayHeight
displayWidth
edge
frameColor frameColor
framed
group
height
imagedonotprint
imageprocessed
imageprocessingrejected
inserted
material
measureUnit
mirrored
modifier
name
noShipping
orderId
path
price
printId
process
productGroup
productId
pwintyImageId
pwintySku pwintySku
resolution
status
type
vat
weight
width
x
y
} }
} }
} }
+1 -1
View File
@@ -23,7 +23,7 @@ const createDB = async (mappedPort): Promise<Knex> => {
await initialDb.destroy(); await initialDb.destroy();
const db = createKnexDb(mappedPort, 'photowalltest'); const db = createKnexDb(mappedPort, 'photowalltest');
const sql = fs.readFileSync(resolve(__dirname, 'seed.sql')).toString(); const sql = fs.readFileSync(resolve(__dirname, 'schema.sql')).toString();
await db.raw(sql); await db.raw(sql);
return db; return db;
}; };
@@ -1,18 +1,18 @@
CREATE EXTENSION IF NOT EXISTS unaccent WITH SCHEMA public; CREATE EXTENSION IF NOT EXISTS unaccent WITH SCHEMA public;
CREATE TABLE locales ( CREATE TABLE locales (
id integer NOT NULL, id SERIAL NOT NULL,
value character(5), value character(5),
esales_locale character varying NOT NULL, esales_locale character varying NOT NULL,
fallback_id integer, fallback_id integer,
name text NOT NULL name text NOT NULL
); );
CREATE TABLE markets ( CREATE TABLE markets (
id integer NOT NULL, id SERIAL NOT NULL,
name character varying, name character varying,
locale_id integer locale_id integer
); );
CREATE TABLE market_locales ( CREATE TABLE market_locales (
id integer NOT NULL, id SERIAL NOT NULL,
market_id integer NOT NULL, market_id integer NOT NULL,
locale_id integer NOT NULL, locale_id integer NOT NULL,
name text NOT NULL name text NOT NULL