P5-7141: basic tests (#1)

* added containers for db and apollo

* connected to test db

* added network again

* Added base for tests
This commit is contained in:
Arwid Thornström
2021-06-17 11:04:22 +02:00
committed by GitHub
parent b9b6abbec5
commit 74796e23a8
26 changed files with 22059 additions and 1776 deletions
+4
View File
@@ -0,0 +1,4 @@
node_modules/
.gitignore
README.md
queries.graphql
+2
View File
@@ -90,3 +90,5 @@ jspm_packages
*.sublime-project
*.sublime-workspace
.env
src/__test__/export
+1
View File
@@ -0,0 +1 @@
v14.17.0
+12
View File
@@ -0,0 +1,12 @@
# Uses the node base image with the latest LTS version
FROM node:14.16.0
# Informs Docker that the container listens on the
# specified network ports at runtime
EXPOSE 4000
COPY . app/
# Changes working directory to the new directory just created
WORKDIR /app
# Installs npm dependencies on container
RUN npm ci
# Command container will actually run when called
CMD ["npm", "start"]
+2 -2
View File
@@ -8,8 +8,8 @@ Create an .env file (see .env.example for what to set).
Run
```
$ npm install
$ npm start
$ docker-compose build
$ docker-compose up
```
Then head over to [The playground GUI](https://localhost:4000) in the browser
+16
View File
@@ -0,0 +1,16 @@
version: '3.7'
services:
api:
build:
context: ./
dockerfile: ./Dockerfile
container_name: photowall.graphql
hostname: graphql.local
ports:
- "4000:4000"
networks:
default:
external:
name: photowall-docker-network
+13867 -1669
View File
File diff suppressed because it is too large Load Diff
+20 -19
View File
@@ -11,33 +11,34 @@
"author": "",
"license": "ISC",
"dependencies": {
"apollo-datasource": "^0.8.0",
"apollo-datasource-rest": "^0.11.0",
"apollo-server": "^2.22.2",
"apollo-datasource": "^0.9.0",
"apollo-datasource-rest": "^0.13.0",
"apollo-server": "^2.24.1",
"async-redis": "^1.1.7",
"datasource-sql": "^1.4.0",
"dotenv": "^8.2.0",
"datasource-sql": "^1.4.1",
"dotenv": "^9.0.2",
"graphql": "^15.5.0",
"graphql-scalars": "^1.9.0",
"graphql-scalars": "^1.9.3",
"knex-stringcase": "^1.4.5",
"nodemon": "^2.0.7",
"pg": "^8.5.1",
"pg": "^8.6.0",
"pg-hstore": "^2.3.3",
"prettier": "^2.2.1",
"prettier": "^2.3.0",
"stringcase": "^4.3.1",
"ts-node": "^9.1.1",
"typescript": "^4.2.3",
"validator": "^13.5.2"
"typescript": "^4.2.4",
"validator": "^13.6.0"
},
"devDependencies": {
"@types/jest": "^26.0.22",
"@typescript-eslint/eslint-plugin": "^4.21.0",
"@typescript-eslint/parser": "^4.21.0",
"eslint": "^7.23.0",
"eslint-config-prettier": "^8.1.0",
"eslint-plugin-prettier": "^3.3.1",
"jest": "^26.6.3",
"testcontainers": "^7.7.0",
"ts-jest": "^26.5.5"
"@types/jest": "^26.0.23",
"@typescript-eslint/eslint-plugin": "^4.24.0",
"@typescript-eslint/parser": "^4.24.0",
"eslint": "^7.26.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^3.4.0",
"isomorphic-fetch": "^3.0.0",
"jest": "^27.0.4",
"testcontainers": "^7.11.1",
"ts-jest": "^27.0.3"
}
}
Executable
+4
View File
@@ -0,0 +1,4 @@
!#/bin/sh
docker build -t graphql-api-js .
docker run -p 4000:4000 --name graphql-api-js -d graphql-api-js
+75
View File
@@ -0,0 +1,75 @@
import fetch from 'isomorphic-fetch';
import { IAllTestContainers, createAllTestContainers } from './containerSetup';
jest.setTimeout(18000_000);
describe('GraphQL Apollo tests', () => {
let allContainers: IAllTestContainers;
beforeAll(async () => {
allContainers = await createAllTestContainers();
});
afterAll(async () => {
await allContainers.stopAll();
});
describe('Setup containers', () => {
it('should have a trivial test', () => {
expect(true).toBe(true);
});
it('should have access to containers', () => {
expect(allContainers).toBeDefined();
});
it('test date on db testcontainer', async () => {
const res = await allContainers.db.raw('select now()');
expect(res.rows[0]['now']).toBeInstanceOf(Date);
});
it('healthcheck on api testcontainer', async () => {
const port = allContainers.apiContainer.getMappedPort(4000);
const response = await fetch(
`http://localhost:${port}/.well-known/apollo/server-health`,
{
method: 'GET',
},
);
const resp = await response.json();
expect(resp.status).toBe('pass');
});
it('should have some basedata', async () => {
const response = await allContainers.db.raw(
`SELECT * FROM locales LIMIT 1;`,
);
expect(response.rows[0].value).toBe('sv_SE');
expect(response.rows[0].name).toBe('Swedish (Sweden)');
});
it('should be connected to test db', async () => {
const port = allContainers.apiContainer.getMappedPort(4000);
const response = await fetch(`http://localhost:${port}`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
query: `
{
designer(id: 1) {
id
name
path
}
}`,
}),
});
const resp = await response.json();
const designer = resp.data.designer;
expect(designer.id).toBe('1');
expect(designer.name).toBe('Lorem Ipsumsson');
expect(designer.path).toBe('lorem-ipsumsson');
});
});
});
+129
View File
@@ -0,0 +1,129 @@
import fs from 'fs';
import { resolve } from 'path';
import {
GenericContainer,
Network,
StartedNetwork,
StartedTestContainer,
Wait,
} from 'testcontainers';
import Knex from 'knex';
// import knexTinyLogger from 'knex-tiny-logger';
export const DbNetworkName = 'postgres_container';
export const ApiNetworkName = 'api_container';
const allContainers = {
version: 0,
};
const runFile = async (db, file) => {
const sql = fs.readFileSync(resolve(__dirname, file)).toString();
await db.raw(sql);
};
const createKnexDb = (host: string, mappedPort: number, database: string) => {
const connection = `postgresql://testuser:test@${host}:${mappedPort}/${database}`;
// console.log(`connection`, connection);
const db = Knex({
client: 'pg',
connection: connection,
pool: { min: 0 },
});
// knexTinyLogger(db);
return db;
};
export interface IAllTestContainers {
version: number;
dbContainer?: StartedTestContainer;
db?: Knex;
apiContainer?: StartedTestContainer;
network?: StartedNetwork;
stopAll?: any;
}
export const createAllTestContainers =
async (): Promise<IAllTestContainers> => {
const network = await new Network().start();
// ----------------------------------
// DB container
const dbContainer = await new GenericContainer('postgres')
.withNetworkMode(network.getName())
.withNetworkAliases(DbNetworkName)
.withEnv('POSTGRES_USER', 'testuser')
.withEnv('POSTGRES_PASSWORD', 'test')
.withEnv('POSTGRES_DB', 'apidb')
.withExposedPorts(5432)
.start();
const dbMappedPort = dbContainer.getMappedPort(5432);
const dbHost = dbContainer.getHost();
// ----------------------------------
// Knex DB
const initialDb = createKnexDb(dbHost, dbMappedPort, 'postgres');
await initialDb.raw('CREATE DATABASE photowalltest1');
await initialDb.destroy();
const db = createKnexDb(dbHost, dbMappedPort, 'photowalltest1');
await runFile(db, 'db/schema.sql');
// await db.raw(`INSERT INTO markets (id, name, vat, currency, price_adjustment) VALUES (1, 'SE', 1.25, 'SEK', 1);`);
await runFile(db, 'db/base/locales.sql');
await runFile(db, 'db/base/product-currencies.sql');
await runFile(db, 'db/base/markets.sql');
await runFile(db, 'db/base/market_locales.sql');
// Fields
await runFile(db, 'db/base/order-fields.sql');
await runFile(db, 'db/base/order-row_fields.sql');
await runFile(db, 'db/base/product-fields.sql');
// Designers
await runFile(db, 'db/data/designers.sql');
await runFile(db, 'db/data/designer_texts.sql');
await runFile(db, 'db/data/designers-blocked.sql');
// Set the public as the default schema
await db.raw('set search_path to "public"');
// ----------------------------------
// Api Container
const buildContext = resolve(__dirname, '../../');
const nodeContainer = await GenericContainer.fromDockerfile(
buildContext,
).build();
const dbIpAddress = dbContainer.getIpAddress(network.getName());
const apiContainer = await nodeContainer
.withNetworkMode(network.getName())
.withNetworkAliases(ApiNetworkName)
.withExposedPorts(4000)
.withEnv(
'DATABASE_URL',
`postgresql://testuser:test@${dbIpAddress}:5432/photowalltest1`,
)
.withWaitStrategy(
Wait.forLogMessage('Server is running on http://localhost:4000'),
)
.start();
Object.assign(allContainers, {
version: Math.round(Math.random() * 999999),
dbContainer,
db,
apiContainer,
network,
stopAll: async () => {
await dbContainer.stop();
await apiContainer.stop();
await network.stop();
await db.destroy();
},
});
return allContainers;
};
+53
View File
@@ -0,0 +1,53 @@
--
-- PostgreSQL database dump
--
-- Dumped from database version 10.14
-- Dumped by pg_dump version 10.14
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
--
-- Data for Name: locales; Type: TABLE DATA; Schema: public; Owner: postgres
--
INSERT INTO public.locales (id, value, fallback_id, name) VALUES (1, 'sv_SE', NULL, 'Swedish (Sweden)');
INSERT INTO public.locales (id, value, fallback_id, name) VALUES (2, 'nn_NO', NULL, 'Norwegian Nynorsk (Norway)');
INSERT INTO public.locales (id, value, fallback_id, name) VALUES (3, 'en_GB', NULL, 'English (United Kingdom)');
INSERT INTO public.locales (id, value, fallback_id, name) VALUES (4, 'da_DK', NULL, 'Danish (Denmark)');
INSERT INTO public.locales (id, value, fallback_id, name) VALUES (5, 'fi_FI', NULL, 'Finnish (Finland)');
INSERT INTO public.locales (id, value, fallback_id, name) VALUES (7, 'en_EU', NULL, 'English (Europe)');
INSERT INTO public.locales (id, value, fallback_id, name) VALUES (8, 'de_DE', NULL, 'German (Germany)');
INSERT INTO public.locales (id, value, fallback_id, name) VALUES (11, 'en_US', NULL, 'English (United States)');
INSERT INTO public.locales (id, value, fallback_id, name) VALUES (12, 'es_ES', NULL, 'Spanish (Spain)');
INSERT INTO public.locales (id, value, fallback_id, name) VALUES (13, 'fr_FR', NULL, 'French (France)');
INSERT INTO public.locales (id, value, fallback_id, name) VALUES (14, 'pl_PL', NULL, 'Polish (Poland)');
INSERT INTO public.locales (id, value, fallback_id, name) VALUES (9, 'nl_NL', NULL, 'Dutch (Netherlands)');
INSERT INTO public.locales (id, value, fallback_id, name) VALUES (15, 'it_IT', NULL, 'Italian (Italy)');
INSERT INTO public.locales (id, value, fallback_id, name) VALUES (10, 'de_AT', 8, 'German (Austria)');
INSERT INTO public.locales (id, value, fallback_id, name) VALUES (17, 'nl_BE', 9, 'Dutch (Belgium)');
INSERT INTO public.locales (id, value, fallback_id, name) VALUES (16, 'fr_BE', 13, 'French (Belgium)');
INSERT INTO public.locales (id, value, fallback_id, name) VALUES (20, 'en_CA', 3, 'English (Canada)');
INSERT INTO public.locales (id, value, fallback_id, name) VALUES (21, 'fr_CA', 13, 'French (Canada)');
--
-- Name: locales_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public.locales_id_seq', 21, true);
--
-- PostgreSQL database dump complete
--
+53
View File
@@ -0,0 +1,53 @@
--
-- PostgreSQL database dump
--
-- Dumped from database version 10.14
-- Dumped by pg_dump version 10.14
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
--
-- Data for Name: market_locales; Type: TABLE DATA; Schema: public; Owner: postgres
--
INSERT INTO public.market_locales (id, market_id, locale_id, name) VALUES (1, 1, 1, 'Sweden');
INSERT INTO public.market_locales (id, market_id, locale_id, name) VALUES (2, 2, 2, 'Norway');
INSERT INTO public.market_locales (id, market_id, locale_id, name) VALUES (3, 3, 3, 'United Kingdom');
INSERT INTO public.market_locales (id, market_id, locale_id, name) VALUES (4, 4, 4, 'Denmark');
INSERT INTO public.market_locales (id, market_id, locale_id, name) VALUES (5, 5, 5, 'Finland');
INSERT INTO public.market_locales (id, market_id, locale_id, name) VALUES (6, 7, 7, 'International');
INSERT INTO public.market_locales (id, market_id, locale_id, name) VALUES (7, 8, 8, 'Germany');
INSERT INTO public.market_locales (id, market_id, locale_id, name) VALUES (8, 9, 9, 'Netherlands');
INSERT INTO public.market_locales (id, market_id, locale_id, name) VALUES (9, 10, 10, 'Austria');
INSERT INTO public.market_locales (id, market_id, locale_id, name) VALUES (10, 11, 11, 'USA');
INSERT INTO public.market_locales (id, market_id, locale_id, name) VALUES (11, 12, 12, 'Spain');
INSERT INTO public.market_locales (id, market_id, locale_id, name) VALUES (12, 13, 13, 'France');
INSERT INTO public.market_locales (id, market_id, locale_id, name) VALUES (13, 14, 14, 'Poland');
INSERT INTO public.market_locales (id, market_id, locale_id, name) VALUES (14, 15, 15, 'Italy');
INSERT INTO public.market_locales (id, market_id, locale_id, name) VALUES (15, 16, 16, 'Belgium (French)');
INSERT INTO public.market_locales (id, market_id, locale_id, name) VALUES (16, 16, 17, 'Belgium (Dutch)');
INSERT INTO public.market_locales (id, market_id, locale_id, name) VALUES (21, 19, 20, 'Canada (English)');
INSERT INTO public.market_locales (id, market_id, locale_id, name) VALUES (22, 19, 21, 'Canada (French)');
--
-- Name: market_locales_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public.market_locales_id_seq', 22, true);
--
-- PostgreSQL database dump complete
--
+51
View File
@@ -0,0 +1,51 @@
--
-- PostgreSQL database dump
--
-- Dumped from database version 10.14
-- Dumped by pg_dump version 10.14
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
--
-- Data for Name: markets; Type: TABLE DATA; Schema: public; Owner: postgres
--
INSERT INTO public.markets (id, name, vat, currency, price_adjustment) VALUES (1, 'SE', 1.25, 'SEK', 1);
INSERT INTO public.markets (id, name, vat, currency, price_adjustment) VALUES (2, 'NO', 1.25, 'NOK', 1.032);
INSERT INTO public.markets (id, name, vat, currency, price_adjustment) VALUES (3, 'GB', 1.20, 'GBP', 1.19);
INSERT INTO public.markets (id, name, vat, currency, price_adjustment) VALUES (4, 'DK', 1.25, 'DKK', 1.2);
INSERT INTO public.markets (id, name, vat, currency, price_adjustment) VALUES (5, 'FI', 1.24, 'EUR', 1.1165);
INSERT INTO public.markets (id, name, vat, currency, price_adjustment) VALUES (7, 'GLOBAL', 1.25, 'EUR', 1.13);
INSERT INTO public.markets (id, name, vat, currency, price_adjustment) VALUES (8, 'DE', 1.19, 'EUR', 1.13);
INSERT INTO public.markets (id, name, vat, currency, price_adjustment) VALUES (9, 'NL', 1.21, 'EUR', 1.15);
INSERT INTO public.markets (id, name, vat, currency, price_adjustment) VALUES (10, 'AT', 1.20, 'EUR', 1.1);
INSERT INTO public.markets (id, name, vat, currency, price_adjustment) VALUES (11, 'US', 1, 'USD', 1.06);
INSERT INTO public.markets (id, name, vat, currency, price_adjustment) VALUES (12, 'ES', 1.21, 'EUR', 1.13);
INSERT INTO public.markets (id, name, vat, currency, price_adjustment) VALUES (13, 'FR', 1.20, 'EUR', 1.13);
INSERT INTO public.markets (id, name, vat, currency, price_adjustment) VALUES (14, 'PL', 1.23, 'EUR', 0.8);
INSERT INTO public.markets (id, name, vat, currency, price_adjustment) VALUES (15, 'IT', 1.22, 'EUR', 1);
INSERT INTO public.markets (id, name, vat, currency, price_adjustment) VALUES (16, 'BE', 1.21, 'EUR', 1.15);
INSERT INTO public.markets (id, name, vat, currency, price_adjustment) VALUES (19, 'CA', 1, 'CAD', 1);
--
-- Name: markets_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public.markets_id_seq', 19, true);
--
-- PostgreSQL database dump complete
--
+133
View File
@@ -0,0 +1,133 @@
--
-- PostgreSQL database dump
--
-- Dumped from database version 10.14
-- Dumped by pg_dump version 10.14
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
--
-- Data for Name: order-fields; Type: TABLE DATA; Schema: public; Owner: postgres
--
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (213, 'delivery-countryCode', '2011-01-26 17:14:18.077944+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (214, 'confirmType', '2011-01-26 17:14:27.979311+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (215, 'confirmCode', '2011-01-26 17:14:27.988171+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (151, 'countryCode', '2009-11-15 12:54:01.960665+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (152, 'deliveryMethod', '2009-11-15 12:54:02.212188+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (153, 'deliveryPrice', '2009-11-15 12:54:02.221391+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (154, 'deliveryVAT', '2009-11-15 12:54:02.226784+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (155, 'co', '2009-11-16 15:31:50.72867+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (156, 'firstname', '2009-11-16 15:31:50.745995+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (157, 'lastname', '2009-11-16 15:31:50.751422+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (158, 'address', '2009-11-16 15:31:50.755472+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (159, 'zipcode', '2009-11-16 15:31:50.759443+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (160, 'city', '2009-11-16 15:31:50.76344+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (161, 'country', '2009-11-16 15:31:50.767436+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (162, 'att', '2009-11-16 15:31:50.771433+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (163, 'theirReference', '2009-11-16 15:31:50.775419+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (164, 'ourReference', '2009-11-16 15:31:50.779412+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (165, 'invoiceDays', '2009-11-16 15:31:50.783407+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (166, 'invoiceDate', '2009-11-16 15:31:50.787404+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (167, 'sent', '2009-11-16 15:31:50.791368+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (168, 'paid', '2009-11-16 15:31:50.795366+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (169, 'currency', '2009-11-16 15:31:50.799347+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (170, 'paymentType', '2009-11-16 15:31:50.80336+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (171, 'exchangeRate', '2009-11-16 15:31:50.807335+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (172, 'invoiceId', '2009-11-16 15:31:50.815193+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (173, 'invoice', '2009-11-16 15:31:50.819303+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (174, 'customInvoice', '2009-11-16 15:31:50.82332+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (175, 'confirmed', '2009-11-16 15:31:50.827284+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (176, 'delivered', '2009-11-16 15:31:50.83127+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (177, 'company', '2009-11-17 15:06:30.658968+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (178, 'deliverToBillingAddress', '2009-11-17 15:06:30.667595+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (179, 'delivery-name', '2009-11-17 15:06:30.671402+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (180, 'delivery-co', '2009-11-17 15:06:30.675389+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (181, 'delivery-address', '2009-11-17 15:06:30.679374+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (182, 'delivery-zipcode', '2009-11-17 15:06:30.68338+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (183, 'delivery-city', '2009-11-17 15:06:30.687345+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (184, 'email', '2009-11-17 15:06:30.691344+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (185, 'phone', '2009-11-17 15:06:30.695348+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (186, 'socialnr', '2009-11-17 15:06:30.699336+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (187, 'payment_cc', '2009-11-17 15:08:18.064322+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (188, 'newsletter', '2009-11-17 15:09:13.776076+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (189, 'conditions', '2009-11-17 15:09:13.784839+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (190, 'language', '2009-11-17 15:09:26.526853+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (191, 'contractCustomerId', '2009-11-17 21:55:32.233249+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (192, 'contractCode', '2009-11-17 21:55:32.240506+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (193, 'payment_contractCustomerId', '2009-11-17 21:55:32.244541+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (194, 'payment_contractCode', '2009-11-17 21:55:32.248434+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (195, 'readyForHandling', '2009-11-18 12:16:42.37864+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (197, 'debitechId', '2009-11-18 12:31:40.891089+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (198, 'kreditorOCR', '2009-11-29 13:52:03.248231+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (199, 'creditInvoice', '2009-11-29 17:04:03.689028+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (200, 'canceled', '2009-11-29 17:04:04.208346+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (201, 'isCompany', '2009-12-01 22:25:01.338583+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (202, 'VATNumber', '2009-12-01 22:25:01.354251+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (203, 'comment', '2009-12-02 19:18:08.745244+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (204, 'payment_partPaymentOption', '2010-01-04 15:55:30.023052+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (205, 'invoiceSent', '2010-01-29 09:15:33.891493+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (206, 'expirationDate', '2010-01-29 09:15:33.904602+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (207, 'invoicePaid', '2010-02-03 19:55:13.501902+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (208, 'url', '2010-05-10 16:26:58.541157+02', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (209, 'customerFirstname', '2010-07-01 16:51:56.977628+02', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (210, 'customerLastname', '2010-07-01 16:51:57.000753+02', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (211, 'customerEmail', '2010-07-01 16:51:57.004882+02', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (212, 'customerCellphone', '2010-07-01 16:51:57.00887+02', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (216, 'auto_confirm', '2011-07-06 17:02:32.152663+02', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (217, 'customerReference', '2011-12-21 06:58:57.76524+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (218, 'permit-custom-delivery', '2012-03-14 15:53:47.955684+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (219, 'reminder', '2012-08-21 13:29:57.007301+02', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (235, 'state', '2014-10-28 15:59:20.963126+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (221, 'delivery-firstname', '2013-09-25 11:13:14.701346+02', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (222, 'delivery-lastname', '2013-09-25 11:13:14.732662+02', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (223, 'exchangeRateEUR', '2014-02-12 14:05:13.811185+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (224, 'kreditorInvoiceNr', '2014-03-11 13:32:08.955331+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (225, 'deliveredDate', '2014-04-14 14:49:48.218233+02', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (226, 'paymentOption', '2014-05-06 15:09:17.438912+02', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (227, 'customerType', '2014-05-06 15:09:17.454562+02', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (228, 'payment_value', '2014-05-06 17:18:59.657062+02', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (229, 'checkout2', '2014-05-19 11:00:57.764424+02', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (230, 'kco_reservation', '2014-05-22 12:12:04.636264+02', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (231, 'gender', '2014-06-27 14:30:40.139601+02', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (232, 'houseNumber', '2014-06-27 14:30:40.168737+02', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (233, 'houseExtension', '2014-07-03 13:53:11.810161+02', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (234, 'delivery-houseNumber', '2014-08-11 11:56:42.814083+02', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (236, 'sessionId', '2014-10-30 11:01:13.88878+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (237, 'cancelsOrderId', '2015-01-22 12:28:08.440021+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (238, 'cancelledByOrderId', '2015-01-22 12:28:08.455379+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (239, 'kco_id', '2015-04-29 15:16:54.2688+02', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (240, 'flyerids', '2016-01-28 13:50:25.216807+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (241, 'skrill_failed_reason_code', '2016-06-14 10:28:35.202593+02', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (242, 'delivery-state', '2018-07-19 13:29:58.56812+02', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (243, 'delivery-houseExtension', '2018-09-24 15:20:01.168682+02', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (244, 'orderlog_id', '2018-12-06 07:53:46.82325+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (245, 'reseller_store', '2019-04-23 16:15:48.932163+02', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (246, 'order_sum', '2019-05-09 10:36:48.479137+02', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (247, 'klarna_order_id', '2019-07-31 11:14:41.209652+02', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (248, 'delivery-email', '2019-10-16 16:07:33.378237+02', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (249, 'delivery-phone', '2019-10-16 16:07:33.378237+02', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (250, 'pwinty_id', '2019-11-15 16:32:15.483531+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (251, 'delivery-company', '2020-01-21 10:49:01.525946+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (252, 'address2', '2020-03-25 13:16:14.564305+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (253, 'delivery-address2', '2020-03-25 13:16:14.564305+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (254, 'delivery_address_id', '2020-04-21 07:12:17.389941+02', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (255, 'billing_address_id', '2020-04-22 12:20:28.143979+02', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (256, 'market', '2020-10-28 12:56:23.052894+01', NULL);
INSERT INTO public."order-fields" (fieldid, name, inserted, updated) VALUES (257, 'locale', '2020-10-28 12:56:23.052894+01', NULL);
--
-- PostgreSQL database dump complete
--
+100
View File
@@ -0,0 +1,100 @@
--
-- PostgreSQL database dump
--
-- Dumped from database version 10.14
-- Dumped by pg_dump version 10.14
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
--
-- Data for Name: order-row_fields; Type: TABLE DATA; Schema: public; Owner: postgres
--
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (125, 'sealinglabel_printed', '2010-12-04 16:36:57.928533+01', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (126, 'imageprocessed', '2011-01-26 17:11:40.644271+01', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (127, 'imageprocessingrejected', '2011-01-26 17:11:40.644271+01', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (128, 'resolution', '2011-01-26 17:11:40.644271+01', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (129, 'imagedonotprint', '2011-01-31 11:04:38.192258+01', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (93, 'group', '2009-11-15 12:54:02.003423+01', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (94, 'type', '2009-11-15 12:54:02.007409+01', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (95, 'artNo', '2009-11-15 12:54:02.011399+01', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (96, 'path', '2009-11-15 12:54:02.015387+01', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (97, 'name', '2009-11-15 12:54:02.019383+01', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (98, 'price', '2009-11-15 12:54:02.023365+01', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (99, 'width', '2009-11-15 12:54:02.02737+01', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (100, 'height', '2009-11-15 12:54:02.031362+01', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (101, 'x', '2009-11-15 12:54:02.035348+01', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (102, 'y', '2009-11-15 12:54:02.039332+01', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (103, 'weight', '2009-11-15 12:54:02.043345+01', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (104, 'designer', '2009-11-15 12:54:02.047325+01', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (105, 'designerId', '2009-11-15 12:54:02.051316+01', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (106, 'commission', '2009-11-15 12:54:02.055309+01', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (107, 'commission_resale', '2009-11-15 12:54:02.059296+01', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (108, 'status', '2009-11-15 12:54:02.063292+01', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (109, 'process', '2009-11-15 12:54:02.067274+01', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (110, 'VAT', '2009-11-15 12:54:02.071262+01', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (111, 'qty', '2009-11-16 15:31:05.975322+01', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (112, 'fixedVAT', '2009-11-16 15:31:05.984399+01', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (113, 'modifier', '2009-11-17 15:07:29.126734+01', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (114, 'inquiryid', '2009-11-17 17:35:23.424403+01', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (115, 'code', '2009-11-18 12:29:30.453891+01', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (116, 'gvId', '2009-11-18 12:38:27.686007+01', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (117, 'currency', '2009-11-18 12:38:27.688769+01', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (118, 'comment', '2010-02-24 22:05:48.011688+01', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (119, 'stockPrice', '2010-03-25 20:19:17.556855+01', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (120, 'commission_amount', '2010-04-23 17:38:57.599672+02', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (121, 'stockPriceNote', '2010-05-21 15:22:27.395263+02', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (122, 'framed', '2010-12-03 16:48:46.562977+01', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (123, 'mirrored', '2010-12-03 16:48:46.575699+01', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (124, 'edge', '2010-12-03 16:48:46.57928+01', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (130, 'no_shipping', '2011-06-23 07:23:15.469812+02', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (91, 'printId', '2009-11-15 12:54:01.994651+01', '2012-01-24 13:15:18.053708+01');
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (92, 'productId', '2009-11-15 12:54:01.999438+01', '2012-01-24 13:15:18.053708+01');
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (131, 'material', '2012-01-24 13:15:18.053708+01', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (132, 'materialId', '2012-01-24 13:15:18.053708+01', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (133, 'stockId', '2012-01-25 13:08:30.273885+01', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (134, 'categoryId', '2013-05-16 12:22:16.624803+02', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (135, 'automated', '2014-01-29 14:39:22.084678+01', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (136, 'uploaded', '2014-01-29 14:39:22.102708+01', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (137, 'imgHash', '2014-05-20 13:15:01.793219+02', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (138, 'nameLocalized', '2014-05-20 13:15:01.827614+02', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (139, 'commission_agency', '2014-07-02 15:50:56.405149+02', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (140, 'commission_agency_resale', '2014-07-02 16:31:56.915017+02', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (141, 'commission_agency_amount', '2014-07-02 16:44:17.269389+02', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (142, 'discountType', '2014-07-02 18:37:16.551602+02', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (143, 'discountValue', '2014-07-02 18:37:16.573675+02', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (144, 'measure_unit', '2015-04-29 10:03:44.777182+02', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (145, 'packed', '2015-05-25 17:40:56.791918+02', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (146, 'retouch_price', '2017-12-06 17:07:44.181919+01', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (147, 'percent', '2018-03-13 11:37:21.730052+01', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (148, 'product_description', '2018-04-11 11:36:56.612066+02', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (149, 'displayWidth', '2018-05-14 16:08:03.159987+02', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (150, 'displayHeight', '2018-05-14 16:08:03.164747+02', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (151, 'imageWidth', '2019-01-23 09:45:24.717112+01', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (152, 'imageHeight', '2019-01-23 09:45:24.722189+01', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (153, 'posterHanger', '2019-01-23 09:45:24.726257+01', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (154, 'pwinty_image_id', '2019-11-15 16:32:15.483531+01', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (155, 'frame_color', '2019-11-15 16:32:15.483531+01', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (156, 'pwinty_sku', '2019-11-15 16:32:15.483531+01', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (157, 'orientation', '2019-12-16 13:18:46.329712+01', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (158, 'designerPath', '2020-11-04 11:20:27.227453+01', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (159, 'baseName', '2020-11-05 14:56:36.196463+01', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (160, 'edge_fixed', '2021-04-09 11:29:49.721368+02', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (161, 'width_mm', '2021-04-19 09:24:30.875672+02', NULL);
INSERT INTO public."order-row_fields" (fieldid, name, inserted, updated) VALUES (162, 'height_mm', '2021-04-19 09:24:30.875672+02', NULL);
--
-- PostgreSQL database dump complete
--
@@ -0,0 +1,37 @@
--
-- PostgreSQL database dump
--
-- Dumped from database version 10.14
-- Dumped by pg_dump version 10.14
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
--
-- Data for Name: product-currencies; Type: TABLE DATA; Schema: public; Owner: postgres
--
INSERT INTO public."product-currencies" (iso3char, exchange_rate) VALUES ('SEK', 1);
INSERT INTO public."product-currencies" (iso3char, exchange_rate) VALUES ('CAD', 0.12);
INSERT INTO public."product-currencies" (iso3char, exchange_rate) VALUES ('DKK', 0.775000);
INSERT INTO public."product-currencies" (iso3char, exchange_rate) VALUES ('EUR', 0.100000);
INSERT INTO public."product-currencies" (iso3char, exchange_rate) VALUES ('GBP', 0.077600);
INSERT INTO public."product-currencies" (iso3char, exchange_rate) VALUES ('NOK', 0.915500);
INSERT INTO public."product-currencies" (iso3char, exchange_rate) VALUES ('PLN', 0.443200);
INSERT INTO public."product-currencies" (iso3char, exchange_rate) VALUES ('RUB', 5.232700);
INSERT INTO public."product-currencies" (iso3char, exchange_rate) VALUES ('USD', 0.119800);
--
-- PostgreSQL database dump complete
--
+66
View File
@@ -0,0 +1,66 @@
--
-- PostgreSQL database dump
--
-- Dumped from database version 10.14
-- Dumped by pg_dump version 10.14
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
--
-- Data for Name: product-fields; Type: TABLE DATA; Schema: public; Owner: postgres
--
INSERT INTO public."product-fields" (fieldid, field, inserted, updated) VALUES (1, 'artNo', '2009-10-12 13:02:21.213474+02', NULL);
INSERT INTO public."product-fields" (fieldid, field, inserted, updated) VALUES (2, 'name', '2009-10-12 13:02:21.230972+02', NULL);
INSERT INTO public."product-fields" (fieldid, field, inserted, updated) VALUES (3, 'height', '2009-10-12 13:02:21.244131+02', NULL);
INSERT INTO public."product-fields" (fieldid, field, inserted, updated) VALUES (4, 'orgArtNo', '2009-10-12 13:02:21.256221+02', NULL);
INSERT INTO public."product-fields" (fieldid, field, inserted, updated) VALUES (5, 'width', '2009-10-12 13:02:21.269256+02', NULL);
INSERT INTO public."product-fields" (fieldid, field, inserted, updated) VALUES (6, 'widths', '2009-10-12 13:02:22.008722+02', NULL);
INSERT INTO public."product-fields" (fieldid, field, inserted, updated) VALUES (13, 'min-height', '2010-12-03 16:30:52.18902+01', NULL);
INSERT INTO public."product-fields" (fieldid, field, inserted, updated) VALUES (14, 'min-width', '2010-12-03 16:30:52.18902+01', NULL);
INSERT INTO public."product-fields" (fieldid, field, inserted, updated) VALUES (15, 'max-height', '2010-12-03 16:30:52.18902+01', NULL);
INSERT INTO public."product-fields" (fieldid, field, inserted, updated) VALUES (16, 'max-width', '2010-12-03 16:30:52.18902+01', NULL);
INSERT INTO public."product-fields" (fieldid, field, inserted, updated) VALUES (17, 'photowall_resolution', '2011-01-26 17:11:40.644271+01', '2011-02-24 16:23:18.871906+01');
INSERT INTO public."product-fields" (fieldid, field, inserted, updated) VALUES (18, 'canvas_resolution', '2011-02-24 16:23:18.871906+01', NULL);
INSERT INTO public."product-fields" (fieldid, field, inserted, updated) VALUES (19, 'wallpaper_resolution', '2011-02-24 16:23:18.871906+01', NULL);
INSERT INTO public."product-fields" (fieldid, field, inserted, updated) VALUES (20, 'lock_height', '2011-07-06 15:25:16.898145+02', NULL);
INSERT INTO public."product-fields" (fieldid, field, inserted, updated) VALUES (21, 'additionalprice', '2012-01-24 13:15:18.053708+01', NULL);
INSERT INTO public."product-fields" (fieldid, field, inserted, updated) VALUES (25, 'copyright', '2014-11-03 13:10:22.40505+01', NULL);
INSERT INTO public."product-fields" (fieldid, field, inserted, updated) VALUES (26, 'proportions_warning', '2015-03-09 10:30:50.360263+01', NULL);
INSERT INTO public."product-fields" (fieldid, field, inserted, updated) VALUES (27, 'margin_width_max', '2015-03-09 10:30:50.367125+01', NULL);
INSERT INTO public."product-fields" (fieldid, field, inserted, updated) VALUES (28, 'margin_width_min', '2015-03-09 10:30:50.373814+01', NULL);
INSERT INTO public."product-fields" (fieldid, field, inserted, updated) VALUES (29, 'margin_height_max', '2015-03-09 10:30:50.380639+01', NULL);
INSERT INTO public."product-fields" (fieldid, field, inserted, updated) VALUES (30, 'margin_height_min', '2015-03-09 10:30:50.387071+01', NULL);
INSERT INTO public."product-fields" (fieldid, field, inserted, updated) VALUES (31, 'focusXpoint', '2016-01-13 10:53:02.410018+01', NULL);
INSERT INTO public."product-fields" (fieldid, field, inserted, updated) VALUES (32, 'focusYpoint', '2016-01-13 10:53:02.410018+01', NULL);
INSERT INTO public."product-fields" (fieldid, field, inserted, updated) VALUES (33, 'focusXpoint2', '2016-01-13 10:53:02.410018+01', NULL);
INSERT INTO public."product-fields" (fieldid, field, inserted, updated) VALUES (34, 'focusYpoint2', '2016-01-13 10:53:02.410018+01', NULL);
INSERT INTO public."product-fields" (fieldid, field, inserted, updated) VALUES (35, 'repeating_pattern', '2016-01-13 10:53:02.410018+01', NULL);
INSERT INTO public."product-fields" (fieldid, field, inserted, updated) VALUES (36, 'batch', '2016-01-13 10:53:02.410018+01', NULL);
INSERT INTO public."product-fields" (fieldid, field, inserted, updated) VALUES (37, 'image_resolution', '2016-01-13 10:53:02.410018+01', NULL);
INSERT INTO public."product-fields" (fieldid, field, inserted, updated) VALUES (41, 'print_file_width', '2017-06-27 18:42:46.213367+02', NULL);
INSERT INTO public."product-fields" (fieldid, field, inserted, updated) VALUES (42, 'print_file_height', '2017-06-27 18:42:46.213367+02', NULL);
INSERT INTO public."product-fields" (fieldid, field, inserted, updated) VALUES (43, 'print_file_dpi', '2017-06-27 18:42:46.213367+02', NULL);
--
-- Name: product-fields_fieldid_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public."product-fields_fieldid_seq"', 43, true);
--
-- PostgreSQL database dump complete
--
+51
View File
@@ -0,0 +1,51 @@
--
-- PostgreSQL database dump
--
-- Dumped from database version 10.14
-- Dumped by pg_dump version 10.14
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
--
-- Data for Name: designer_texts; Type: TABLE DATA; Schema: public; Owner: postgres
--
INSERT INTO public.designer_texts (id, designerid, locale_id, header, description) VALUES (1303, 1, 4, 'Lorem Ipsumsson', 'Swedish graphic designer and illustrator Lorem Ipsumsson designs exquisite hand-drawn patterns. Her inspiration often comes from the beauty of the Northern nature, flora and fauna, and the contrast created when the raw and delicate collide. Lorem studied at Bergs School of Communication in Stockholm.');
INSERT INTO public.designer_texts (id, designerid, locale_id, header, description) VALUES (1304, 1, 10, 'Lorem Ipsumsson', 'Swedish graphic designer and illustrator Lorem Ipsumsson designs exquisite hand-drawn patterns. Her inspiration often comes from the beauty of the Northern nature, flora and fauna, and the contrast created when the raw and delicate collide. Lorem studied at Bergs School of Communication in Stockholm.');
INSERT INTO public.designer_texts (id, designerid, locale_id, header, description) VALUES (1305, 1, 8, 'Lorem Ipsumsson', 'Swedish graphic designer and illustrator Lorem Ipsumsson designs exquisite hand-drawn patterns. Her inspiration often comes from the beauty of the Northern nature, flora and fauna, and the contrast created when the raw and delicate collide. Lorem studied at Bergs School of Communication in Stockholm.');
INSERT INTO public.designer_texts (id, designerid, locale_id, header, description) VALUES (1306, 1, 7, 'Lorem Ipsumsson', 'Swedish graphic designer and illustrator Lorem Ipsumsson designs exquisite hand-drawn patterns. Her inspiration often comes from the beauty of the Northern nature, flora and fauna, and the contrast created when the raw and delicate collide. Lorem studied at Bergs School of Communication in Stockholm.');
INSERT INTO public.designer_texts (id, designerid, locale_id, header, description) VALUES (1307, 1, 3, 'Lorem Ipsumsson', 'Swedish graphic designer and illustrator Lorem Ipsumsson designs exquisite hand-drawn patterns. Her inspiration often comes from the beauty of the Northern nature, flora and fauna, and the contrast created when the raw and delicate collide. Lorem studied at Bergs School of Communication in Stockholm.');
INSERT INTO public.designer_texts (id, designerid, locale_id, header, description) VALUES (1308, 1, 11, 'Lorem Ipsumsson', 'Swedish graphic designer and illustrator Lorem Ipsumsson designs exquisite hand-drawn patterns. Her inspiration often comes from the beauty of the Northern nature, flora and fauna, and the contrast created when the raw and delicate collide. Lorem studied at Bergs School of Communication in Stockholm.');
INSERT INTO public.designer_texts (id, designerid, locale_id, header, description) VALUES (1309, 1, 12, 'Lorem Ipsumsson', 'La diseñadora gráfica e ilustradora sueca Lorem Ipsumsson diseña exquisitos patrones dibujados a mano. Su inspiración con frecuencia proviene de la belleza de la naturaleza, la flora y la fauna nórdicas, y el contraste que se crea cuando lo puro y lo delicado se encuentran. Lorem estudió en la Escuela de Comunicación Bergs, en Estocolmo.');
INSERT INTO public.designer_texts (id, designerid, locale_id, header, description) VALUES (1310, 1, 5, 'Lorem Ipsumsson', 'Swedish graphic designer and illustrator Lorem Ipsumsson designs exquisite hand-drawn patterns. Her inspiration often comes from the beauty of the Northern nature, flora and fauna, and the contrast created when the raw and delicate collide. Lorem studied at Bergs School of Communication in Stockholm.');
INSERT INTO public.designer_texts (id, designerid, locale_id, header, description) VALUES (1311, 1, 13, 'Lorem Ipsumsson', 'La designer et illustratrice suédoise Lorem Ipsumsson crée des motifs raffinés dessinés à la main. Elle s''inspire souvent de la beauté de la nature, de la faune et de la flore nordiques et du contraste entre les éléments bruts et délicats. Lorem a étudié à la Bergs School of Communication à Stockholm.');
INSERT INTO public.designer_texts (id, designerid, locale_id, header, description) VALUES (1312, 1, 9, 'Lorem Ipsumsson', 'Swedish graphic designer and illustrator Lorem Ipsumsson designs exquisite hand-drawn patterns. Her inspiration often comes from the beauty of the Northern nature, flora and fauna, and the contrast created when the raw and delicate collide. Lorem studied at Bergs School of Communication in Stockholm.');
INSERT INTO public.designer_texts (id, designerid, locale_id, header, description) VALUES (1313, 1, 2, 'Lorem Ipsumsson', 'Swedish graphic designer and illustrator Lorem Ipsumsson designs exquisite hand-drawn patterns. Her inspiration often comes from the beauty of the Northern nature, flora and fauna, and the contrast created when the raw and delicate collide. Lorem studied at Bergs School of Communication in Stockholm.');
INSERT INTO public.designer_texts (id, designerid, locale_id, header, description) VALUES (1314, 1, 14, 'Lorem Ipsumsson', 'Szwedzka projektantka graficzna i ilustratorka Lorem Ipsumsson projektuje piękne, ręcznie rysowane wzory. Jej inspiracją często jest piękno natury, flora i fauna północnych krain oraz kontrast wywołany zderzeniem surowości i delikatności. Lorem studiowała w Berghs School of Communication w Sztokholmie.');
INSERT INTO public.designer_texts (id, designerid, locale_id, header, description) VALUES (1316, 1, 1, 'Lorem Ipsumsson', 'Swedish graphic designer and illustrator Lorem Ipsumsson designs exquisite hand-drawn patterns. Her inspiration often comes from the beauty of the Northern nature, flora and fauna, and the contrast created when the raw and delicate collide. Lorem studied at Bergs School of Communication in Stockholm.');
INSERT INTO public.designer_texts (id, designerid, locale_id, header, description) VALUES (4287, 1, 17, 'Lorem Ipsumsson', 'Swedish graphic designer and illustrator Lorem Ipsumsson designs exquisite hand-drawn patterns. Her inspiration often comes from the beauty of the Northern nature, flora and fauna, and the contrast created when the raw and delicate collide. Lorem studied at Bergs School of Communication in Stockholm.');
INSERT INTO public.designer_texts (id, designerid, locale_id, header, description) VALUES (4506, 1, 16, 'Lorem Ipsumsson', 'La designer et illustratrice suédoise Lorem Ipsumsson crée des motifs raffinés dessinés à la main. Elle s''inspire souvent de la beauté de la nature, de la faune et de la flore nordiques et du contraste entre les éléments bruts et délicats. Lorem a étudié à la Bergs School of Communication à Stockholm.');
INSERT INTO public.designer_texts (id, designerid, locale_id, header, description) VALUES (5213, 1, 21, 'Lorem Ipsumsson', 'La designer et illustratrice suédoise Lorem Ipsumsson crée des motifs raffinés dessinés à la main. Elle s''inspire souvent de la beauté de la nature, de la faune et de la flore nordiques et du contraste entre les éléments bruts et délicats. Lorem a étudié à la Bergs School of Communication à Stockholm.');
INSERT INTO public.designer_texts (id, designerid, locale_id, header, description) VALUES (5447, 1, 20, 'Lorem Ipsumsson', 'Swedish graphic designer and illustrator Lorem Ipsumsson designs exquisite hand-drawn patterns. Her inspiration often comes from the beauty of the Northern nature, flora and fauna, and the contrast created when the raw and delicate collide. Lorem studied at Bergs School of Communication in Stockholm.');
--
-- Name: designer_texts_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public.designer_texts_id_seq', 5725, true);
--
-- PostgreSQL database dump complete
--
@@ -0,0 +1,29 @@
--
-- PostgreSQL database dump
--
-- Dumped from database version 10.14
-- Dumped by pg_dump version 10.14
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
--
-- Data for Name: designers-blocked; Type: TABLE DATA; Schema: public; Owner: postgres
--
INSERT INTO public."designers-blocked" (designerid, domain) VALUES (1, 'www.photowall.co.uk');
--
-- PostgreSQL database dump complete
--
+46
View File
@@ -0,0 +1,46 @@
--
-- PostgreSQL database dump
--
-- Dumped from database version 10.14
-- Dumped by pg_dump version 10.14
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
--
-- Data for Name: designers; Type: TABLE DATA; Schema: public; Owner: postgres
--
INSERT INTO public.designers (designerid, name, path, username, password, co, street, zipcode, city, territory, phone, email, orgnr, currency, commission, commission_resale, balance, description, comments, status, inserted, updated, license_image, type, segmentation, visible_search, visible_list, visible_productpage, visible_designerpage, sort_desc, no_follow, logotype, automatic_payout, pricepremium_wallpaper, pricepremium_canvas, pricepremium_poster, pricepremium_framed_print, wallpaper_image_id, canvas_image_id, poster_image_id, framed_print_image_id) VALUES (1, 'Lorem Ipsumsson', 'lorem-ipsumsson', 'lorem-ipsumsson', '4cf50742f0bef188434433f41f73b6b1', 'Testgatan 9', '', '123 45', 'Stockholm', 'SE', '070-123 45 67', 'lorem@loremipsum.se', '801234-0000', 'SEK', 18, 18, 0, NULL, '140827 upplagd av Amber
151021 Ayda
Kommission för aug €16,79 samt september €116,49 tot i sek ink moms 1562,54 utbetalas 151023.
150316 Anneli
Kommission för november 108,56
Kommission för december 50,76
Kommission för januari 80,36
Kommission för februari 54,79
Totalt 294,47 EUR / 3432 SEK (ink moms) utbetalas 150401.', 1, '2014-08-28 11:37:15.644547+02', '2021-04-15 08:07:14.322589+02', NULL, 'independent', 1, 1, 1, 1, 1, false, 0, 'designers/1.jpg', 1, 18, 18, 18, 18, NULL, NULL, NULL, NULL);
--
-- Name: designers_designerid_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public.designers_designerid_seq', 321, true);
--
-- PostgreSQL database dump complete
--
File diff suppressed because it is too large Load Diff
-71
View File
@@ -1,71 +0,0 @@
import fs from 'fs';
import { resolve } from 'path';
import { GenericContainer, StartedTestContainer } from 'testcontainers';
import Knex from 'knex';
import knexTinyLogger from 'knex-tiny-logger';
jest.setTimeout(18000_000);
const createKnexDb = (mappedPort: string, database: string) => {
const db = Knex({
client: 'pg',
connection: `postgresql://testuser:test@localhost:${mappedPort}/${database}`,
pool: { min: 0 },
});
knexTinyLogger(db);
return db;
};
const createDB = async (mappedPort): Promise<Knex> => {
const initialDb = createKnexDb(mappedPort, 'postgres');
await initialDb.raw('CREATE DATABASE photowalltest');
await initialDb.destroy();
const db = createKnexDb(mappedPort, 'photowalltest');
const sql = fs.readFileSync(resolve(__dirname, 'schema.sql')).toString();
await db.raw(sql);
return db;
};
const openTestContainer = async (): Promise<StartedTestContainer> => {
const container = await new GenericContainer('postgres')
.withEnv('POSTGRES_USER', 'testuser')
.withEnv('POSTGRES_PASSWORD', 'test')
.withEnv('POSTGRES_DB', 'apidb')
.withExposedPorts(5432)
.start();
// const stream = await container.logs();
// stream
// .on('data', (line) => console.debug(line))
// .on('err', (line) => console.error(line))
// .on('end', () => console.debug('Docker Container Stream closed...'));
return container;
};
function sleep(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}
describe('GenericContainer', () => {
let container: StartedTestContainer;
let db: Knex;
beforeAll(async () => {
container = await openTestContainer();
db = await createDB(container.getMappedPort(5432));
});
afterAll(async () => {
await container.stop();
await db.destroy();
});
it('works', async () => {
const res = await db.raw('select now()');
expect(res.rows[0]['now']).toBeInstanceOf(Date);
await sleep(2000000);
});
});
-19
View File
@@ -1,19 +0,0 @@
CREATE EXTENSION IF NOT EXISTS unaccent WITH SCHEMA public;
CREATE TABLE locales (
id SERIAL NOT NULL,
value character(5),
esales_locale character varying NOT NULL,
fallback_id integer,
name text NOT NULL
);
CREATE TABLE markets (
id SERIAL NOT NULL,
name character varying,
locale_id integer
);
CREATE TABLE market_locales (
id SERIAL NOT NULL,
market_id integer NOT NULL,
locale_id integer NOT NULL,
name text NOT NULL
);
+3
View File
@@ -0,0 +1,3 @@
export const sleep = (ms) => {
return new Promise((resolve) => setTimeout(resolve, ms));
};
+2
View File
@@ -11,6 +11,8 @@ import { ProductAPI } from './datasources/product-api';
import { DesignerAPI } from './datasources/designer-api';
import { Api2DataSource } from './datasources/api2-datasource';
console.log(`dbConfig`, dbConfig);
const knexConfig = knexStringcase(dbConfig);
// TODO: Try with this to see if - tables don't get converted