vanikam/migrations/20240723132531_cqrs_ordering_order_query.sql

18 lines
481 B
SQL

-- SPDX-FileCopyrightText: 2024 Aravinth Manivannan <realaravinth@batsense.net>
--
-- 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)
);