Index: ReleaseNotes
===================================================================
---- ReleaseNotes (révision 8456)
-+++ ReleaseNotes (copie de travail)
+--- ReleaseNotes (revision 8456)
++++ ReleaseNotes (working copy)
@@ -17,10 +17,9 @@
This BETA release of Bacula uses a new catalog format. We provide a set of
this operation will take TIME and will DOUBLE THE SIZE of your
Index: src/dird/job.c
===================================================================
---- src/dird/job.c (révision 8456)
-+++ src/dird/job.c (copie de travail)
+--- src/dird/job.c (revision 8456)
++++ src/dird/job.c (working copy)
@@ -860,6 +860,7 @@
jcr->jr.JobStatus = jcr->JobStatus;
jcr->jr.JobFiles = jcr->JobFiles;
jcr->jr.JobErrors = jcr->Errors;
Index: src/dird/ua_prune.c
===================================================================
---- src/dird/ua_prune.c (révision 8456)
-+++ src/dird/ua_prune.c (copie de travail)
+--- src/dird/ua_prune.c (revision 8456)
++++ src/dird/ua_prune.c (working copy)
@@ -194,12 +194,12 @@
utime_t now = (utime_t)time(NULL);
}
Index: src/cats/sql_update.c
===================================================================
---- src/cats/sql_update.c (révision 8456)
-+++ src/cats/sql_update.c (copie de travail)
+--- src/cats/sql_update.c (revision 8456)
++++ src/cats/sql_update.c (working copy)
@@ -137,11 +137,11 @@
edit_uint64(now - age, ed1);
rdt,
Index: src/cats/update_postgresql_tables.in
===================================================================
---- src/cats/update_postgresql_tables.in (révision 8456)
-+++ src/cats/update_postgresql_tables.in (copie de travail)
-@@ -11,13 +11,24 @@
+--- src/cats/update_postgresql_tables.in (revision 8456)
++++ src/cats/update_postgresql_tables.in (working copy)
+@@ -11,13 +11,28 @@
if $bindir/psql -f - -d ${db_name} $* <<END-OF-DATA
---- Create a table like Job for long term statistics
--CREATE TABLE JobHistory (LIKE Job);
+-- The alter table operation can be faster with a big maintenance_work_mem
-+-- SET maintenance_work_mem = '1G';
-
++-- Uncomment and adapt this value to your environment
++-- SET maintenance_work_mem = '1GB';
++
+BEGIN;
+ALTER TABLE file ALTER fileid TYPE bigint ;
+ALTER TABLE basefiles ALTER fileid TYPE bigint;
+ALTER TABLE job ADD COLUMN readbytes bigint default 0;
++ALTER TABLE media ADD COLUMN ActionOnPurge smallint default 0;
++ALTER TABLE pool ADD COLUMN ActionOnPurge smallint default 0;
++
+ -- Create a table like Job for long term statistics
+-CREATE TABLE JobHistory (LIKE Job);
++CREATE TABLE JobHisto (LIKE Job);
++CREATE INDEX jobhisto_idx ON JobHisto ( starttime );
+
UPDATE Version SET VersionId=11;
+COMMIT;
+-- If you have already this table, you can remove it with:
-+-- DROP TABLE JobHisto;
-+
-+-- Create a table like Job for long term statistics
-+CREATE TABLE JobHisto (LIKE Job);
-+CREATE INDEX jobhistory_idx ON jobhistory ( starttime );
++-- DROP TABLE JobHistory;
+
-- vacuum analyse;
-
echo "Update of Bacula PostgreSQL tables succeeded."
Index: src/cats/make_sqlite3_tables.in
===================================================================
---- src/cats/make_sqlite3_tables.in (révision 8456)
-+++ src/cats/make_sqlite3_tables.in (copie de travail)
+--- src/cats/make_sqlite3_tables.in (revision 8456)
++++ src/cats/make_sqlite3_tables.in (working copy)
@@ -64,6 +64,7 @@
VolSessionTime INTEGER UNSIGNED DEFAULT 0,
JobFiles INTEGER UNSIGNED DEFAULT 0,
CREATE TABLE Location (
LocationId INTEGER,
-@@ -383,7 +383,7 @@
+@@ -183,6 +183,7 @@
+ VolStatus VARCHAR(20) NOT NULL,
+ Enabled TINYINT DEFAULT 1,
+ Recycle TINYINT DEFAULT 0,
++ ActionOnPurge TINYINT DEFAULT 0,
+ VolRetention BIGINT UNSIGNED DEFAULT 0,
+ VolUseDuration BIGINT UNSIGNED DEFAULT 0,
+ MaxVolJobs INTEGER UNSIGNED DEFAULT 0,
+@@ -256,6 +257,7 @@
+ MaxVolBytes BIGINT UNSIGNED DEFAULT 0,
+ AutoPrune TINYINT DEFAULT 0,
+ Recycle TINYINT DEFAULT 0,
++ ActionOnPurge TINYINT DEFAULT 0,
+ PoolType VARCHAR(20) NOT NULL,
+ LabelType TINYINT DEFAULT 0,
+ LabelFormat VARCHAR(128) NOT NULL,
+@@ -383,7 +385,7 @@
-- Initialize Version
PRAGMA default_cache_size = 100000;
Index: src/cats/cats.h
===================================================================
---- src/cats/cats.h (révision 8456)
-+++ src/cats/cats.h (copie de travail)
+--- src/cats/cats.h (revision 8456)
++++ src/cats/cats.h (working copy)
@@ -88,7 +88,7 @@
#if defined(BUILDING_CATS)
#ifdef HAVE_SQLITE
Index: src/cats/update_sqlite3_tables.in
===================================================================
---- src/cats/update_sqlite3_tables.in (révision 8456)
-+++ src/cats/update_sqlite3_tables.in (copie de travail)
+--- src/cats/update_sqlite3_tables.in (revision 8456)
++++ src/cats/update_sqlite3_tables.in (working copy)
@@ -15,10 +15,15 @@
db_name=@db_name@
JobErrors INTEGER UNSIGNED DEFAULT 0,
JobMissingFiles INTEGER UNSIGNED DEFAULT 0,
PoolId INTEGER UNSIGNED REFERENCES Pool DEFAULT 0,
-@@ -42,12 +48,55 @@
+@@ -42,12 +48,180 @@
PriorJobId INTEGER UNSIGNED REFERENCES Job DEFAULT 0,
PurgedFiles TINYINT DEFAULT 0,
HasBase TINYINT DEFAULT 0,
+
+DROP TABLE Job_backup;
+
++
++-- ----------------------------------------------------------------
++-- New ActionOnPurge field
++
++CREATE TEMPORARY TABLE pool_backup AS SELECT * FROM Pool;
++DROP TABLE Pool;
++
++CREATE TABLE Pool (
++ PoolId INTEGER,
++ Name VARCHAR(128) NOT NULL,
++ NumVols INTEGER UNSIGNED DEFAULT 0,
++ MaxVols INTEGER UNSIGNED DEFAULT 0,
++ UseOnce TINYINT DEFAULT 0,
++ UseCatalog TINYINT DEFAULT 1,
++ AcceptAnyVolume TINYINT DEFAULT 0,
++ VolRetention BIGINT UNSIGNED DEFAULT 0,
++ VolUseDuration BIGINT UNSIGNED DEFAULT 0,
++ MaxVolJobs INTEGER UNSIGNED DEFAULT 0,
++ MaxVolFiles INTEGER UNSIGNED DEFAULT 0,
++ MaxVolBytes BIGINT UNSIGNED DEFAULT 0,
++ AutoPrune TINYINT DEFAULT 0,
++ Recycle TINYINT DEFAULT 0,
++ ActionOnPurge TINYINT DEFAULT 0,
++ PoolType VARCHAR(20) NOT NULL,
++ LabelType TINYINT DEFAULT 0,
++ LabelFormat VARCHAR(128) NOT NULL,
++ Enabled TINYINT DEFAULT 1,
++ ScratchPoolId INTEGER UNSIGNED REFERENCES Pool DEFAULT 0,
++ RecyclePoolId INTEGER UNSIGNED REFERENCES Pool DEFAULT 0,
++ NextPoolId INTEGER UNSIGNED REFERENCES Pool DEFAULT 0,
++ MigrationHighBytes BIGINT UNSIGNED DEFAULT 0,
++ MigrationLowBytes BIGINT UNSIGNED DEFAULT 0,
++ MigrationTime BIGINT UNSIGNED DEFAULT 0,
++ UNIQUE (Name),
++ PRIMARY KEY (PoolId)
++ );
++
++INSERT INTO Pool (PoolId, Name, NumVols, MaxVols, UseOnce, UseCatalog,
++AcceptAnyVolume, VolRetention, VolUseDuration, MaxVolJobs, MaxVolFiles,
++MaxVolBytes, AutoPrune, Recycle, PoolType, LabelType,
++LabelFormat, Enabled, ScratchPoolId, RecyclePoolId, NextPoolId,
++MigrationHighBytes, MigrationLowBytes, MigrationTime)
++SELECT PoolId, Name, NumVols, MaxVols, UseOnce, UseCatalog, AcceptAnyVolume,
++VolRetention, VolUseDuration, MaxVolJobs, MaxVolFiles, MaxVolBytes, AutoPrune,
++Recycle, PoolType, LabelType, LabelFormat, Enabled,
++ScratchPoolId, RecyclePoolId, NextPoolId, MigrationHighBytes,
++MigrationLowBytes, MigrationTime FROM pool_backup;
++
++DROP TABLE pool_backup;
++
++-- ----------------------------------------------------------------
++-- New ActionOnPurge field
++
++CREATE TEMPORARY TABLE media_backup AS SELECT * FROM Media;
++DROP TABLE Media;
++
++CREATE TABLE Media (
++ MediaId INTEGER,
++ VolumeName VARCHAR(128) NOT NULL,
++ Slot INTEGER DEFAULT 0,
++ PoolId INTEGER UNSIGNED REFERENCES Pool DEFAULT 0,
++ MediaType VARCHAR(128) NOT NULL,
++ MediaTypeId INTEGER UNSIGNED REFERENCES MediaType DEFAULT 0,
++ LabelType TINYINT DEFAULT 0,
++ FirstWritten DATETIME DEFAULT 0,
++ LastWritten DATETIME DEFAULT 0,
++ LabelDate DATETIME DEFAULT 0,
++ VolJobs INTEGER UNSIGNED DEFAULT 0,
++ VolFiles INTEGER UNSIGNED DEFAULT 0,
++ VolBlocks INTEGER UNSIGNED DEFAULT 0,
++ VolMounts INTEGER UNSIGNED DEFAULT 0,
++ VolBytes BIGINT UNSIGNED DEFAULT 0,
++ VolParts INTEGER UNSIGNED DEFAULT 0,
++ VolErrors INTEGER UNSIGNED DEFAULT 0,
++ VolWrites INTEGER UNSIGNED DEFAULT 0,
++ VolCapacityBytes BIGINT UNSIGNED DEFAULT 0,
++ VolStatus VARCHAR(20) NOT NULL,
++ Enabled TINYINT DEFAULT 1,
++ Recycle TINYINT DEFAULT 0,
++ ActionOnPurge TINYINT DEFAULT 0,
++ VolRetention BIGINT UNSIGNED DEFAULT 0,
++ VolUseDuration BIGINT UNSIGNED DEFAULT 0,
++ MaxVolJobs INTEGER UNSIGNED DEFAULT 0,
++ MaxVolFiles INTEGER UNSIGNED DEFAULT 0,
++ MaxVolBytes BIGINT UNSIGNED DEFAULT 0,
++ InChanger TINYINT DEFAULT 0,
++ StorageId INTEGER UNSIGNED REFERENCES Storage DEFAULT 0,
++ DeviceId INTEGER UNSIGNED REFERENCES Device DEFAULT 0,
++ MediaAddressing TINYINT DEFAULT 0,
++ VolReadTime BIGINT UNSIGNED DEFAULT 0,
++ VolWriteTime BIGINT UNSIGNED DEFAULT 0,
++ EndFile INTEGER UNSIGNED DEFAULT 0,
++ EndBlock INTEGER UNSIGNED DEFAULT 0,
++ LocationId INTEGER UNSIGNED REFERENCES Location DEFAULT 0,
++ RecycleCount INTEGER UNSIGNED DEFAULT 0,
++ InitialWrite DATETIME DEFAULT 0,
++ ScratchPoolId INTEGER UNSIGNED REFERENCES Pool DEFAULT 0,
++ RecyclePoolId INTEGER UNSIGNED REFERENCES Pool DEFAULT 0,
++ Comment TEXT,
++ PRIMARY KEY(MediaId)
++ );
++
++CREATE INDEX inx8 ON Media (PoolId);
++
++INSERT INTO Media (
++ MediaId, VolumeName, Slot, PoolId, MediaType, MediaTypeId,
++ LabelType, FirstWritten, LastWritten, LabelDate, VolJobs,
++ VolFiles, VolBlocks, VolMounts, VolBytes, VolParts, VolErrors,
++ VolWrites, VolCapacityBytes, VolStatus, Enabled, Recycle,
++ VolRetention, VolUseDuration, MaxVolJobs,
++ MaxVolFiles, MaxVolBytes, InChanger, StorageId, DeviceId,
++ MediaAddressing, VolReadTime, VolWriteTime, EndFile, EndBlock,
++ LocationId, RecycleCount, InitialWrite, ScratchPoolId,
++ RecyclePoolId, Comment)
++SELECT MediaId, VolumeName, Slot, PoolId, MediaType, MediaTypeId,
++ LabelType, FirstWritten, LastWritten, LabelDate, VolJobs,
++ VolFiles, VolBlocks, VolMounts, VolBytes, VolParts, VolErrors,
++ VolWrites, VolCapacityBytes, VolStatus, Enabled, Recycle,
++ VolRetention, VolUseDuration, MaxVolJobs,
++ MaxVolFiles, MaxVolBytes, InChanger, StorageId, DeviceId,
++ MediaAddressing, VolReadTime, VolWriteTime, EndFile, EndBlock,
++ LocationId, RecycleCount, InitialWrite, ScratchPoolId,
++ RecyclePoolId, Comment FROM media_backup;
++
++DROP TABLE media_backup;
+
UPDATE Version SET VersionId=11;
-
COMMIT;
+-- If you have already this table, you can remove it with:
-+-- DROP TABLE JobHisto;
++-- DROP TABLE JobHistory;
+
+-- Create a table like Job for long term statistics
+CREATE TABLE JobHisto (
END-OF-DATA
Index: src/cats/make_postgresql_tables.in
===================================================================
---- src/cats/make_postgresql_tables.in (révision 8456)
-+++ src/cats/make_postgresql_tables.in (copie de travail)
+--- src/cats/make_postgresql_tables.in (revision 8456)
++++ src/cats/make_postgresql_tables.in (working copy)
@@ -15,7 +15,7 @@
);
CREATE TABLE Location (
LocationId serial not null,
Location text not null,
-@@ -300,7 +303,7 @@
+@@ -154,6 +157,7 @@
+ 'Error','Busy','Used','Cleaning','Scratch')),
+ enabled smallint default 1,
+ recycle smallint default 0,
++ ActionOnPurge smallint default 0,
+ volretention bigint default 0,
+ voluseduration bigint default 0,
+ maxvoljobs integer default 0,
+@@ -229,6 +233,7 @@
+ maxvolbytes bigint default 0,
+ autoprune smallint default 0,
+ recycle smallint default 0,
++ ActionOnPurge smallint default 0,
+ pooltype text
+ check (pooltype in ('Backup','Copy','Cloned','Archive','Migration','Scratch')),
+ labeltype integer default 0,
+@@ -300,7 +305,7 @@
(
baseid serial not null,
jobid integer not null,
fileindex integer ,
basejobid integer ,
primary key (baseid)
-@@ -377,7 +380,7 @@
+@@ -377,7 +382,7 @@
INSERT INTO Status (JobStatus,JobStatusLong) VALUES
('i', 'Doing batch insert file records');
Index: src/cats/update_sqlite_tables.in
===================================================================
---- src/cats/update_sqlite_tables.in (révision 8456)
-+++ src/cats/update_sqlite_tables.in (copie de travail)
+--- src/cats/update_sqlite_tables.in (revision 8456)
++++ src/cats/update_sqlite_tables.in (working copy)
@@ -17,9 +17,11 @@
${bindir}/${sqlite} $* ${db_name}.db <<END-OF-DATA
BEGIN TRANSACTION;
JobErrors INTEGER UNSIGNED DEFAULT 0,
JobMissingFiles INTEGER UNSIGNED DEFAULT 0,
PoolId INTEGER UNSIGNED REFERENCES Pool DEFAULT 0,
-@@ -43,12 +46,55 @@
+@@ -43,12 +46,182 @@
PriorJobId INTEGER UNSIGNED REFERENCES Job DEFAULT 0,
PurgedFiles TINYINT DEFAULT 0,
HasBase TINYINT DEFAULT 0,
+PurgedFiles, HasBase FROM Job_backup;
+
+DROP TABLE Job_backup;
++
++-- ----------------------------------------------------------------
++-- New ActionOnPurge field
++
++CREATE TEMPORARY TABLE pool_backup AS SELECT * FROM Pool;
++DROP TABLE Pool;
++
++CREATE TABLE Pool (
++ PoolId INTEGER,
++ Name VARCHAR(128) NOT NULL,
++ NumVols INTEGER UNSIGNED DEFAULT 0,
++ MaxVols INTEGER UNSIGNED DEFAULT 0,
++ UseOnce TINYINT DEFAULT 0,
++ UseCatalog TINYINT DEFAULT 1,
++ AcceptAnyVolume TINYINT DEFAULT 0,
++ VolRetention BIGINT UNSIGNED DEFAULT 0,
++ VolUseDuration BIGINT UNSIGNED DEFAULT 0,
++ MaxVolJobs INTEGER UNSIGNED DEFAULT 0,
++ MaxVolFiles INTEGER UNSIGNED DEFAULT 0,
++ MaxVolBytes BIGINT UNSIGNED DEFAULT 0,
++ AutoPrune TINYINT DEFAULT 0,
++ Recycle TINYINT DEFAULT 0,
++ ActionOnPurge TINYINT DEFAULT 0,
++ PoolType VARCHAR(20) NOT NULL,
++ LabelType TINYINT DEFAULT 0,
++ LabelFormat VARCHAR(128) NOT NULL,
++ Enabled TINYINT DEFAULT 1,
++ ScratchPoolId INTEGER UNSIGNED REFERENCES Pool DEFAULT 0,
++ RecyclePoolId INTEGER UNSIGNED REFERENCES Pool DEFAULT 0,
++ NextPoolId INTEGER UNSIGNED REFERENCES Pool DEFAULT 0,
++ MigrationHighBytes BIGINT UNSIGNED DEFAULT 0,
++ MigrationLowBytes BIGINT UNSIGNED DEFAULT 0,
++ MigrationTime BIGINT UNSIGNED DEFAULT 0,
++ UNIQUE (Name),
++ PRIMARY KEY (PoolId)
++ );
++
++INSERT INTO Pool (PoolId, Name, NumVols, MaxVols, UseOnce, UseCatalog,
++AcceptAnyVolume, VolRetention, VolUseDuration, MaxVolJobs, MaxVolFiles,
++MaxVolBytes, AutoPrune, Recycle, PoolType, LabelType,
++LabelFormat, Enabled, ScratchPoolId, RecyclePoolId, NextPoolId,
++MigrationHighBytes, MigrationLowBytes, MigrationTime)
++SELECT PoolId, Name, NumVols, MaxVols, UseOnce, UseCatalog, AcceptAnyVolume,
++VolRetention, VolUseDuration, MaxVolJobs, MaxVolFiles, MaxVolBytes, AutoPrune,
++Recycle, PoolType, LabelType, LabelFormat, Enabled,
++ScratchPoolId, RecyclePoolId, NextPoolId, MigrationHighBytes,
++MigrationLowBytes, MigrationTime FROM pool_backup;
++
++DROP TABLE pool_backup;
++
++-- ----------------------------------------------------------------
++-- New ActionOnPurge field
++
++CREATE TEMPORARY TABLE media_backup AS SELECT * FROM Media;
++DROP TABLE Media;
++
++CREATE TABLE Media (
++ MediaId INTEGER,
++ VolumeName VARCHAR(128) NOT NULL,
++ Slot INTEGER DEFAULT 0,
++ PoolId INTEGER UNSIGNED REFERENCES Pool DEFAULT 0,
++ MediaType VARCHAR(128) NOT NULL,
++ MediaTypeId INTEGER UNSIGNED REFERENCES MediaType DEFAULT 0,
++ LabelType TINYINT DEFAULT 0,
++ FirstWritten DATETIME DEFAULT 0,
++ LastWritten DATETIME DEFAULT 0,
++ LabelDate DATETIME DEFAULT 0,
++ VolJobs INTEGER UNSIGNED DEFAULT 0,
++ VolFiles INTEGER UNSIGNED DEFAULT 0,
++ VolBlocks INTEGER UNSIGNED DEFAULT 0,
++ VolMounts INTEGER UNSIGNED DEFAULT 0,
++ VolBytes BIGINT UNSIGNED DEFAULT 0,
++ VolParts INTEGER UNSIGNED DEFAULT 0,
++ VolErrors INTEGER UNSIGNED DEFAULT 0,
++ VolWrites INTEGER UNSIGNED DEFAULT 0,
++ VolCapacityBytes BIGINT UNSIGNED DEFAULT 0,
++ VolStatus VARCHAR(20) NOT NULL,
++ Enabled TINYINT DEFAULT 1,
++ Recycle TINYINT DEFAULT 0,
++ ActionOnPurge TINYINT DEFAULT 0,
++ VolRetention BIGINT UNSIGNED DEFAULT 0,
++ VolUseDuration BIGINT UNSIGNED DEFAULT 0,
++ MaxVolJobs INTEGER UNSIGNED DEFAULT 0,
++ MaxVolFiles INTEGER UNSIGNED DEFAULT 0,
++ MaxVolBytes BIGINT UNSIGNED DEFAULT 0,
++ InChanger TINYINT DEFAULT 0,
++ StorageId INTEGER UNSIGNED REFERENCES Storage DEFAULT 0,
++ DeviceId INTEGER UNSIGNED REFERENCES Device DEFAULT 0,
++ MediaAddressing TINYINT DEFAULT 0,
++ VolReadTime BIGINT UNSIGNED DEFAULT 0,
++ VolWriteTime BIGINT UNSIGNED DEFAULT 0,
++ EndFile INTEGER UNSIGNED DEFAULT 0,
++ EndBlock INTEGER UNSIGNED DEFAULT 0,
++ LocationId INTEGER UNSIGNED REFERENCES Location DEFAULT 0,
++ RecycleCount INTEGER UNSIGNED DEFAULT 0,
++ InitialWrite DATETIME DEFAULT 0,
++ ScratchPoolId INTEGER UNSIGNED REFERENCES Pool DEFAULT 0,
++ RecyclePoolId INTEGER UNSIGNED REFERENCES Pool DEFAULT 0,
++ Comment TEXT,
++ PRIMARY KEY(MediaId)
++ );
++
++CREATE INDEX inx8 ON Media (PoolId);
++
++INSERT INTO Media (
++ MediaId, VolumeName, Slot, PoolId, MediaType, MediaTypeId,
++ LabelType, FirstWritten, LastWritten, LabelDate, VolJobs,
++ VolFiles, VolBlocks, VolMounts, VolBytes, VolParts, VolErrors,
++ VolWrites, VolCapacityBytes, VolStatus, Enabled, Recycle,
++ VolRetention, VolUseDuration, MaxVolJobs,
++ MaxVolFiles, MaxVolBytes, InChanger, StorageId, DeviceId,
++ MediaAddressing, VolReadTime, VolWriteTime, EndFile, EndBlock,
++ LocationId, RecycleCount, InitialWrite, ScratchPoolId,
++ RecyclePoolId, Comment)
++SELECT MediaId, VolumeName, Slot, PoolId, MediaType, MediaTypeId,
++ LabelType, FirstWritten, LastWritten, LabelDate, VolJobs,
++ VolFiles, VolBlocks, VolMounts, VolBytes, VolParts, VolErrors,
++ VolWrites, VolCapacityBytes, VolStatus, Enabled, Recycle,
++ VolRetention, VolUseDuration, MaxVolJobs,
++ MaxVolFiles, MaxVolBytes, InChanger, StorageId, DeviceId,
++ MediaAddressing, VolReadTime, VolWriteTime, EndFile, EndBlock,
++ LocationId, RecycleCount, InitialWrite, ScratchPoolId,
++ RecyclePoolId, Comment FROM media_backup;
++
++DROP TABLE media_backup;
++
++-- ----------------------------------------------------------------
+
UPDATE Version SET VersionId=11;
COMMIT;
+-- If you have already this table, you can remove it with:
-+-- DROP TABLE JobHisto;
++-- DROP TABLE JobHistory;
+
+-- Create a table like Job for long term statistics
+CREATE TABLE JobHisto (
END-OF-DATA
Index: src/cats/update_mysql_tables.in
===================================================================
---- src/cats/update_mysql_tables.in (révision 8456)
-+++ src/cats/update_mysql_tables.in (copie de travail)
-@@ -12,16 +12,48 @@
+--- src/cats/update_mysql_tables.in (revision 8456)
++++ src/cats/update_mysql_tables.in (working copy)
+@@ -12,16 +12,50 @@
if $bindir/mysql $* -f <<END-OF-DATA
USE ${db_name};
+ALTER TABLE File CHANGE FileId FileId BIGINT UNSIGNED NOT NULL AUTO_INCREMENT;
+ALTER TABLE BaseFiles CHANGE FileId FileId BIGINT UNSIGNED NOT NULL;
+ALTER TABLE Job ADD ReadBytes BIGINT UNSIGNED DEFAULT 0 AFTER JobBytes;
++ALTER TABLE Media ADD ActionOnPurge TINYINT DEFAULT 0 AFTER Recycle;
++ALTER TABLE Pool ADD ActionOnPurge TINYINT DEFAULT 0 AFTER Recycle;
DELETE FROM Version;
INSERT INTO Version (VersionId) VALUES (11);
+-- If you have already this table, you can remove it with:
-+-- DROP TABLE JobHisto;
++-- DROP TABLE JobHistory;
+
+-- Create a table like Job for long term statistics
+CREATE TABLE JobHisto (
echo "Update of Bacula MySQL tables succeeded."
Index: src/cats/make_sqlite_tables.in
===================================================================
---- src/cats/make_sqlite_tables.in (révision 8456)
-+++ src/cats/make_sqlite_tables.in (copie de travail)
+--- src/cats/make_sqlite_tables.in (revision 8456)
++++ src/cats/make_sqlite_tables.in (working copy)
@@ -64,6 +64,7 @@
VolSessionTime INTEGER UNSIGNED DEFAULT 0,
JobFiles INTEGER UNSIGNED DEFAULT 0,
CREATE TABLE Location (
LocationId INTEGER,
-@@ -383,7 +383,7 @@
+@@ -183,6 +183,7 @@
+ VolStatus VARCHAR(20) NOT NULL,
+ Enabled TINYINT DEFAULT 1,
+ Recycle TINYINT DEFAULT 0,
++ ActionOnPurge TINYINT DEFAULT 0,
+ VolRetention BIGINT UNSIGNED DEFAULT 0,
+ VolUseDuration BIGINT UNSIGNED DEFAULT 0,
+ MaxVolJobs INTEGER UNSIGNED DEFAULT 0,
+@@ -256,6 +257,7 @@
+ MaxVolBytes BIGINT UNSIGNED DEFAULT 0,
+ AutoPrune TINYINT DEFAULT 0,
+ Recycle TINYINT DEFAULT 0,
++ ActionOnPurge TINYINT DEFAULT 0,
+ PoolType VARCHAR(20) NOT NULL,
+ LabelType TINYINT DEFAULT 0,
+ LabelFormat VARCHAR(128) NOT NULL,
+@@ -383,7 +385,7 @@
-- Initialize Version
PRAGMA default_synchronous = OFF;
Index: src/cats/sql_get.c
===================================================================
---- src/cats/sql_get.c (révision 8456)
-+++ src/cats/sql_get.c (copie de travail)
+--- src/cats/sql_get.c (revision 8456)
++++ src/cats/sql_get.c (working copy)
@@ -297,13 +297,13 @@
Mmsg(mdb->cmd, "SELECT VolSessionId,VolSessionTime,"
"PoolId,StartTime,EndTime,JobFiles,JobBytes,JobTDate,Job,JobStatus,"
jr->EndTime = str_to_utime(jr->cEndTime);
Index: src/cats/drop_mysql_tables.in
===================================================================
---- src/cats/drop_mysql_tables.in (révision 8456)
-+++ src/cats/drop_mysql_tables.in (copie de travail)
+--- src/cats/drop_mysql_tables.in (revision 8456)
++++ src/cats/drop_mysql_tables.in (working copy)
@@ -16,7 +16,7 @@
DROP TABLE IF EXISTS File;
DROP TABLE IF EXISTS Client;
DROP TABLE IF EXISTS Pool;
Index: src/cats/make_mysql_tables.in
===================================================================
---- src/cats/make_mysql_tables.in (révision 8456)
-+++ src/cats/make_mysql_tables.in (copie de travail)
+--- src/cats/make_mysql_tables.in (revision 8456)
++++ src/cats/make_mysql_tables.in (working copy)
@@ -29,7 +29,7 @@
CREATE TABLE Location (
LocationId INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
-@@ -269,7 +296,7 @@
+@@ -190,6 +217,7 @@
+ 'Read-Only', 'Disabled', 'Error', 'Busy', 'Used', 'Cleaning') NOT NULL,
+ Enabled TINYINT DEFAULT 1,
+ Recycle TINYINT DEFAULT 0,
++ ActionOnPurge TINYINT DEFAULT 0,
+ VolRetention BIGINT UNSIGNED DEFAULT 0,
+ VolUseDuration BIGINT UNSIGNED DEFAULT 0,
+ MaxVolJobs INTEGER UNSIGNED DEFAULT 0,
+@@ -229,6 +257,7 @@
+ MaxVolBytes BIGINT UNSIGNED DEFAULT 0,
+ AutoPrune TINYINT DEFAULT 0,
+ Recycle TINYINT DEFAULT 0,
++ ActionOnPurge TINYINT DEFAULT 0,
+ PoolType ENUM('Backup', 'Copy', 'Cloned', 'Archive', 'Migration', 'Scratch') NOT NULL,
+ LabelType TINYINT DEFAULT 0,
+ LabelFormat TINYBLOB,
+@@ -269,7 +298,7 @@
BaseId INTEGER UNSIGNED AUTO_INCREMENT,
BaseJobId INTEGER UNSIGNED NOT NULL REFERENCES Job,
JobId INTEGER UNSIGNED NOT NULL REFERENCES Job,
FileIndex INTEGER UNSIGNED,
PRIMARY KEY(BaseId)
);
-@@ -333,7 +360,7 @@
+@@ -333,7 +362,7 @@
);
-- Initialize Version
then
Index: src/bc_types.h
===================================================================
---- src/bc_types.h (révision 8456)
-+++ src/bc_types.h (copie de travail)
+--- src/bc_types.h (revision 8456)
++++ src/bc_types.h (working copy)
@@ -57,7 +57,7 @@
* In principle, the only field that really should need to be
* 64 bits is the FileId_t