]> git.sur5r.net Git - bacula/bacula/commitdiff
- Fix a few problems with the MySQL table create in 1.37.
authorKern Sibbald <kern@sibbald.com>
Wed, 2 Mar 2005 14:40:59 +0000 (14:40 +0000)
committerKern Sibbald <kern@sibbald.com>
Wed, 2 Mar 2005 14:40:59 +0000 (14:40 +0000)
- Delete the new tables in the table delete files.
- Increase the number of items permitted in a conf table.

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1857 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/kernstodo
bacula/src/cats/drop_mysql_tables.in
bacula/src/cats/drop_postgresql_tables.in
bacula/src/cats/make_mysql_tables.in
bacula/src/dird/msgchan.c
bacula/src/lib/parse_conf.h

index 186742d3e2e5594a5f48c2ffab7a9bdc4d344c73..9e798b2759e8645c6ce9156ff718ce5489cb3322 100644 (file)
@@ -27,6 +27,13 @@ Suggestions for Preben:
 - Optimized bootstrap.
 
 Autochangers:
+- Fix
+   Please use the "label"  command to create a new Volume for:
+       Storage:      DDS-4-changer
+       Media type:   
+       Pool:         Default
+   label
+   The defined Storage resources are:
 - Copy Changer Device and Changer Command from Autochanger
   to Device resource in SD if none given in Device resource.
 - Doc the following
@@ -1267,4 +1274,3 @@ Block Position: 0
 - Bootstrap from JobMedia records.
 - Implement WildFile and WildDir to solve problem of 
   saving only *.doc files.
-
index 3c5fc9aaba11948c37296c9776ad0c45b2f8780a..c9fe22ed1aed81f17f42960a80dc5e00fb6a2347 100644 (file)
@@ -9,6 +9,9 @@ USE bacula;
 DROP TABLE IF EXISTS Filename;
 DROP TABLE IF EXISTS Path;
 DROP TABLE IF EXISTS LongName;
+DROP TABLE IF EXISTS Device;
+DROP TABLE IF EXISTS Storage;
+DROP TABLE IF EXISTS MediaType;
 DROP TABLE IF EXISTS File;
 DROP TABLE IF EXISTS Client;
 DROP TABLE IF EXISTS Job;
index ad3ec4a93564236bdd5f0b72b6ee4f72fc7461d9..93fe437f733aa973220991896e5a64681284b600 100644 (file)
@@ -19,6 +19,9 @@ drop table filename;
 drop table counters;
 drop table version;
 drop table CDImages;
+drop table Devices;
+drop table Storage;
+drop table MediaType;
 END-OF-DATA
 then
    echo "Deletion of Bacula PostgreSQL tables succeeded."
index 41ef3eff80a82ad704ea5bcc05d658bbb1621d97..e1ce1ad9d4f0201aa2fc623345e14b96d1c94def 100644 (file)
@@ -46,6 +46,40 @@ CREATE TABLE File (
 #  INDEX (JobId, PathId, FilenameId)
 #
 
+CREATE TABLE MediaType (
+   MediaTypeId INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
+   MediaType VARCHAR(128) NOT NULL,
+   ReadOnly TINYINT DEFAULT 0,
+   PRIMARY KEY(MediaTypeId)
+   );
+
+CREATE TABLE Storage (
+   StorageId INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
+   Name VARCHAR(128) NOT NULL,
+   AutoChanger TINYINT DEFAULT 0,
+   PRIMARY KEY(StorageId)
+   );
+
+CREATE TABLE Device (
+   DeviceId INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
+   Name VARCHAR(128) NOT NULL,
+   MediaTypeId INTEGER UNSIGNED NOT NULL REFERENCES MediaType,
+   StorageId INTEGER UNSIGNED NOT NULL REFERENCES Storage,
+   DevMounts INTEGER UNSIGNED DEFAULT 0,
+   DevReadBytes BIGINT UNSIGNED DEFAULT 0,
+   DevWriteBytes BIGINT UNSIGNED DEFAULT 0,
+   DevReadBytesSinceCleaning BIGINT UNSIGNED DEFAULT 0,
+   DevWriteBytesSinceCleaning BIGINT UNSIGNED DEFAULT 0,
+   DevReadTime BIGINT UNSIGNED DEFAULT 0,
+   DevWriteTime BIGINT UNSIGNED DEFAULT 0,
+   DevReadTimeSinceCleaning BIGINT UNSIGNED DEFAULT 0,
+   DevWriteTimeSinceCleaning BIGINT UNSIGNED DEFAULT 0,
+   CleaningDate DATETIME DEFAULT 0,
+   CleaningPeriod BIGINT UNSIGNED DEFAULT 0,
+   PRIMARY KEY(DeviceId)
+   );
+
+
 CREATE TABLE Job (
    JobId INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
    Job TINYBLOB NOT NULL,
@@ -125,7 +159,7 @@ CREATE TABLE Media (
    MaxVolFiles INTEGER UNSIGNED NOT NULL DEFAULT 0,
    MaxVolBytes BIGINT UNSIGNED NOT NULL DEFAULT 0,
    InChanger TINYINT NOT NULL DEFAULT 0,
-   StorageId INTEGER UNSIGNED DEFAULT 0 REFERENCES Storage,
+   StorageId INTEGER UNSIGNED NOT NULL REFERENCES Storage,
    MediaAddressing TINYINT NOT NULL DEFAULT 0,
    VolReadTime BIGINT UNSIGNED NOT NULL DEFAULT 0,
    VolWriteTime BIGINT UNSIGNED NOT NULL DEFAULT 0,
@@ -137,38 +171,6 @@ CREATE TABLE Media (
 
 CREATE INDEX inx8 ON Media (PoolId);
 
-CREATE TABLE MediaType (
-   MediaTypeId INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
-   MediaType VARCHAR(128) NOT NULL,
-   ReadOnly TINYINT DEFAULT 0,
-   PRIMARY KEY(MediaTypeId)
-   );
-
-CREATE TABLE Storage (
-   StorageId INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
-   Name VARCHAR(128) NOT NULL,
-   AutoChanger TINYINT DEFAULT 0,
-   PRIMARY KEY(StorageId)
-   );
-
-CREATE TABLE Device (
-   DeviceId INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
-   Name VARCHAR(128) NOT NULL,
-   MediaTypeId INTEGER UNSIGNED REFERENCES MediaType NOT NULL,
-   StorageId INTEGER UNSIGNED REFERENCES Storage,
-   DevMounts INTEGER UNSIGNED DEFAULT 0,
-   DevReadBytes BIGINT UNSIGNED DEFAULT 0,
-   DevWriteBytes BIGINT UNSIGNED DEFAULT 0,
-   DevReadBytesSinceCleaning BIGINT UNSIGNED DEFAULT 0,
-   DevWriteBytesSinceCleaning BIGINT UNSIGNED DEFAULT 0,
-   DevReadTime BIGINT UNSIGNED DEFAULT 0,
-   DevWriteTime BIGINT UNSIGNED DEFAULT 0,
-   DevReadTimeSinceCleaning BIGINT UNSIGNED DEFAULT 0,
-   DevWriteTimeSinceCleaning BIGINT UNSIGNED DEFAULT 0,
-   CleaningDate DATETIME DEFAULT 0,
-   CleaningPeriod BIGINT UNSIGNED DEFAULT 0,
-   PRIMARY KEY(DeviceId)
-   );
 
 
 CREATE TABLE Pool (
index 3e9199a1e4e9ffb02457cf2f7f7a827e6376fb7e..dce673fd4ac7992ce8134d59be1629aa94f368ef 100644 (file)
@@ -150,7 +150,7 @@ bool update_device_res(JCR *jcr, DEVICE *dev)
  */
 int start_storage_daemon_job(JCR *jcr, alist *store, int append)
 {
-   bool ok;
+   bool ok = false;
    STORE *storage;
    BSOCK *sd;
    char auth_key[100];
@@ -228,7 +228,6 @@ int start_storage_daemon_job(JCR *jcr, alist *store, int append)
            }
         } else {
            POOL_MEM err_msg;
-           ok = false;
            pm_strcpy(err_msg, sd->msg); /* save message */
             Jmsg(jcr, M_WARNING, 0, _("\n"
                "     Storage daemon didn't accept Device \"%s\" because:\n     %s"),
index 1bb1684b709854531bb913aec6b8087f76e31f91..18a22261da366124bbe5188436afbada1ac2c67d 100644 (file)
@@ -41,7 +41,7 @@ struct RES_ITEM {
 /* For storing name_addr items in res_items table */
 #define ITEM(x) ((void **)&res_all.x)
 
-#define MAX_RES_ITEMS 50             /* maximum resource items per RES */
+#define MAX_RES_ITEMS 70             /* maximum resource items per RES */
 
 /* This is the universal header that is
  * at the beginning of every resource