Files
FamilyHUB/backend/migrations/000007_create_positions.up.sql
T
admin a0fb49a00f
Build and Deploy / build-and-deploy (push) Successful in 56s
Added possibility deploy with k3s
2026-05-24 21:58:46 +03:00

19 lines
530 B
SQL

CREATE TABLE positions
(
id BIGSERIAL PRIMARY KEY,
receipt_id BIGINT NOT NULL,
section_number TEXT,
gtin_code TEXT,
product_name TEXT NOT NULL,
product_count REAL NOT NULL,
amount REAL NOT NULL,
discount REAL,
surcharge REAL,
tag TEXT,
marking_code TEXT,
ukz_code TEXT,
FOREIGN KEY (receipt_id) REFERENCES receipts (id) ON DELETE CASCADE
);
CREATE INDEX idx_positions_receipt_id ON positions (receipt_id);