Changeset 2535 for trunk/packages


Ignore:
Timestamp:
Oct 29, 2009, 3:40:41 AM (15 years ago)
Author:
broder
Message:

Add builds and build_logs tables to invirt-database for tracking build
history and logs.

Location:
trunk/packages/invirt-database
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/invirt-database/debian/changelog

    r2222 r2535  
     1invirt-database (0.2.2) unstable; urgency=low
     2
     3  * Add builds table for storing build history.
     4
     5 -- Evan Broder <broder@mit.edu>  Sun, 25 Oct 2009 18:45:23 -0400
     6
    17invirt-database (0.2.1) unstable; urgency=low
    28
  • trunk/packages/invirt-database/python/database/models.py

    r2225 r2535  
    55from sqlalchemy.ext.sessioncontext import SessionContext
    66from sqlalchemy.ext.assignmapper import assign_mapper
     7
     8import datetime
    79
    810from invirt.database import record
     
    2123           'owners_table',
    2224           'admins_table',
     25           'builds_table',
    2326           'Machine',
    2427           'MachineAccess',
     
    3134           'Owner',
    3235           'Admin',
     36           'Build',
    3337           'or_',
    3438           ]
     
    99103       Column('vms_quota_active', Integer, nullable=True, default=None))
    100104
     105builds_table = Table('builds', meta,
     106       Column('build_id', Integer, primary_key=True, nullable=False),
     107       Column('package', String, nullable=False),
     108       Column('pocket', String, nullable=False),
     109       Column('commit', String, nullable=False),
     110       Column('version', String, nullable=True, default=None),
     111       Column('principal', String, nullable=False),
     112       Column('succeeded', Boolean, nullable=False),
     113       Column('failed_stage', String, nullable=True, default=None),
     114       Column('inserted_at', DateTime, nullable=False, default=datetime.datetime.utcnow))
     115
    101116machine_access_table = Table('machine_access', meta,
    102117       Column('machine_id', Integer, ForeignKey('machines.machine_id', ondelete='CASCADE'), nullable=False, index=True),
     
    134149    _identity_field = 'user'
    135150
     151class Build(record.Record):
     152    _identity_field = 'build_id'
     153
    136154from invirt.database.owner import Owner
    137155
     
    151169session.mapper(Owner, owners_table)
    152170session.mapper(Admin, admins_table)
     171session.mapper(Build, builds_table)
    153172
    154173def clear_cache():
Note: See TracChangeset for help on using the changeset viewer.