Skip to content

Instantly share code, notes, and snippets.

@dmacvicar
Created July 21, 2015 08:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmacvicar/a53e3cf972d0583ed1f0 to your computer and use it in GitHub Desktop.
Save dmacvicar/a53e3cf972d0583ed1f0 to your computer and use it in GitHub Desktop.
Patches for Spacewalk / SaltStack
From 0f1a58af683b7fdfff1f7a71defa883a8ab5d9da Mon Sep 17 00:00:00 2001
From: Johannes Renner <jrenner@suse.de>
Date: Tue, 14 Jul 2015 13:14:30 +0200
Subject: [PATCH] Database changes to enable the tracking of salt jobs
- create table rhnActionSaltJob
- insert action type salt.job
---
schema/spacewalk/common/data/rhnActionType.sql | 1 +
.../spacewalk/common/tables/rhnActionSaltJob.sql | 41 ++++++++++++++++++++++
2 files changed, 42 insertions(+)
create mode 100644 schema/spacewalk/common/tables/rhnActionSaltJob.sql
diff --git a/schema/spacewalk/common/data/rhnActionType.sql b/schema/spacewalk/common/data/rhnActionType.sql
index db62db4..23bbd00 100644
--- a/schema/spacewalk/common/data/rhnActionType.sql
+++ b/schema/spacewalk/common/data/rhnActionType.sql
@@ -74,6 +74,7 @@ insert into rhnActionType values (51, 'clientcert.update_client_cert', 'Update C
insert into rhnActionType values (500, 'image.deploy', 'Deploy an image to a virtual host.', 'N', 'N');
insert into rhnActionType values (501, 'distupgrade.upgrade', 'Service Pack Migration', 'N', 'N');
insert into rhnActionType values (502, 'packages.setLocks', 'Lock packages', 'N', 'N');
+insert into rhnActionType values (503, 'salt.job', 'Salt Job', 'N', 'N');
--
--
-- Revision 1.25 2004/10/29 05:07:52 pjones
diff --git a/schema/spacewalk/common/tables/rhnActionSaltJob.sql b/schema/spacewalk/common/tables/rhnActionSaltJob.sql
new file mode 100644
index 0000000..80c0d3d
--- /dev/null
+++ b/schema/spacewalk/common/tables/rhnActionSaltJob.sql
@@ -0,0 +1,41 @@
+--
+-- Copyright (c) 2015 SUSE LLC
+--
+-- This software is licensed to you under the GNU General Public License,
+-- version 2 (GPLv2). There is NO WARRANTY for this software, express or
+-- implied, including the implied warranties of MERCHANTABILITY or FITNESS
+-- FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
+-- along with this software; if not, see
+-- http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+--
+-- Red Hat trademarks are not licensed under GPLv2. No permission is
+-- granted to use or replicate Red Hat trademarks that are incorporated
+-- in this software or its documentation.
+--
+
+CREATE TABLE rhnActionSaltJob
+(
+ action_id NUMBER NOT NULL
+ CONSTRAINT rhn_act_saltjob_act_fk
+ REFERENCES rhnAction (id)
+ ON DELETE CASCADE,
+ jid VARCHAR2(2048) NOT NULL,
+ data BLOB
+)
+TABLESPACE [[blob]]
+ENABLE ROW MOVEMENT
+;
+
+CREATE UNIQUE INDEX rhn_act_saltjob_aid_idx
+ ON rhnActionSaltJob (action_id)
+ TABLESPACE [[4m_tbs]]
+ NOLOGGING;
+
+ALTER TABLE rhnActionSaltJob
+ ADD CONSTRAINT rhn_saltjob_aid_pk PRIMARY KEY (action_id);
+
+CREATE INDEX rhn_act_saltjob_jid_idx
+ ON rhnActionSaltJob (jid)
+ TABLESPACE [[4m_tbs]]
+ NOLOGGING;
+
--
2.4.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment