vidakovic commented on code in PR #3994: URL: https://github.com/apache/fineract/pull/3994#discussion_r1745433126
########## custom/v3/command/domain/src/main/resources/db/custom-changelog/0001_create_command_table.xml: ########## @@ -0,0 +1,62 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + +--> +<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.1.xsd"> + + <changeSet author="fineract" id="1" context="postgresql"> + <sql> + CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; + </sql> + </changeSet> + + <!-- Create the m_command table for PostgreSQL --> + <changeSet author="fineract" id="2" context="postgresql"> + <preConditions onFail="MARK_RAN"> + <not> + <tableExists tableName="m_command"/> + </not> + </preConditions> + + <createTable tableName="m_command"> + <column autoIncrement="true" name="id" type="BIGINT" remarks="Internal ID"> + <constraints nullable="false" primaryKey="true"/> + </column> + <column name="request_idempotency_key" type="VARCHAR(50)" remarks="Unique request idempotency key"> + <constraints nullable="false" unique="true"/> + </column> + <column name="command_processing_status" type="VARCHAR(255)" remarks="Command processing status"/> + <column name="command_result" type="TEXT" remarks="Command result"/> + <column name="result_status_code" type="INTEGER" remarks="Result status code"/> + <column name="created_date" type="TIMESTAMP WITH TIME ZONE" remarks="Creation date"/> + <column name="processed_at" type="TIMESTAMP WITH TIME ZONE" remarks="Processing timestamp"/> + <column name="request_body" type="TEXT" remarks="Request body"/> Review Comment: Also: type `TEXT` is not really the way to go... it should be in the database `jsonb` and Java side `com.fasterxml.jackson.databind.JsonNode`. That way we can keep the structure and the parsing is done automatically. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
