Gelato, external print products (#258)
Co-authored-by: Anders Gustafsson <anders@photowall.se> Co-authored-by: Arwid Thornström <arwidt@gmail.com> Co-authored-by: Fredrik Ringqvist <fredrik.ringqvist@photowall.se>
This commit is contained in:
co-authored by
Anders Gustafsson
Arwid Thornström
Fredrik Ringqvist
parent
de0372d79c
commit
28fa445143
@@ -13,7 +13,7 @@ The credentials for each environment that could be updated is stored in the
|
||||
`env/default.conf` could look like this:
|
||||
```
|
||||
#!/bin/bash
|
||||
export PSQL_OPTS="-h HOST_NAME -U USER_NAME"
|
||||
export PSQL_OPTS="-h HOST_NAME -U root"
|
||||
export DB_NAME=DATABASE_NAME
|
||||
```
|
||||
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
-- Gelato / External print
|
||||
|
||||
|
||||
-- modelled after Gelato
|
||||
ALTER TABLE orders DROP COLUMN IF EXISTS external_order_id;
|
||||
ALTER TABLE order_rows DROP COLUMN IF EXISTS external_status;
|
||||
DROP TABLE IF EXISTS external_print_products;
|
||||
DROP TYPE IF EXISTS external_status_type;
|
||||
DROP TYPE IF EXISTS orientation_type;
|
||||
DROP TYPE IF EXISTS orientation_type;
|
||||
|
||||
-- Order
|
||||
CREATE TYPE external_status_type AS ENUM (
|
||||
'N/A',
|
||||
'not_created',
|
||||
'created',
|
||||
'uploading',
|
||||
'passed',
|
||||
'failed',
|
||||
'canceled',
|
||||
'printed',
|
||||
'shipped',
|
||||
'delivered',
|
||||
'pending_approval',
|
||||
'draft',
|
||||
'not_connected'
|
||||
);
|
||||
|
||||
ALTER TABLE orders ADD COLUMN IF NOT EXISTS external_order_id text;
|
||||
|
||||
ALTER TABLE order_rows ADD COLUMN IF NOT EXISTS external_status external_status_type NOT NULL DEFAULT 'N/A';
|
||||
|
||||
|
||||
-- External print products
|
||||
CREATE TYPE orientation_type AS ENUM (
|
||||
'landscape',
|
||||
'portrait',
|
||||
'square'
|
||||
);
|
||||
|
||||
|
||||
-- product-groups.groupid senare
|
||||
CREATE TABLE external_print_products (
|
||||
id int GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
|
||||
orientation orientation_type NOT NULL,
|
||||
accessory TEXT NOT NULL,
|
||||
width_mm numeric NOT NULL,
|
||||
height_mm numeric NOT NULL,
|
||||
width_inch numeric NOT NULL,
|
||||
height_inch numeric NOT NULL,
|
||||
external_product_id TEXT NOT NULL UNIQUE,
|
||||
inserted timestamp with time zone DEFAULT now(),
|
||||
updated timestamp with time zone,
|
||||
price_sek numeric NOT NULL,
|
||||
group_id INT,
|
||||
CONSTRAINT fk_product_groups
|
||||
FOREIGN KEY(group_id)
|
||||
REFERENCES "product-groups"(groupid)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user