aboutsummaryrefslogtreecommitdiff
path: root/libbrep
diff options
context:
space:
mode:
Diffstat (limited to 'libbrep')
-rw-r--r--libbrep/package.cxx2
-rw-r--r--libbrep/package.hxx21
-rw-r--r--libbrep/package.xml6
3 files changed, 27 insertions, 2 deletions
diff --git a/libbrep/package.cxx b/libbrep/package.cxx
index ecd6592..a01ed14 100644
--- a/libbrep/package.cxx
+++ b/libbrep/package.cxx
@@ -58,6 +58,7 @@ namespace brep
license_alternatives_type la,
strings tg,
optional<string> ds,
+ optional<text_type> dt,
string ch,
optional<url_type> ur,
optional<url_type> du,
@@ -86,6 +87,7 @@ namespace brep
license_alternatives (move (la)),
tags (move (tg)),
description (move (ds)),
+ description_type (move (dt)),
changes (move (ch)),
url (move (ur)),
doc_url (move (du)),
diff --git a/libbrep/package.hxx b/libbrep/package.hxx
index 2f293c1..2e31ff4 100644
--- a/libbrep/package.hxx
+++ b/libbrep/package.hxx
@@ -21,7 +21,7 @@
//
#define LIBBREP_PACKAGE_SCHEMA_VERSION_BASE 11
-#pragma db model version(LIBBREP_PACKAGE_SCHEMA_VERSION_BASE, 11, closed)
+#pragma db model version(LIBBREP_PACKAGE_SCHEMA_VERSION_BASE, 12, closed)
namespace brep
{
@@ -45,6 +45,21 @@ namespace brep
#pragma db value(priority) definition
#pragma db member(priority::value) column("")
+ // text_type
+ //
+ using bpkg::text_type;
+ using bpkg::to_text_type;
+
+ #pragma db map type(text_type) as(string) \
+ to(to_string (?)) \
+ from(brep::to_text_type (?))
+
+ using optional_text_type = optional<text_type>;
+
+ #pragma db map type(optional_text_type) as(brep::optional_string) \
+ to((?) ? to_string (*(?)) : brep::optional_string ()) \
+ from((?) ? brep::to_text_type (*(?)) : brep::optional_text_type ())
+
// url
//
using bpkg::url;
@@ -348,6 +363,7 @@ namespace brep
license_alternatives_type,
strings tags,
optional<string> description,
+ optional<text_type> description_type,
string changes,
optional<url_type>,
optional<url_type> doc_url,
@@ -396,7 +412,8 @@ namespace brep
string summary;
license_alternatives_type license_alternatives;
strings tags;
- optional<string> description;
+ optional<string> description; // Absent if type is unknown.
+ optional<text_type> description_type; // Present if description is present.
string changes;
optional<url_type> url;
optional<url_type> doc_url;
diff --git a/libbrep/package.xml b/libbrep/package.xml
index 8ba96ec..fdb4f04 100644
--- a/libbrep/package.xml
+++ b/libbrep/package.xml
@@ -1,4 +1,10 @@
<changelog xmlns="http://www.codesynthesis.com/xmlns/odb/changelog" database="pgsql" schema-name="package" version="1">
+ <changeset version="12">
+ <alter-table name="package">
+ <add-column name="description_type" type="TEXT" null="true"/>
+ </alter-table>
+ </changeset>
+
<model version="11">
<table name="tenant" kind="object">
<column name="id" type="TEXT" null="false"/>