-- SPDX-FileCopyrightText: 2024 Aravinth Manivannan -- -- SPDX-License-Identifier: AGPL-3.0-or-later CREATE TABLE IF NOT EXISTS cqrs_ordering_order_query ( version bigint CHECK (version >= 0) NOT NULL, created_time timestamp with time zone DEFAULT (CURRENT_TIMESTAMP) NOT NULL, order_id UUID NOT NULL UNIQUE, store_id UUID NOT NULL, customer_name TEXT, deleted BOOLEAN NOT NULL DEFAULT FALSE, PRIMARY KEY (order_id) );