def __init__(self): scol = PkName('script') tcol = Name('type') tcol.set_fk('scriptnames') fcol = Text('scriptfile') columns = [scol, tcol] + suiteversion_cols() + [fcol] Table.__init__(self, 'scripts', columns)
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 packages_columns(): return [ PkBigname('package'), Name('priority'), Bigname('section'), Num('installedsize'), Bigname('filename'), Bigname('maintainer'), Bigname('size'), Name('md5sum'), Bigname('version'), Text('description') ]
def profile_columns(): return [ PkName('profile'), Name('suite'), Bigname('template'), Text('description') ]
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 = 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)
from paella.sqlgen.classes import Column, Table from paella.sqlgen.defaults import Text from paella.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'), Text('conffiles'), Text('description'), Bigname('origin'),
def suiteversion_cols(): scol = Name('suite') scol.set_fk('suites') vcol = PkNum('version') return [vcol, scol]
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 __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 __init__(self): columns = [PkName('family'), Name('type')] Table.__init__(self, 'families', columns)
def currentenv_columns(): return [Name('hostname'), Bigname('name'), Text('value')]
def __init__(self, name): cols = [Name('system')] Table.__init__(self, name, system)
def trait_columns(): return [PkName('trait'), Name('priority'), Text('description')]