예제 #1
0
def template_columns():
    return [
        PkBigname('template'),
        Name('mode'),
        Name('owner'),
        Name('grp_owner'),
        Num('templatefile')]
예제 #2
0
 def __init__(self):
     # etype is foreign key to EntityTypeTable
     etype = PkName('type')
     # fieldname is foreign key to ExtraFieldsTable
     fieldname = PkBigname('fieldname')
     # the supported types will be bool, int, name, url, and text
     fieldtype = Name('fieldtype')
     fieldtype.set_default('name')
     Table.__init__(self, 'entity_type_extfields', [etype, fieldname, fieldtype])
예제 #3
0
def mounts_columns():
    return [
        PkName('mnt_name'),
        Name('mnt_point'),
        Name('fstype'),
        Name('mnt_opts'),
        Name('dump'),
        Name('pass')
    ]
예제 #4
0
 def __init__(self):
     troubleid = AutoId('troubleid', 'trouble_ident', pk=True)
     clientid = Num('clientid')
     clientid.set_fk('clients')
     problem = Name('problem')
     worktodo= Text('worktodo')
     posted = Now('posted')
     status = Name('status')
     status.set_fk('trouble_status')
     cols = [troubleid, clientid, problem, worktodo, posted, status]
     Table.__init__(self, 'troubles', cols)
예제 #5
0
def packages_columns():
    return [
        PkBigname('package'),
        Name('priority'),
        Bigname('section'),
        Num('installedsize'),
        Bigname('filename'),
        Bigname('maintainer'),
        Bigname('size'),
        Name('md5sum'),
        Bigname('version'),
        Text('description')]
예제 #6
0
파일: tables.py 프로젝트: umeboshi2/paella
 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)
예제 #7
0
def profile_columns():
    return [
        PkName('profile'),
        Name('suite'),
        Bigname('template'),
        Text('description')
    ]
예제 #8
0
 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)
예제 #9
0
 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)
예제 #10
0
 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)
예제 #11
0
 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)
예제 #12
0
 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)
예제 #13
0
 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)
예제 #14
0
 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)
예제 #15
0
 def __init__(self):
     idcol = PkName('script')
     typecol = Name('type')
     cols = [idcol, typecol]
     Table.__init__(self, 'scriptnames', cols)
예제 #16
0
 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)
예제 #17
0
 def __init__(self):
     columns = [PkName('family'), Name('type')]
     Table.__init__(self, 'families', columns)
예제 #18
0
def currentenv_columns():
    return [Name('hostname'), Bigname('name'), Text('value')]
예제 #19
0
 def __init__(self, name):
     cols = [Name('system')]
     Table.__init__(self, name, system)
예제 #20
0
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'),
예제 #21
0
 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)
예제 #22
0
def trait_columns():
    return [PkName('trait'), Name('priority'), Text('description')]