/usr/lib/bareos/scripts/ddl/updates/postgresql.2002_2003.sql is in bareos-database-postgresql 14.2.1+20141017gitc6c5b56-3+deb8u3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | BEGIN; -- Necessary for Bareos core
--
-- We drop and recreate the stats table which was not used yet.
--
DROP TABLE DeviceStats;
CREATE TABLE DeviceStats (
DeviceId INTEGER DEFAULT 0,
SampleTime TIMESTAMP WITHOUT TIME ZONE NOT NULL,
ReadTime BIGINT NOT NULL DEFAULT 0,
WriteTime BIGINT NOT NULL DEFAULT 0,
ReadBytes BIGINT DEFAULT 0,
WriteBytes BIGINT DEFAULT 0,
SpoolSize BIGINT DEFAULT 0,
NumWaiting SMALLINT DEFAULT 0,
NumWriters SMALLINT DEFAULT 0,
MediaId INTEGER NOT NULL,
VolCatBytes BIGINT DEFAULT 0,
VolCatFiles BIGINT DEFAULT 0,
VolCatBlocks BIGINT DEFAULT 0
);
--
-- We drop and recreate the stats table which was not used yet.
--
DROP TABLE JobStats;
CREATE TABLE JobStats (
DeviceId INTEGER DEFAULT 0,
SampleTime TIMESTAMP WITHOUT TIME ZONE NOT NULL,
JobId INTEGER NOT NULL,
JobFiles INTEGER DEFAULT 0,
JobBytes BIGINT DEFAULT 0
);
CREATE TABLE TapeAlerts (
DeviceId INTEGER DEFAULT 0,
SampleTime TIMESTAMP WITHOUT TIME ZONE NOT NULL,
AlertFlags BIGINT DEFAULT 0
);
DROP TABLE CDImages;
UPDATE Version SET VersionId = 2003;
COMMIT;
set client_min_messages = fatal;
ANALYSE;
|