[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [OSSTEST PATCH 10/17] step logfiles: Provide new column



We will write things into it, and use it, soon.

This is the start of a "Populate-then-rely" schema change, as
described in schema/README.updates.  Specifically, the steps:
1. Commit: new schema update `add', status Preparatory
2. Commit: new schema update `constraint', status Unfinished

Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
---
 schema/steps-logfile-add.sql        |  8 ++++++++
 schema/steps-logfile-constraint.sql | 10 ++++++++++
 2 files changed, 18 insertions(+)
 create mode 100644 schema/steps-logfile-add.sql
 create mode 100644 schema/steps-logfile-constraint.sql

diff --git a/schema/steps-logfile-add.sql b/schema/steps-logfile-add.sql
new file mode 100644
index 0000000..5e37b10
--- /dev/null
+++ b/schema/steps-logfile-add.sql
@@ -0,0 +1,8 @@
+-- ##OSSTEST## 003 Preparatory
+--
+-- Previously, the logfile name was inferred from "stepno" and
+-- "testid".  We want to be able to set it explicitly for substeps.
+--
+-- This change is compatible with old code.
+
+ALTER TABLE steps ADD COLUMN logfile TEXT;
diff --git a/schema/steps-logfile-constraint.sql 
b/schema/steps-logfile-constraint.sql
new file mode 100644
index 0000000..100bb31
--- /dev/null
+++ b/schema/steps-logfile-constraint.sql
@@ -0,0 +1,10 @@
+-- ##OSSTEST## 004 Unfinished
+--
+-- Previously, the logfile name was inferred from "stepno" and
+-- "testid".  Newer code will need it to be set explicitly.
+
+UPDATE steps
+   SET logfile = stepno || '.' || step || '.log'
+ WHERE logfile is null;
+
+ALTER TABLE steps ALTER COLUMN logfile SET NOT NULL;
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.