storing Chado schema version

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

storing Chado schema version

Scott Cain
Hello,

I want to include the ability to store the schema version in the
database so it can be queried by other tools.  I would like to do this
by making a general "meta" table where any information that we might
want to query about the database can be stored (though, off the top of
my head, I can't think of what those other things might be).  To keep
it somewhat Chadoish, though I don't want to name the table "meta",
rather I want to call it generalprop, as it ought to be part of the
general module.  The only odd thing about generalprop though is that
there is no "general" table to provide foreign keys.  Nevertheless,
I'd like to go with this:

create table generalprop (
    generalprop_id serial not null,
    type_id int not null,
    foreign key (type_id) references cvterm (cvterm_id) INITIALLY DEFERRED,
    value text,
    rank int not null default 0,    constraint generalprop_c1 unique
(type_id,rank)
);

COMMENT ON TABLE generalprop IS 'This table is different from other
prop tables in the database, as it is for storing information about
the database itself
, like schema version';

COMMENT ON COLUMN generalprop.type_id IS 'The name of the property or
slot is a cvterm. The meaning of the property is defined in that
cvterm.';
COMMENT ON COLUMN generalprop.value IS 'The value of the property,
represented as text. Numeric values are converted to their text
representation.';

COMMENT ON COLUMN generalprop.rank IS 'Property-Value ordering. Any
cv can have multiple values for any particular property type -
these are ordered in a list using rank, counting from zero. For
properties that are single-valued rather than multi-valued, the
default 0 value should be used.';

Of course, I'll have to create a "general" cv to go with it, with
initially one entry ("version" or "schema_version").  Thoughts?

Scott


--
------------------------------------------------------------------------
Scott Cain, Ph. D.                                   scott at scottcain dot net
GMOD Coordinator (http://gmod.org/)                     216-392-3087
Ontario Institute for Cancer Research

------------------------------------------------------------------------------
AppSumo Presents a FREE Video for the SourceForge Community by Eric
Ries, the creator of the Lean Startup Methodology on "Lean Startup
Secrets Revealed." This video shows you how to validate your ideas,
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
_______________________________________________
Gmod-schema mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-schema
Reply | Threaded
Open this post in threaded view
|

Re: storing Chado schema version

Robert Buels
On 07/14/2011 08:35 AM, Scott Cain wrote:
> rather I want to call it generalprop, as it ought to be part of the
> general module.  The only odd thing about generalprop though is that
> there is no "general" table to provide foreign keys.  Nevertheless,

The table definition looks good to me.

The name "generalprop" is too vague though, it doesn't provide any clue
as to what it actually does.  I think something like 'chadoprop' would
be better, since it's holding metadata about this chado installation.
Or if not 'chadoprop', then something that gives more of a clue about
what the table is.

Rob

------------------------------------------------------------------------------
AppSumo Presents a FREE Video for the SourceForge Community by Eric
Ries, the creator of the Lean Startup Methodology on "Lean Startup
Secrets Revealed." This video shows you how to validate your ideas,
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
_______________________________________________
Gmod-schema mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-schema
Reply | Threaded
Open this post in threaded view
|

Re: storing Chado schema version

Fields, Christopher J
On Jul 14, 2011, at 12:29 PM, Robert Buels wrote:

> On 07/14/2011 08:35 AM, Scott Cain wrote:
>> rather I want to call it generalprop, as it ought to be part of the
>> general module.  The only odd thing about generalprop though is that
>> there is no "general" table to provide foreign keys.  Nevertheless,
>
> The table definition looks good to me.
>
> The name "generalprop" is too vague though, it doesn't provide any clue
> as to what it actually does.  I think something like 'chadoprop' would
> be better, since it's holding metadata about this chado installation.
> Or if not 'chadoprop', then something that gives more of a clue about
> what the table is.
>
> Rob

+1 on 'chadoprop'.

chris


------------------------------------------------------------------------------
AppSumo Presents a FREE Video for the SourceForge Community by Eric
Ries, the creator of the Lean Startup Methodology on "Lean Startup
Secrets Revealed." This video shows you how to validate your ideas,
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
_______________________________________________
Gmod-schema mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-schema