mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 21:41:55 +00:00
15 lines
514 B
SQL
15 lines
514 B
SQL
CREATE TABLE stock_availabilities (
|
|
id BIGSERIAL PRIMARY KEY,
|
|
entity_type VARCHAR(50) NOT NULL,
|
|
entity_id BIGINT NOT NULL,
|
|
product_id BIGINT,
|
|
quantity NUMERIC(15, 3) NOT NULL DEFAULT 0,
|
|
reserved_quantity NUMERIC(15, 3) NOT NULL DEFAULT 0,
|
|
unit VARCHAR(20),
|
|
last_updated TIMESTAMPTZ DEFAULT now(),
|
|
created_at TIMESTAMPTZ DEFAULT now(),
|
|
deleted_at TIMESTAMPTZ
|
|
);
|
|
|
|
ALTER TABLE stock_availabilities
|
|
ADD CONSTRAINT fk_product_id FOREIGN KEY (product_id) REFERENCES products (id); |