money without backwards compatibility2

This commit is contained in:
Priec
2026-07-12 22:29:22 +02:00
parent 68f0dc7b24
commit ca1bbf84fb
4 changed files with 18 additions and 32 deletions

Binary file not shown.

View File

@@ -42,10 +42,9 @@ pub struct PostTableDefinitionRequest {
/// like "public", "information_schema", or ones starting with "pg\_".
#[prost(string, tag = "5")]
pub profile_name: ::prost::alloc::string::String,
/// ISO-4217 base currency used by every MONEY column in this table.
#[prost(string, tag = "6")]
pub base_currency: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "7")]
pub money_columns: ::prost::alloc::vec::Vec<MoneyColumnOptions>,
}
/// Defines append-only column additions for an existing table.
#[derive(serde::Serialize, serde::Deserialize)]
@@ -63,21 +62,10 @@ pub struct AddTableColumnsRequest {
/// Optional indexes for the new columns only.
#[prost(string, repeated, tag = "4")]
pub indexes: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(message, repeated, tag = "5")]
pub money_columns: ::prost::alloc::vec::Vec<MoneyColumnOptions>,
#[prost(string, tag = "6")]
/// Required when adding the first MONEY column to a table.
#[prost(string, tag = "5")]
pub base_currency: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct MoneyColumnOptions {
#[prost(string, tag = "1")]
pub column_name: ::prost::alloc::string::String,
#[prost(bool, tag = "2")]
pub immutable: bool,
#[prost(enumeration = "MoneyRounding", tag = "3")]
pub rounding: i32,
}
/// Describes one user-defined column for a table.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
@@ -100,6 +88,12 @@ pub struct ColumnDefinition {
/// s ≤ p and p ≥ 1.
#[prost(string, tag = "2")]
pub field_type: ::prost::alloc::string::String,
/// Once initially stored, this column can never be changed.
#[prost(bool, tag = "3")]
pub immutable: bool,
/// MONEY rounding applied before an immutable value is initially stored.
#[prost(enumeration = "MoneyRounding", tag = "4")]
pub rounding: i32,
}
/// Response after table creation (success + DDL preview).
#[derive(serde::Serialize, serde::Deserialize)]
@@ -235,8 +229,6 @@ pub struct TableDetail {
pub scripts: ::prost::alloc::vec::Vec<ScriptInfo>,
#[prost(string, tag = "5")]
pub base_currency: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "6")]
pub money_columns: ::prost::alloc::vec::Vec<MoneyColumnOptions>,
}
/// A script that targets a specific column in a table.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]