diff --git a/app/models/bacula_file.rb b/app/models/bacula_file.rb index f636a99..6eceb33 100644 --- a/app/models/bacula_file.rb +++ b/app/models/bacula_file.rb @@ -1,4 +1,13 @@ class BaculaFile < ActiveRecord::Base self.table_name = :File self.primary_key = :FileId + + alias_attribute :file_index, :FileIndex + alias_attribute :job_id, :JobId + alias_attribute :path_id, :PathId + alias_attribute :filename_id, :FilenameId + alias_attribute :delta_seq, :DeltaSeq + alias_attribute :mark_id, :MarkId + alias_attribute :l_stat, :LStat + alias_attribute :md5, :MD5 end diff --git a/app/models/base_file.rb b/app/models/base_file.rb index c6600ac..0a8f953 100644 --- a/app/models/base_file.rb +++ b/app/models/base_file.rb @@ -1,7 +1,13 @@ # The BaseFiles table contains all the File references for a particular JobId that point # to a Base file - i.e. they were previously saved and hence were not saved in the current # JobId but in BaseJobId under FileId. class BaseFile < ActiveRecord::Base self.table_name = :BaseFiles self.primary_key = :BaseId + + alias_attribute :id, :BaseId + alias_attribute :base_job_id, :BaseJobId + alias_attribute :job_id, :JobId + alias_attribute :file_id, :FileId + alias_attribute :file_index, :FileIndex end diff --git a/app/models/cd_image.rb b/app/models/cd_image.rb index 6dcd673..334935f 100644 --- a/app/models/cd_image.rb +++ b/app/models/cd_image.rb @@ -1,4 +1,6 @@ class CdImage < ActiveRecord::Base self.table_name = :CDImages self.primary_key = :MediaId + + alias_attribute :last_burn, :LastBurn end diff --git a/app/models/client.rb b/app/models/client.rb index 4607629..d68836c 100644 --- a/app/models/client.rb +++ b/app/models/client.rb @@ -1,4 +1,10 @@ class Client < ActiveRecord::Base self.table_name = :Client self.primary_key = :ClientId + + alias_attribute :name, :Name + alias_attribute :uname, :Uname + alias_attribute :auto_prune, :AutoPrune + alias_attribute :file_retention, :FileRetention + alias_attribute :job_retention, :JobRetention end diff --git a/app/models/counter.rb b/app/models/counter.rb index 658dd84..99d15a7 100644 --- a/app/models/counter.rb +++ b/app/models/counter.rb @@ -1,4 +1,10 @@ class Counter < ActiveRecord::Base self.table_name = :Counters self.primary_key = :Counter + + alias_attribute :counter, :Counter + alias_attribute :min_value, :MinValue + alias_attribute :max_value, :MaxValue + alias_attribute :current_value, :CurrentValue + alias_attribute :wrap_coounter, :WrapCounter end diff --git a/app/models/device.rb b/app/models/device.rb index d4e3316..71c0c37 100644 --- a/app/models/device.rb +++ b/app/models/device.rb @@ -1,4 +1,20 @@ class Device < ActiveRecord::Base self.table_name = :Device self.primary_key = :DeviceId + + alias_attribute :device_id, :DeviceId + alias_attribute :name, :Name + alias_attribute :media_type_id, :MediaTypeId + alias_attribute :storage_id, :StorageId + alias_attribute :dev_mounts, :DevMounts + alias_attribute :dev_read_bytes, :DevReadBytes + alias_attribute :dev_write_bytes, :DevWriteBytes + alias_attribute :dev_read_bytes_since_cleaning, :DevReadBytesSinceCleaning + alias_attribute :dev_write_bytes_since_cleaning, :DevWriteBytesSinceCleaning + alias_attribute :dev_read_time, :DevReadTime + alias_attribute :dev_write_time, :DevWriteTime + alias_attribute :dev_read_time_since_cleaning, :DevReadTimeSinceCleaning + alias_attribute :dev_write_time_since_cleaning, :DevWriteTimeSinceCleaning + alias_attribute :cleaning_date, :CleaningDate + alias_attribute :cleaning_period, :CleaningPeriod end diff --git a/app/models/file_set.rb b/app/models/file_set.rb index 735db48..d3ff48e 100644 --- a/app/models/file_set.rb +++ b/app/models/file_set.rb @@ -1,4 +1,9 @@ class FileSet < ActiveRecord::Base self.table_name = :FileSet self.primary_key = :FileSetId + + alias_attribute :file_set_id, :FileSetId + alias_attribute :file_set, :FileSet + alias_attribute :md5, :MD5 + alias_attribute :create_time, :CreateTime end diff --git a/app/models/filename.rb b/app/models/filename.rb index 5cb0cf2..1abec4d 100644 --- a/app/models/filename.rb +++ b/app/models/filename.rb @@ -1,4 +1,7 @@ class Filename < ActiveRecord::Base self.table_name = :Filename self.primary_key = :FilenameId + + alias_attribute :filename_id, :FilenameId + alias_attribute :name, :Name end diff --git a/app/models/job.rb b/app/models/job.rb index e3cab1c..b34a06d 100644 --- a/app/models/job.rb +++ b/app/models/job.rb @@ -1,4 +1,32 @@ class Job < ActiveRecord::Base self.table_name = :Job self.primary_key = :JobId + + alias_attribute :job_id, :JobId + alias_attribute :job, :Job + alias_attribute :name, :Name + alias_attribute :type, :Type + alias_attribute :level, :Level + alias_attribute :client_id, :ClientId + alias_attribute :job_status, :JobStatus + alias_attribute :sched_time, :SchedTime + alias_attribute :start_time, :StartTime + alias_attribute :end_time, :EndTime + alias_attribute :real_end_time, :RealEndTime + alias_attribute :job_t_date, :JobTDate + alias_attribute :vol_session_id, :VolSessionId + alias_attribute :vol_session_time, :VolSessionTime + alias_attribute :job_files, :JobFiles + alias_attribute :job_bytes, :JobBytes + alias_attribute :read_bytes, :ReadBytes + alias_attribute :job_errors, :JobErrors + alias_attribute :job_missing_files, :JobMissingFiles + alias_attribute :pool_id, :PoolId + alias_attribute :file_set_id, :FileSetId + alias_attribute :prior_job_id, :PriorJobId + alias_attribute :purged_files, :PurgedFiles + alias_attribute :has_base, :HasBase + alias_attribute :has_cache, :HasCache + alias_attribute :reviewed, :Reviewed + alias_attribute :comment, :Comment end diff --git a/app/models/job_histo.rb b/app/models/job_histo.rb index 3f2fc30..8f89229 100644 --- a/app/models/job_histo.rb +++ b/app/models/job_histo.rb @@ -1,3 +1,31 @@ class JobHisto < ActiveRecord::Base self.table_name = :JobHisto + + alias_attribute :job_id, :JobId + alias_attribute :job, :Job + alias_attribute :name, :Name + alias_attribute :type, :Type + alias_attribute :level, :Level + alias_attribute :client_id, :ClientId + alias_attribute :job_status, :JobStatus + alias_attribute :sched_time, :SchedTime + alias_attribute :start_time, :StartTime + alias_attribute :end_time, :EndTime + alias_attribute :real_end_time, :RealEndTime + alias_attribute :job_t_date, :JobTDate + alias_attribute :vol_session_id, :VolSessionId + alias_attribute :vol_session_time, :VolSessionTime + alias_attribute :job_files, :JobFiles + alias_attribute :job_bytes, :JobBytes + alias_attribute :read_bytes, :ReadBytes + alias_attribute :job_errors, :JobErrors + alias_attribute :job_missing_files, :JobMissingFiles + alias_attribute :pool_id, :PoolId + alias_attribute :file_set_id, :FileSetId + alias_attribute :prior_job_id, :PriorJobId + alias_attribute :purged_files, :PurgedFiles + alias_attribute :has_base, :HasBase + alias_attribute :has_cache, :HasCache + alias_attribute :reviewed, :Reviewed + alias_attribute :comment, :Comment end diff --git a/app/models/job_media.rb b/app/models/job_media.rb index 6156a03..ac4643e 100644 --- a/app/models/job_media.rb +++ b/app/models/job_media.rb @@ -1,4 +1,15 @@ class JobMedia < ActiveRecord::Base self.table_name = :JobMedia self.primary_key = :JobMediaId + + alias_attribute :job_media_id, :JobMediaId + alias_attribute :job_id, :JobId + alias_attribute :media_id, :MediaId + alias_attribute :first_index, :FirstIndex + alias_attribute :last_index, :LastIndex + alias_attribute :start_file, :StartFile + alias_attribute :end_file, :EndFile + alias_attribute :start_block, :StartBlock + alias_attribute :end_block, :EndBlock + alias_attribute :vol_index, :VolIndex end diff --git a/app/models/location.rb b/app/models/location.rb index d9ecbce..7faf1b3 100644 --- a/app/models/location.rb +++ b/app/models/location.rb @@ -1,4 +1,9 @@ class Location < ActiveRecord::Base self.table_name = :Location self.primary_key = :LocationId + + alias_attribute :location_id, :LocationId + alias_attribute :location, :Location + alias_attribute :cost, :Cost + alias_attribute :enabled, :Enabled end diff --git a/app/models/location_log.rb b/app/models/location_log.rb index 571e89b..fc5e784 100644 --- a/app/models/location_log.rb +++ b/app/models/location_log.rb @@ -1,4 +1,12 @@ class LocationLog < ActiveRecord::Base self.table_name = :LocationLog self.primary_key = :LocLogId + + alias_attribute :loc_log_id, :LocLogId + alias_attribute :date, :Date + alias_attribute :comment, :Comment + alias_attribute :media_id, :MediaId + alias_attribute :location_id, :LocationId + alias_attribute :new_vol_status, :NewVolStatus + alias_attribute :new_enabled, :NewEnabled end diff --git a/app/models/log.rb b/app/models/log.rb index 71369e6..2c10c39 100644 --- a/app/models/log.rb +++ b/app/models/log.rb @@ -1,4 +1,9 @@ class Log < ActiveRecord::Base self.table_name = :Log self.primary_key = :LogId + + alias_attribute :log_id, :LogId + alias_attribute :job_id, :JobId + alias_attribute :time, :Time + alias_attribute :log_text, :LogText end diff --git a/app/models/media.rb b/app/models/media.rb index 090132c..a701d5c 100644 --- a/app/models/media.rb +++ b/app/models/media.rb @@ -1,4 +1,47 @@ class Media < ActiveRecord::Base self.table_name = :Media self.primary_key = :MediaId + + alias_attribute :media_id, :MediaId + alias_attribute :volume_name, :VolumeName + alias_attribute :slot, :Slot + alias_attribute :pool_id, :PoolId + alias_attribute :media_type, :MediaType + alias_attribute :media_type_id, :MediaTypeId + alias_attribute :label_type, :LabelType + alias_attribute :first_written, :FirstWritten + alias_attribute :last_written, :LastWritten + alias_attribute :label_date, :LabelDate + alias_attribute :vol_jobs, :VolJobs + alias_attribute :vol_files, :VolFiles + alias_attribute :vol_blocks, :VolBlocks + alias_attribute :vol_mounts, :VolMounts + alias_attribute :vol_bytes, :VolBytes + alias_attribute :vol_parts, :VolParts + alias_attribute :vol_errors, :VolErrors + alias_attribute :vol_writes, :VolWrites + alias_attribute :vol_capacity_bytes, :VolCapacityBytes + alias_attribute :vol_status, :VolStatus + alias_attribute :enabled, :Enabled + alias_attribute :recycle, :Recycle + alias_attribute :action_on_purge, :ActionOnPurge + alias_attribute :vol_retention, :VolRetention + alias_attribute :vol_use_duration, :VolUseDuration + alias_attribute :max_vol_jobs, :MaxVolJobs + alias_attribute :max_vol_files, :MaxVolFiles + alias_attribute :max_vol_bytes, :MaxVolBytes + alias_attribute :in_changer, :InChanger + alias_attribute :storage_id, :StorageId + alias_attribute :device_id, :DeviceId + alias_attribute :media_addressing, :MediaAddressing + alias_attribute :vol_read_time, :VolReadTime + alias_attribute :vol_write_time, :VolWriteTime + alias_attribute :end_file, :EndFile + alias_attribute :end_block, :EndBlock + alias_attribute :location_id, :LocationId + alias_attribute :recycle_count, :RecycleCount + alias_attribute :initial_write, :InitialWrite + alias_attribute :scratch_pool_id, :ScratchPoolId + alias_attribute :recycle_pool_id, :RecyclePoolId + alias_attribute :comment, :Comment end diff --git a/app/models/media_type.rb b/app/models/media_type.rb index 90e2a2b..b5e4664 100644 --- a/app/models/media_type.rb +++ b/app/models/media_type.rb @@ -1,4 +1,8 @@ class MediaType < ActiveRecord::Base self.table_name = :MediaType self.primary_key = :MediaTypeId + + alias_attribute :media_type_id, :MediaTypeId + alias_attribute :media_type, :MediaType + alias_attribute :read_only, :ReadOnly end diff --git a/app/models/path.rb b/app/models/path.rb index 3992f78..d4e01fd 100644 --- a/app/models/path.rb +++ b/app/models/path.rb @@ -1,4 +1,7 @@ class Path < ActiveRecord::Base self.table_name = :Path self.primary_key = :PathId + + alias_attribute :path_id, :PathId + alias_attribute :path, :Path end diff --git a/app/models/path_hierarchy.rb b/app/models/path_hierarchy.rb index e388362..2e68c02 100644 --- a/app/models/path_hierarchy.rb +++ b/app/models/path_hierarchy.rb @@ -1,4 +1,7 @@ class PathHierarchy < ActiveRecord::Base self.table_name = :PathHierarchy self.primary_key = :PathId + + alias_attribute :path_id, :PathId + alias_attribute :p_path_id, :PPathId end diff --git a/app/models/path_visibility.rb b/app/models/path_visibility.rb index b64bbac..418dce6 100644 --- a/app/models/path_visibility.rb +++ b/app/models/path_visibility.rb @@ -1,4 +1,9 @@ class PathVisibility < ActiveRecord::Base self.table_name = :PathVisibility self.primary_key = [:JobId, :PathId] + + alias_attribute :path_id, :PathId + alias_attribute :job_id, :JobId + alias_attribute :size, :Size + alias_attribute :files, :Files end diff --git a/app/models/pool.rb b/app/models/pool.rb index b825c43..de66a54 100644 --- a/app/models/pool.rb +++ b/app/models/pool.rb @@ -1,4 +1,30 @@ class Pool < ActiveRecord::Base self.table_name = :Pool self.primary_key = :PoolId + + alias_attribute :pool_id, :PoolId + alias_attribute :name, :Name + alias_attribute :num_vols, :NumVols + alias_attribute :max_vols, :MaxVols + alias_attribute :use_once, :UseOnce + alias_attribute :use_catalog, :UseCatalog + alias_attribute :accept_any_volume, :AcceptAnyVolume + alias_attribute :vol_retention, :VolRetention + alias_attribute :vol_use_duration, :VolUseDuration + alias_attribute :max_vol_jobs, :MaxVolJobs + alias_attribute :max_vol_files, :MaxVolFiles + alias_attribute :max_vol_bytes, :MaxVolBytes + alias_attribute :auto_prune, :AutoPrune + alias_attribute :recycle, :Recycle + alias_attribute :action_on_purge, :ActionOnPurge + alias_attribute :pool_type, :PoolType + alias_attribute :label_type, :LabelType + alias_attribute :label_format, :LabelFormat + alias_attribute :enabled, :Enabled + alias_attribute :scratch_pool_id, :ScratchPoolId + alias_attribute :recycle_pool_id, :RecyclePoolId + alias_attribute :next_pool_id, :NextPoolId + alias_attribute :migration_high_bytes, :MigrationHighBytes + alias_attribute :migration_low_bytes, :MigrationLowBytes + alias_attribute :migration_time, :MigrationTime end diff --git a/app/models/restore_object.rb b/app/models/restore_object.rb index b3af9b9..bd4d096 100644 --- a/app/models/restore_object.rb +++ b/app/models/restore_object.rb @@ -1,4 +1,16 @@ class RestoreObject < ActiveRecord::Base self.table_name = :RestoreObject self.primary_key = :RestoreObjectId + + alias_attribute :restore_object_id, :RestoreObjectId + alias_attribute :object_name, :ObjectName + alias_attribute :restore_object, :RestoreObject + alias_attribute :plugin_name, :PluginName + alias_attribute :object_length, :ObjectLength + alias_attribute :object_full_length, :ObjectFullLength + alias_attribute :object_index, :ObjectIndex + alias_attribute :object_type, :ObjectType + alias_attribute :file_index, :FileIndex + alias_attribute :job_id, :JobId + alias_attribute :object_compression, :ObjectCompression end diff --git a/app/models/status.rb b/app/models/status.rb index b8bdc43..9ced15a 100644 --- a/app/models/status.rb +++ b/app/models/status.rb @@ -1,4 +1,8 @@ class Status < ActiveRecord::Base self.table_name = :Status self.primary_key = :JobStatus + + alias_attribute :job_status, :JobStatus + alias_attribute :job_status_long, :JobStatusLong + alias_attribute :severity, :Severity end diff --git a/app/models/storage.rb b/app/models/storage.rb index e6d8890..7aad3e3 100644 --- a/app/models/storage.rb +++ b/app/models/storage.rb @@ -1,4 +1,8 @@ class Storage < ActiveRecord::Base self.table_name = :Storage self.primary_key = :StorageId + + alias_attribute :storage_id, :StorageId + alias_attribute :name, :Name + alias_attribute :auto_changer, :AutoChanger end diff --git a/app/models/unsaved_file.rb b/app/models/unsaved_file.rb index 6ca6203..56b4866 100644 --- a/app/models/unsaved_file.rb +++ b/app/models/unsaved_file.rb @@ -1,4 +1,9 @@ class UnsavedFile < ActiveRecord::Base self.table_name = :UnsavedFiles self.primary_key = :UnsavedId + + alias_attribute :unsaved_id, :UnsavedId + alias_attribute :job_id, :JobId + alias_attribute :path_id, :PathId + alias_attribute :filename_id, :FilenameId end diff --git a/app/models/version.rb b/app/models/version.rb index 791ceca..1e17cc4 100644 --- a/app/models/version.rb +++ b/app/models/version.rb @@ -1,3 +1,5 @@ class Version < ActiveRecord::Base self.table_name = :Version + + alias_attribute :version_id, :VersionId end