def template_columns(): return [ PkBigname('template'), Name('mode'), Name('owner'), Name('grp_owner'), Num('templatefile')]
def mounts_columns(): return [ PkName('mnt_name'), Name('mnt_point'), Name('fstype'), Name('mnt_opts'), Name('dump'), Name('pass') ]
def __init__(self, kernels_table, profiles_table, diskconfig_table): machine_col = PkName('machine') kernel_col = Name('kernel') kernel_col.set_fk(kernels_table) profile_col = Name('profile') profile_col.set_fk(profiles_table) diskconfig_col = Name('diskconfig') diskconfig_col.set_fk(diskconfig_table) columns = [machine_col, kernel_col, profile_col, diskconfig_col] Table.__init__(self, 'machines', columns)
def packages_columns(): return [ PkBigname('package'), Name('priority'), Bigname('section'), Num('installedsize'), Bigname('filename'), Bigname('maintainer'), Bigname('size'), Name('md5sum'), Bigname('version'), Text('description')]
def __init__(self, mach_types_table, kernels_table, profiles_table, filesystem_table): machine_col = PkName('machine') mtype_col = Name('machine_type') mtype_col.set_fk(mach_types_table) kernel_col = Name('kernel') kernel_col.set_fk(kernels_table) profile_col = Name('profile') profile_col.set_fk(profiles_table) fs_col = Name('filesystem') fs_col.set_fk(filesystem_table, 'filesystem') columns = [machine_col, mtype_col, kernel_col, profile_col, fs_col] Table.__init__(self, 'machines', columns)
def profile_columns(): return [ PkName('profile'), Name('suite'), Bigname('template'), Text('description') ]
def __init__(self): idcol = PkName('name') keyid = Name('keyid') keyid.constraint.unique = True data = Text('data') columns = [idcol, keyid, data] Table.__init__(self, 'archive_keys', columns)
def __init__(self, suite, traits_table, packages_table): packs_column = PkBigname('package') packs_column.set_fk(packages_table) action_column = Name('action') action_column.constraint.default = 'install' columns = [packs_column, action_column] tablename = ujoin(suite, 'trait', 'package') _TraitRelation.__init__(self, traits_table, tablename, columns)
def __init__(self): idcol = PkName('apt_id') uri = Bigname('uri') dist = Name('dist') sections = Bigname('sections') local_path = Bigname('local_path') columns = [idcol, uri, dist, sections, local_path] Table.__init__(self, 'apt_sources', columns)
def __init__(self): idcol = PkNum('fileid') idcol.set_auto_increment('textfile_ident') mcol = Name('md5size') mcol.constraint.unique = True dcol = Text('data') columns = [idcol, mcol, dcol] Table.__init__(self, 'textfiles', columns)
def __init__(self, fs_table, mounts_table): fs_col = PkName('filesystem') fs_col.set_fk(fs_table) mnt_name_col = PkName('mnt_name') mnt_name_col.set_fk(mounts_table) ord_col = Num('ord') partition_column = Num('partition') size = Name('size') columns = [fs_col, mnt_name_col, ord_col, partition_column, size] Table.__init__(self, 'filesystem_mounts', columns)
def __init__(self): columns = [ PkName('suite'), Name('os'), # the columns below aren't being used anymore Bool('nonUS'), Bool('updates'), Bool('local'), Bool('common') ] Table.__init__(self, 'suites', columns)
def __init__(self, name): cols = [Name('system')] Table.__init__(self, name, system)
def currentenv_columns(): return [Name('hostname'), Bigname('name'), Text('value')]
def __init__(self): idcol = PkName('script') typecol = Name('type') cols = [idcol, typecol] Table.__init__(self, 'scriptnames', cols)
def trait_columns(): return [PkName('trait'), Name('priority'), Text('description')]
def __init__(self): columns = [PkName('family'), Name('type')] Table.__init__(self, 'families', columns)
from useless.sqlgen.classes import Column, Table from useless.sqlgen.defaults import Text from useless.sqlgen.defaults import PkBigname, Bigname, Name, Num dpkg_tables = ['available', 'status', 'filelist', 'md5sums', 'conffiles'] other_tables = ['current'] common_columns = [ PkBigname('package'), Name('essential'), Name('priority'), Name('section'), Num('installedsize'), Bigname('maintainer'), Name('version') ] #columns for /var/lib/dpkg/status status_columns = common_columns + [ Name('status'), Text('replaces'), Text('provides'), Text('predepends'), Text('conflicts'), Bigname('source'), Text('suggests'), Text('recommends'), Text('depends'),