DROP TABLE IF EXISTS File;
DROP TABLE IF EXISTS Client;
DROP TABLE IF EXISTS Job;
-DROP TABLE IF EXISTS JobStat;
+DROP TABLE IF EXISTS JobHistory;
DROP TABLE IF EXISTS Media;
DROP TABLE IF EXISTS JobMedia;
DROP TABLE IF EXISTS Pool;
drop table jobmedia;
drop table file;
drop table job;
-drop table jobstat;
+drop table jobhistory;
drop table media;
drop table client;
drop table pool;
grant all on location to ${db_user};
grant all on locationlog to ${db_user};
grant all on log to ${db_user};
-grant all on jobstat to ${db_user};
+grant all on jobhistory to ${db_user};
-- for sequences on those tables
);
-- Create a table like Job for long term statistics
-CREATE TABLE JobStat (LIKE Job);
+CREATE TABLE JobHistory (LIKE Job);
CREATE TABLE Location (
LocationId INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
CREATE INDEX job_name_idx on job (name);
-- Create a table like Job for long term statistics
-CREATE TABLE jobstat (LIKE job);
+CREATE TABLE JobHistory (LIKE Job);
CREATE TABLE Location (
LocationId serial not null,
CREATE INDEX inx6 ON Job (Name);
-- Create a table like Job for long term statistics
-CREATE TABLE JobStat (
+CREATE TABLE JobHistory (
JobId INTEGER,
Job VARCHAR(128) NOT NULL,
Name VARCHAR(128) NOT NULL,
HasBase TINYINT DEFAULT 0,
PRIMARY KEY(JobId)
);
-CREATE INDEX inx61 ON JobStat (Name);
+CREATE INDEX inx61 ON JobHistory (Name);
CREATE TABLE Location (
LocationId INTEGER,
CREATE INDEX inx6 ON Job (Name);
-- Create a table like Job for long term statistics
-CREATE TABLE JobStat (
+CREATE TABLE JobHistory (
JobId INTEGER,
Job VARCHAR(128) NOT NULL,
Name VARCHAR(128) NOT NULL,
HasBase TINYINT DEFAULT 0,
PRIMARY KEY(JobId)
);
-CREATE INDEX inx61 ON JobStat (Name);
+CREATE INDEX inx61 ON JobHistory (Name);
CREATE TABLE Location (
LocationId INTEGER,
edit_uint64(now - age, ed1);
Mmsg(mdb->cmd,
- "INSERT INTO JobStat "
+ "INSERT INTO JobHistory "
"SELECT * "
"FROM Job "
"WHERE JobStatus IN ('T', 'f', 'A', 'E') "
- "AND JobId NOT IN (SELECT JobId FROM JobStat) "
+ "AND JobId NOT IN (SELECT JobId FROM JobHistory) "
"AND JobTDate < %s ", ed1);
QUERY_DB(jcr, mdb, mdb->cmd); /* TODO: get a message ? */
return sql_affected_rows(mdb);
USE ${db_name};
-- Create a table like Job for long term statistics
-CREATE TABLE JobStat (LIKE Job);
+CREATE TABLE JobHistory (LIKE Job);
-- Fix bad index on Media table
DROP INDEX inx8;
if $bindir/psql -f - -d ${db_name} $* <<END-OF-DATA
-- Create a table like Job for long term statistics
-CREATE TABLE jobstat (LIKE job);
+CREATE TABLE JobHistory (LIKE Job);
-UPDATE version SET versionid=11;
+UPDATE Version SET VersionId=11;
-vacuum analyse;
+-- vacuum analyse;
END-OF-DATA
then
BEGIN TRANSACTION;
-- Create a table like Job for long term statistics
-CREATE TABLE JobStat (
+CREATE TABLE JobHistory (
JobId INTEGER,
Job VARCHAR(128) NOT NULL,
Name VARCHAR(128) NOT NULL,
HasBase TINYINT DEFAULT 0,
PRIMARY KEY(JobId)
);
-CREATE INDEX inx61 ON JobStat (Name);
+CREATE INDEX inx61 ON JobHistory (Name);
UPDATE Version SET VersionId=11;
-- Create a table like Job for long term statistics
-CREATE TABLE JobStat (
+CREATE TABLE JobHistory (
JobId INTEGER,
Job VARCHAR(128) NOT NULL,
Name VARCHAR(128) NOT NULL,
HasBase TINYINT DEFAULT 0,
PRIMARY KEY(JobId)
);
-CREATE INDEX inx61 ON JobStat (Name);
+CREATE INDEX inx61 ON JobHistory (Name);
UPDATE Version SET VersionId=11;
utime_t now = (utime_t)time(NULL);
db_lock(ua->db);
- Mmsg(query, "DELETE FROM JobStat WHERE JobTDate < %s",
+ Mmsg(query, "DELETE FROM JobHistory WHERE JobTDate < %s",
edit_uint64(now - retention, ed1));
db_sql_query(ua->db, query.c_str(), NULL, NULL);
db_unlock(ua->db);
- ua->info_msg(_("Pruned Jobs from JobStat catalog.\n"));
+ ua->info_msg(_("Pruned Jobs from JobHistory catalog.\n"));
return true;
}
General:
+20Oct08
+ebl Rename JobStat table to JobHistory
19Oct08
kes Add Makefile dependency when using LIBTOOL_LINK so that any
change in ./configure options will be accounted for.