Login | Register
My pages Projects Community openCollabNet

Discussions > dev > database creation scripts

Project highlights: Architectural Overview

joist
Discussion topic

Hide all messages in topic

All messages in topic

Re: [helm-dev] database creation scripts

Author David Pellegrini <davidp at collab dot net>
Full name David Pellegrini <davidp at collab dot net>
Date 2000-09-13 21:32:39 PDT
Message Jason Elliot Robbins wrote:
> One difficulty that some one might be able to help me with is the
> following: how to do you populate a join table from a .sql file?
>
> The main tables like Role and Permission have autonumbered IDs, so a
> sql statement to add a Role could look like:
> insert into Role values ( null, 'Web Site Administrator');
> that way each component can define its own, and we do not need to
> agree on a numbering scheme ahead of time. But how do you populate
> RolePermission from a sql file if you dont know the numbers that go
> into the table? I would guess subselects, but mysql does not have
> those.

If you are starting with empty tables, you can specify the ID's in your insert statements, then use those ID's when inserting into the join tables. MySQL allows you to specify the ID if you want. If you don't specify and ID, it assigns one by adding 1 to the highest ID currently in the table.

-davidp

Re: [helm-dev] database creation scripts

Author jrobbins9
Full name Jason Robbins
Date 2000-09-13 19:47:03 PDT
Message >Request is defined in joist/sql/org/joist/joist.sql -- but that file is
>never referenced in sandbox/INSTALL. Confusingly, most of the tables in
>that file are created by helm/sql/build_datab​ase.sql(.in):

Sorry, I started to do a refactoring and did not finish. It is
finished now (at least for joist and helm, I did not touch xchange).



>The following talbes are in joist.sql:
> Dual * not in build_database.sql

I have removed Dual. It does not seem to be referenced from any
source code.


>I'm of the opinion that these table definitions should be moved from helm
>into joist.

Done.

>I think some of the other tables in build_database.sql
>(PermissionExtent, at the least) should also be moved into joist.sql ...


I dont want to move PermissionExtent into there because I want to
replace it with the joist groups thing. Work on that starts tomorrow
or friday.

>I'm not sure about the particular data in the tables. Data is put into
>Permission, PermissionExtent, Role, RolePermission, and User; I'm guessing
>that at least some of this is helm-specific data, and at least some of it
>is general joist control data.

I think all the data needs to remain at the component level, not at
the framework level.

One difficulty that some one might be able to help me with is the
following: how to do you populate a join table from a .sql file?

The main tables like Role and Permission have autonumbered IDs, so a
sql statement to add a Role could look like:
insert into Role values ( null, 'Web Site Administrator');
that way each component can define its own, and we do not need to
agree on a numbering scheme ahead of time. But how do you populate
RolePermission from a sql file if you dont know the numbers that go
into the table? I would guess subselects, but mysql does not have
those.



>However -- at the least, the Request table should be created as part of
>the sandbox/INSTALL document. The simplest way to do that would be to
>tell the user to run joist/sql/org/joist/joist.sql before running the helm
>sql files

Consider developers to be told. :)


jason!

--
Jason Robbins, Ph.D. CollabNet is hiring open source developers!
Chief Architect http://www.collab.net/careers/

database creation scripts

Author edk
Full name Ed Korthof
Date 2000-09-13 18:59:31 PDT
Message Hi --

I set up a sandbox by following the sandbox/INSTALL document; I
encountered one confusing problem along the way. Recently, changes to the
joist conf files turned on a property which causes each request to be
logged by the SessionManager class -- but that assumes that the Request
table is set up in the database.

Request is defined in joist/sql/org/joist/joist.sql -- but that file is
never referenced in sandbox/INSTALL. Confusingly, most of the tables in
that file are created by helm/sql/build_datab​ase.sql(.in):


The following talbes are in joist.sql:
    Dual * not in build_database.sql
    DeletedUser
    Message
    Permission
    Request * not in build_database.sql
    Role
    RolePermission
    User
    UserRole

I'm of the opinion that these table definitions should be moved from helm
into joist. I think some of the other tables in build_database.sql
(PermissionExtent, at the least) should also be moved into joist.sql ...

I'm not sure about the particular data in the tables. Data is put into
Permission, PermissionExtent, Role, RolePermission, and User; I'm guessing
that at least some of this is helm-specific data, and at least some of it
is general joist control data.

However -- at the least, the Request table should be created as part of
the sandbox/INSTALL document. The simplest way to do that would be to
tell the user to run joist/sql/org/joist/joist.sql before running the helm
sql files -- and in any case, I think that should be done. However, I
think the duplicate definitions should be taken out of either one or the
other file ...

Dave -- I understand you've been making quite a few changes to sxc
recently. If you were planning on addressing this issue, I'd be
interested to know how you're doing so.

In any case, feedback would be useful. I'm not going to touch anything
just yet ... but I'd like to fix sandbox/INSTALL so it'll work again, as
soon as possible.

thanks --

Ed
--
   +=-=+=-=+=-=+=-=+=-=​+=-=+=-=+=-=+=-=+=-=​+=-=+=-=+=-=+=-=
   | Ed Korthof | edk at collab dot net | 415-247-1690 |
   +=-=+=-=+=-=+=-=+=-=​+=-=+=-=+=-=+=-=+=-=​+=-=+=-=+=-=+=-=
Messages per page: