From 6e0364c1ee4008d88b4661197e4b08016aff071e Mon Sep 17 00:00:00 2001 From: Aravinth Manivannan Date: Tue, 23 Jul 2024 20:32:54 +0530 Subject: [PATCH] feat: add Kot query table --- ...bc00c8291b5ca0624f6a8fcb1d701d6b383c5.json | 18 +++++++++ ...3e038af635766f0be61a86ca7084b34a2109d.json | 18 +++++++++ ...5fac6c716e1f575eb59d7a3a149d06760741b.json | 28 +++++++++++++ ...2a93b1c75304f8fad8922a6d62b5e06bd2490.json | 40 +++++++++++++++++++ ...e1e4d3a9b9a14c070846c8adb1ca0eaee1f37.json | 22 ++++++++++ ...20240723143757_cqrs_ordering_kot_query.sql | 16 ++++++++ 6 files changed, 142 insertions(+) create mode 100644 .sqlx/query-1804fe2c946337fb2d10683b273bc00c8291b5ca0624f6a8fcb1d701d6b383c5.json create mode 100644 .sqlx/query-4b7100e5c7442066dbb4ea7c9733e038af635766f0be61a86ca7084b34a2109d.json create mode 100644 .sqlx/query-5db3c3d1ff503d25d3f8fc529a95fac6c716e1f575eb59d7a3a149d06760741b.json create mode 100644 .sqlx/query-ad00213731142dc3853945e02662a93b1c75304f8fad8922a6d62b5e06bd2490.json create mode 100644 .sqlx/query-ff85b5343820fb3c30eb5e1efbfe1e4d3a9b9a14c070846c8adb1ca0eaee1f37.json create mode 100644 migrations/20240723143757_cqrs_ordering_kot_query.sql diff --git a/.sqlx/query-1804fe2c946337fb2d10683b273bc00c8291b5ca0624f6a8fcb1d701d6b383c5.json b/.sqlx/query-1804fe2c946337fb2d10683b273bc00c8291b5ca0624f6a8fcb1d701d6b383c5.json new file mode 100644 index 0000000..03b2769 --- /dev/null +++ b/.sqlx/query-1804fe2c946337fb2d10683b273bc00c8291b5ca0624f6a8fcb1d701d6b383c5.json @@ -0,0 +1,18 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO cqrs_ordering_kot_query (\n version,\n order_id,\n kot_id,\n created_time,\n deleted\n ) VALUES (\n $1, $2, $3, $4, $5\n );", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int8", + "Uuid", + "Uuid", + "Timestamptz", + "Bool" + ] + }, + "nullable": [] + }, + "hash": "1804fe2c946337fb2d10683b273bc00c8291b5ca0624f6a8fcb1d701d6b383c5" +} diff --git a/.sqlx/query-4b7100e5c7442066dbb4ea7c9733e038af635766f0be61a86ca7084b34a2109d.json b/.sqlx/query-4b7100e5c7442066dbb4ea7c9733e038af635766f0be61a86ca7084b34a2109d.json new file mode 100644 index 0000000..2aeaf77 --- /dev/null +++ b/.sqlx/query-4b7100e5c7442066dbb4ea7c9733e038af635766f0be61a86ca7084b34a2109d.json @@ -0,0 +1,18 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE\n cqrs_ordering_kot_query\n SET\n version = $1,\n order_id = $2,\n kot_id = $3,\n created_time = $4,\n deleted = $5;", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int8", + "Uuid", + "Uuid", + "Timestamptz", + "Bool" + ] + }, + "nullable": [] + }, + "hash": "4b7100e5c7442066dbb4ea7c9733e038af635766f0be61a86ca7084b34a2109d" +} diff --git a/.sqlx/query-5db3c3d1ff503d25d3f8fc529a95fac6c716e1f575eb59d7a3a149d06760741b.json b/.sqlx/query-5db3c3d1ff503d25d3f8fc529a95fac6c716e1f575eb59d7a3a149d06760741b.json new file mode 100644 index 0000000..2329729 --- /dev/null +++ b/.sqlx/query-5db3c3d1ff503d25d3f8fc529a95fac6c716e1f575eb59d7a3a149d06760741b.json @@ -0,0 +1,28 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT \n kot_id, version\n FROM\n cqrs_ordering_kot_query\n WHERE\n kot_id = $1;", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "kot_id", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "version", + "type_info": "Int8" + } + ], + "parameters": { + "Left": [ + "Uuid" + ] + }, + "nullable": [ + false, + false + ] + }, + "hash": "5db3c3d1ff503d25d3f8fc529a95fac6c716e1f575eb59d7a3a149d06760741b" +} diff --git a/.sqlx/query-ad00213731142dc3853945e02662a93b1c75304f8fad8922a6d62b5e06bd2490.json b/.sqlx/query-ad00213731142dc3853945e02662a93b1c75304f8fad8922a6d62b5e06bd2490.json new file mode 100644 index 0000000..667e3a7 --- /dev/null +++ b/.sqlx/query-ad00213731142dc3853945e02662a93b1c75304f8fad8922a6d62b5e06bd2490.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT \n order_id,\n kot_id,\n created_time,\n deleted\n FROM\n cqrs_ordering_kot_query\n WHERE\n kot_id = $1;", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "order_id", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "kot_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": "ad00213731142dc3853945e02662a93b1c75304f8fad8922a6d62b5e06bd2490" +} diff --git a/.sqlx/query-ff85b5343820fb3c30eb5e1efbfe1e4d3a9b9a14c070846c8adb1ca0eaee1f37.json b/.sqlx/query-ff85b5343820fb3c30eb5e1efbfe1e4d3a9b9a14c070846c8adb1ca0eaee1f37.json new file mode 100644 index 0000000..2143758 --- /dev/null +++ b/.sqlx/query-ff85b5343820fb3c30eb5e1efbfe1e4d3a9b9a14c070846c8adb1ca0eaee1f37.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT EXISTS (\n SELECT 1\n FROM cqrs_ordering_kot_query\n WHERE\n kot_id = $1\n );", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "exists", + "type_info": "Bool" + } + ], + "parameters": { + "Left": [ + "Uuid" + ] + }, + "nullable": [ + null + ] + }, + "hash": "ff85b5343820fb3c30eb5e1efbfe1e4d3a9b9a14c070846c8adb1ca0eaee1f37" +} diff --git a/migrations/20240723143757_cqrs_ordering_kot_query.sql b/migrations/20240723143757_cqrs_ordering_kot_query.sql new file mode 100644 index 0000000..31186c1 --- /dev/null +++ b/migrations/20240723143757_cqrs_ordering_kot_query.sql @@ -0,0 +1,16 @@ +-- SPDX-FileCopyrightText: 2024 Aravinth Manivannan +-- +-- SPDX-License-Identifier: AGPL-3.0-or-later + +CREATE TABLE IF NOT EXISTS cqrs_ordering_kot_query +( + version bigint CHECK (version >= 0) NOT NULL, + + created_time timestamp with time zone DEFAULT (CURRENT_TIMESTAMP) NOT NULL, + order_id UUID NOT NULL, + kot_id UUID NOT NULL UNIQUE, + + deleted BOOLEAN NOT NULL DEFAULT FALSE, + + PRIMARY KEY (kot_id) +);