[23675] users/jberry/mpwa/doc/schema-thoughts.sql

source_changes at macosforge.org source_changes at macosforge.org
Fri Apr 6 10:54:50 PDT 2007


Revision: 23675
          http://trac.macosforge.org/projects/macports/changeset/23675
Author:   jberry at macports.org
Date:     2007-04-06 10:54:50 -0700 (Fri, 06 Apr 2007)

Log Message:
-----------
Some thoughts on a schema for mpwa and/or repository.

Added Paths:
-----------
    users/jberry/mpwa/doc/schema-thoughts.sql

Added: users/jberry/mpwa/doc/schema-thoughts.sql
===================================================================
--- users/jberry/mpwa/doc/schema-thoughts.sql	                        (rev 0)
+++ users/jberry/mpwa/doc/schema-thoughts.sql	2007-04-06 17:54:50 UTC (rev 23675)
@@ -0,0 +1,120 @@
+-- Person represents a person, potentially with a login/password
+-- persons are used for maintainer, submitter, commenter?
+drop table if exists Person;
+create table Person (
+	id			bigint not null primary key auto_increment,
+	
+	userName	text,
+	firtName	text,
+	lastName	text,
+	email		text
+	
+	-- authMethod
+	-- authToken
+	);
+	
+-- Port represents a port: a piece of software
+drop table if exists Port;
+create table Port (
+	id			bigint not null primary key auto_increment,
+	
+	portName	text,
+	shortDesc	text,
+	longDesc	text,
+	homePage	text
+	
+	-- many-many association for tags through PortTagAssoc
+	-- many-many association for maintainers through PortMaintainerAssoc
+	);
+	
+-- PortMaintainerAssoc: many-many association between Port and Maintainer
+drop table if exists PortMaintainerAssoc;
+create table PortMaintainerAssoc (
+	port		bigint not null,
+	person		bigint not null
+	);
+	
+-- PortPkg is an instance of build/install rules for a port.
+-- There may be many PortPkgs for each port
+drop table if exists PortPkg;
+create table PortPkg (
+	id			bigint not null primary key auto_increment,
+
+	port		bigint not null,
+	
+	submitter	bigint not null, -- one-one: Person
+	submitDate	datetime not null,
+	
+	epoch		text,
+	version		text,
+	revision	text,
+	
+	pkgurl		text 				-- uniquely identify a portpkg to outside world
+									-- this might also also indexing of externally served portpkgs
+									
+	-- many-many association for tags through PkgTagAssoc
+	-- many-many association for variants through VariantAssoc
+	-- many-many association for dependencies through PkgDependencyAssoc
+	
+	-- (note that both pkgs and variants, have dependency relations)
+	);
+
+-- A tag which may be attached to various items through PkgTagAssoc, PortTagAssoc
+drop table if exists Tag;
+create table Tag (
+	id			bigint not null primary key auto_increment,
+	name		text
+	);
+	
+-- many-many relationship between PortPkg and Tag
+drop table if exists PkgTagAssoc;
+create table PkgTagAssoc (
+	portPkg		bigint not null,
+	tag			bigint not null
+	);
+
+-- many-many relationship between Port and Tag
+drop table if exists PortTagAssoc;
+create table PortTagAssoc (
+	port		bigint not null,
+	tag			bigint not null
+	);
+
+-- A dependency onto onther port
+drop table if exists Dependency;
+create table Dependency (
+	id			bigint not null primary key auto_increment,
+	depExpr		text				-- textual? dependency expression
+	
+	-- can we point directly to the target port (or portpkg, or porturl???)
+	-- that would make it much easier to determine reverse dependencies.
+	-- maybe we have nullable fields for port, portpkg, porturl, version, revision, etc...
+	);
+
+-- many-many relationship between PortPkg and Dependency
+drop table if exists PkgDependencyAssoc;
+create table PkgDependencyAssoc (
+	portPkg		bigint not null,
+	dependency	bigint not null
+	);
+
+-- Variant available to a PortPkg
+drop table if exists Variant;
+create table Variant (
+	id			bigint not null primary key auto_increment,
+	portPkg		bigint not null,
+	
+	name		text,
+	description	text
+	
+	-- many-many association for dependencies through VariantDependencyAssoc
+	
+	-- conflicts expr?
+	);
+
+-- many-many relationship between a Variant and Dependency
+drop table if exists VariantDependencyAssoc;
+create table VariantDependencyAssoc (
+	variant	bigint not null,
+	dependency	bigint not null
+	);

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20070406/7c4883a1/attachment.html


More information about the macports-changes mailing list