From d259750511b3c2aaeace49f8ccb1d7f3ad561452 Mon Sep 17 00:00:00 2001
From: Karen Arutyunov <karen@codesynthesis.com>
Date: Thu, 9 Dec 2021 15:47:34 +0300
Subject: Prepare for supporting multiple ids in requirement alternative

---
 libbrep/build-extra.sql | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

(limited to 'libbrep/build-extra.sql')

diff --git a/libbrep/build-extra.sql b/libbrep/build-extra.sql
index bd3df2b..a8464cf 100644
--- a/libbrep/build-extra.sql
+++ b/libbrep/build-extra.sql
@@ -12,6 +12,8 @@ DROP FOREIGN TABLE IF EXISTS build_package_builds;
 
 DROP FOREIGN TABLE IF EXISTS build_package_tests;
 
+DROP FOREIGN TABLE IF EXISTS build_package_requirement_alternative_requirements;
+
 DROP FOREIGN TABLE IF EXISTS build_package_requirement_alternatives;
 
 DROP FOREIGN TABLE IF EXISTS build_package_requirements;
@@ -82,9 +84,22 @@ CREATE FOREIGN TABLE build_package_requirement_alternatives (
   version_revision INTEGER NOT NULL,
   requirement_index BIGINT NOT NULL,
   index BIGINT NOT NULL,
-  id TEXT NOT NULL)
+  enable TEXT NULL)
 SERVER package_server OPTIONS (table_name 'package_requirement_alternatives');
 
+CREATE FOREIGN TABLE build_package_requirement_alternative_requirements (
+  tenant TEXT NOT NULL,
+  name CITEXT NOT NULL,
+  version_epoch INTEGER NOT NULL,
+  version_canonical_upstream TEXT NOT NULL,
+  version_canonical_release TEXT NOT NULL COLLATE "C",
+  version_revision INTEGER NOT NULL,
+  requirement_index BIGINT NOT NULL,
+  alternative_index BIGINT NOT NULL,
+  index BIGINT NOT NULL,
+  id TEXT NOT NULL)
+SERVER package_server OPTIONS (table_name 'package_requirement_alternative_requirements');
+
 -- The foreign table for the build_package object tests member (that is of a
 -- container type).
 --
-- 
cgit v1.1

