# shell script to create Bacula MySQL tables
#
bindir=@SQL_BINDIR@
+db_name=@db_name@
if $bindir/mysql $* -f <<END-OF-DATA
-USE bacula;
+USE ${db_name};
--
-- Note, we use BLOB rather than TEXT because in MySQL,
-- BLOBs are identical to TEXT except that BLOB is case
LocLogId INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
Date DATETIME DEFAULT 0,
Comment BLOB NOT NULL,
- MediaId INTEGER UNSIGNED DEFAULT 0 REFERENCES Media;
- LocationId INTEGER UNSIGNED DEFAULT 0 REFERENCES LocationId;
+ MediaId INTEGER UNSIGNED DEFAULT 0 REFERENCES Media,
+ LocationId INTEGER UNSIGNED DEFAULT 0 REFERENCES Location,
NewVolStatus ENUM('Full', 'Archive', 'Append', 'Recycle', 'Purged',
'Read-Only', 'Disabled', 'Error', 'Busy', 'Used', 'Cleaning') NOT NULL,
NewEnabled TINYINT,
CREATE TABLE Log (
LogId INTEGER UNSIGNED AUTO_INCREMENT,
- JobId INTEGER INTEGER UNSIGNED DEFAULT 0 REFERENCES JobId,
+ JobId INTEGER UNSIGNED DEFAULT 0 REFERENCES Job,
Time DATETIME DEFAULT 0,
LogText BLOB NOT NULL,
PRIMARY KEY(LogId),