[Fedora-infrastructure-list] Extras Package Database

Elliot Lee sopwith at redhat.com
Fri Jun 30 18:06:18 UTC 2006


Hi all,

http://fedoraproject.org/wiki/Infrastructure/PackageDatabase has been  
out there for a bit...

I've put together a strawman schema (as a TurboGears model.py) to  
help move things along - apologies if someone else has beaten me to  
it. I think at this point the right questions to be asking are long  
the lines of "will this schema support feature X or use case Y?".  
 From a quick glance at the web page, I *think* it mostly will. There  
are some problems with this still, but open source is all about  
fixing those problems :)

class Collection(SQLObject):
	name = StringCol(length=128, notNone=True) # "Core", "Extras", or  
whatever names-for-grouping you want

class Package(SQLObject):
	name = StringCol(length=128, notNone=True) # "Core", "Extras", or  
whatever names-for-grouping you want
	created = DateTimeCol(default=sqlbuilder.func.NOW(), notNone=True)
	status = EnumCol(enumValues=('awaitingreview', 'approved',  
'denied'), default='awaitingreview', notNone=True)

class PackageHistory(SQLObject): # Records changes to packages
	package = ForeignKey('Package', notNone=True)
	by_user_id = IntCol(notNone=True) # Foreign key into account  
database - user who made the change
	action = EnumCol(enumValues=('added', 'removed', 'statuschanged'),  
notNone=True)
	status = StringCol(length=128, notNone=True) # Not EnumCol, but  
could be changed to be one.
	when = DateTimeCol(default=sqlbuilder.func.NOW(), notNone=True)

class PackageListing(SQLObject):
	package = ForeignKey('Package', notNone=True)
	collection = ForeignKey('Collection', notNone=True)
	created = DateTimeCol(default=sqlbuilder.func.NOW(), notNone=True)
	status = EnumCol(enumValues=('awaitingreview', 'awaitingbranch',  
'approved', 'denied'), default='awaitingreview', notNone=True)

class PackageListingHistory(SQLObject): # Records changes to packages
	package_listing = ForeignKey('PackageListing', notNone=True)
	by_user_id = IntCol(notNone=True) # Foreign key into account  
database - user who made the change
	action = EnumCol(enumValues=('added', 'removed', 'statuschanged'),  
notNone=True)
	status = StringCol(length=128, notNone=True) # Not EnumCol, but  
could be changed to be one.
	when = DateTimeCol(default=sqlbuilder.func.NOW(), notNone=True)

class PackageVersion(SQLObject): # A specific version on a specific  
branch
	package_listing = ForeignKey('PackageListing', notNone=True)
	version = StringCol(length=128, notNone=True)
	status = EnumCol(enumValues=('awaitingdevel', 'awaitingreview',  
'awaitingqa', 'awaitingpublish', 'approved', 'denied', 'obsolete'),  
default='awaitingdevel', notNone=True)
	created = DateTimeCol(default=sqlbuilder.func.NOW(), notNone=True)

class PackageVersionHistory(SQLObject): # Records changes to packages
	package_version = ForeignKey('PackageVersion', notNone=True)
	by_user_id = IntCol(notNone=True) # Foreign key into account  
database - user who made the change
	action = EnumCol(enumValues=('added', 'statuschanged'), notNone=True)
	status = StringCol(length=128, notNone=True) # Not EnumCol, but  
could be changed to be one.
	when = DateTimeCol(default=sqlbuilder.func.NOW(), notNone=True)

class PackageInterest(SQLObject):
	# Note: PackageInterestHistory table assumes that records will never  
be removed from here.
	# Instead, set the status to 'obsolete'
	user_id = IntCol(notNone=True)
	package_listing = ForeignKey('PackageListing', notNone=True)
	status = EnumCol(enumValues=('awaitingreview', 'approved', 'denied',  
'obsolete'), default='awaitingreview', notNone=True)
	role = EnumCol(enumValues=('watcher', 'owner'), default='watcher',  
notNone=True) # Used for authorization

class PackageInterestHistory(SQLObject):
	package_interest = ForeignKey('PackageInterest', notNone=True)
	action = EnumCol(enumValues=('added', 'statuschanged'), notNone=True)
	status = StringCol(length=128, notNone=True) # Not EnumCol, but  
could be changed to be one.
	when = DateTimeCol(default=sqlbuilder.func.NOW(), notNone=True)

Best,
-- Elliot




More information about the infrastructure mailing list