CREATE TABLE IF NOT EXISTS %sitename%_receipt_items (
    id SERIAL PRIMARY KEY, 
    type VARCHAR(255) NOT NULL,
    receipt_id INTEGER NOT NULL,
    barcode VARCHAR(255) NOT NULL, 
    name VARCHAR(255) NOT NULL, 
    qty FLOAT8 NOT NULL, 
    data JSONB, 
    status VARCHAR (64),
    CONSTRAINT fk_receipt
        FOREIGN KEY(receipt_id) 
        REFERENCES %sitename%_receipts(id)
        ON DELETE CASCADE
);