feat: define order query table

This commit is contained in:
Aravinth Manivannan 2024-07-23 19:18:09 +05:30
parent a1a8b47878
commit de81f09af8
Signed by: realaravinth
GPG key ID: F8F50389936984FF
6 changed files with 143 additions and 0 deletions

View file

@ -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"
}

View file

@ -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"
}

View file

@ -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"
}

View file

@ -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"
}

View file

@ -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"
}

View file

@ -0,0 +1,17 @@
-- 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,
customer_name TEXT NOT NULL,
deleted BOOLEAN NOT NULL DEFAULT FALSE,
PRIMARY KEY (order_id)
);