From de81f09af8d7eacc03c57f8e6dc036ecf7360944 Mon Sep 17 00:00:00 2001 From: Aravinth Manivannan Date: Tue, 23 Jul 2024 19:18:09 +0530 Subject: [PATCH] feat: define order query table --- ...de29a1a2b346b39c8d656c15c472dde68876e.json | 28 +++++++++++++ ...1d114407079fbe5723664004bd52bba0426ab.json | 22 ++++++++++ ...8e664c96299edfd9a11d08487e4db10a10e8b.json | 18 +++++++++ ...16a6e72bb0007a298cdba17f45f4b8bed5f56.json | 18 +++++++++ ...201ec52340d09d45041addd54eb349af82488.json | 40 +++++++++++++++++++ ...240723132531_cqrs_ordering_order_query.sql | 17 ++++++++ 6 files changed, 143 insertions(+) create mode 100644 .sqlx/query-79b4ef2c22faea05f053c04da49de29a1a2b346b39c8d656c15c472dde68876e.json create mode 100644 .sqlx/query-8e7d8433e8454e9a4edfb96852d1d114407079fbe5723664004bd52bba0426ab.json create mode 100644 .sqlx/query-a342003149f2991ef0280d008f18e664c96299edfd9a11d08487e4db10a10e8b.json create mode 100644 .sqlx/query-bc7d17aab113d0519c53e5f612116a6e72bb0007a298cdba17f45f4b8bed5f56.json create mode 100644 .sqlx/query-dbe1e41f04a81b2a504b9179911201ec52340d09d45041addd54eb349af82488.json create mode 100644 migrations/20240723132531_cqrs_ordering_order_query.sql diff --git a/.sqlx/query-79b4ef2c22faea05f053c04da49de29a1a2b346b39c8d656c15c472dde68876e.json b/.sqlx/query-79b4ef2c22faea05f053c04da49de29a1a2b346b39c8d656c15c472dde68876e.json new file mode 100644 index 0000000..134f882 --- /dev/null +++ b/.sqlx/query-79b4ef2c22faea05f053c04da49de29a1a2b346b39c8d656c15c472dde68876e.json @@ -0,0 +1,28 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT \n order_id, version\n FROM\n cqrs_ordering_order_query\n WHERE\n order_id = $1;", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "order_id", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "version", + "type_info": "Int8" + } + ], + "parameters": { + "Left": [ + "Uuid" + ] + }, + "nullable": [ + false, + false + ] + }, + "hash": "79b4ef2c22faea05f053c04da49de29a1a2b346b39c8d656c15c472dde68876e" +} diff --git a/.sqlx/query-8e7d8433e8454e9a4edfb96852d1d114407079fbe5723664004bd52bba0426ab.json b/.sqlx/query-8e7d8433e8454e9a4edfb96852d1d114407079fbe5723664004bd52bba0426ab.json new file mode 100644 index 0000000..822c5a8 --- /dev/null +++ b/.sqlx/query-8e7d8433e8454e9a4edfb96852d1d114407079fbe5723664004bd52bba0426ab.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT EXISTS (\n SELECT 1\n FROM cqrs_ordering_order_query\n WHERE\n order_id = $1\n );", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "exists", + "type_info": "Bool" + } + ], + "parameters": { + "Left": [ + "Uuid" + ] + }, + "nullable": [ + null + ] + }, + "hash": "8e7d8433e8454e9a4edfb96852d1d114407079fbe5723664004bd52bba0426ab" +} diff --git a/.sqlx/query-a342003149f2991ef0280d008f18e664c96299edfd9a11d08487e4db10a10e8b.json b/.sqlx/query-a342003149f2991ef0280d008f18e664c96299edfd9a11d08487e4db10a10e8b.json new file mode 100644 index 0000000..8fed07b --- /dev/null +++ b/.sqlx/query-a342003149f2991ef0280d008f18e664c96299edfd9a11d08487e4db10a10e8b.json @@ -0,0 +1,18 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO cqrs_ordering_order_query (\n version,\n customer_name,\n order_id,\n created_time,\n deleted\n\n ) VALUES (\n $1, $2, $3, $4, $5\n );", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int8", + "Text", + "Uuid", + "Timestamptz", + "Bool" + ] + }, + "nullable": [] + }, + "hash": "a342003149f2991ef0280d008f18e664c96299edfd9a11d08487e4db10a10e8b" +} diff --git a/.sqlx/query-bc7d17aab113d0519c53e5f612116a6e72bb0007a298cdba17f45f4b8bed5f56.json b/.sqlx/query-bc7d17aab113d0519c53e5f612116a6e72bb0007a298cdba17f45f4b8bed5f56.json new file mode 100644 index 0000000..bcbb2e8 --- /dev/null +++ b/.sqlx/query-bc7d17aab113d0519c53e5f612116a6e72bb0007a298cdba17f45f4b8bed5f56.json @@ -0,0 +1,18 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE\n cqrs_ordering_order_query\n SET\n version = $1,\n customer_name = $2,\n order_id = $3,\n created_time = $4,\n deleted = $5;", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int8", + "Text", + "Uuid", + "Timestamptz", + "Bool" + ] + }, + "nullable": [] + }, + "hash": "bc7d17aab113d0519c53e5f612116a6e72bb0007a298cdba17f45f4b8bed5f56" +} diff --git a/.sqlx/query-dbe1e41f04a81b2a504b9179911201ec52340d09d45041addd54eb349af82488.json b/.sqlx/query-dbe1e41f04a81b2a504b9179911201ec52340d09d45041addd54eb349af82488.json new file mode 100644 index 0000000..804ef95 --- /dev/null +++ b/.sqlx/query-dbe1e41f04a81b2a504b9179911201ec52340d09d45041addd54eb349af82488.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT \n customer_name,\n order_id,\n created_time,\n deleted\n FROM\n cqrs_ordering_order_query\n WHERE\n order_id = $1;", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "customer_name", + "type_info": "Text" + }, + { + "ordinal": 1, + "name": "order_id", + "type_info": "Uuid" + }, + { + "ordinal": 2, + "name": "created_time", + "type_info": "Timestamptz" + }, + { + "ordinal": 3, + "name": "deleted", + "type_info": "Bool" + } + ], + "parameters": { + "Left": [ + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "dbe1e41f04a81b2a504b9179911201ec52340d09d45041addd54eb349af82488" +} diff --git a/migrations/20240723132531_cqrs_ordering_order_query.sql b/migrations/20240723132531_cqrs_ordering_order_query.sql new file mode 100644 index 0000000..3b4b094 --- /dev/null +++ b/migrations/20240723132531_cqrs_ordering_order_query.sql @@ -0,0 +1,17 @@ +-- 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, + + customer_name TEXT NOT NULL, + + deleted BOOLEAN NOT NULL DEFAULT FALSE, + + PRIMARY KEY (order_id) +);