need help designing a database table (or tables) to hold a hash ( %config) and ( %group)

Hi All

i am creating a script for deployment of websites and i need to create
  hash    %config ( which stores a lot of configurations setting for
each type of website )  ... i have been manually  eaditing this hash
but now the  hash  has to now be generated from a a database ( mysql )
.... i have  never worked  with designing a database structure . Can
any one guide  me how to go about  it  .


my hash structure looks some thing like this

my %config  = ( 'website_auto_1' => {
       'group' => 'website_auto_group1',
     'tempdir' => '/var/www/html/temp/auto' ,
   'svnurl' => 'http://svn.intranet.com/repos/branch/auto',
   'excludes' =>
'uploaded_images|includes/config.php|admin/includes/config.php|.svn',
   'tarpath' => '/var/www/html/temp/autotar/',
   'tarname' => 'auto',
    'rmtrootdir' => '/var/www/projects/auto',
    'rmttmpdir' => '/temp/auto',
    'rmteserver' => '192.168.1.26' },

website_auto_2 => { ....
:
:
) ;

%group = (  website_auto_1  => { auto_group => [ name => user1 , name
=> user2 , name => user6 ] },
                  website_auto_2  => { auto_group => [ name => user2 ,
 name => user5 ] }, ...
:
:
);

i am not too sure if the %group ( not really implement this )  hash is
correct , but i what i want to do is , my deployment script should
only allow users who are logged in  to deploy a particular website (
eg website_auto_1 )  if they belong to the group .


thanks in advanced






-- 
Regards
Agnello D'souza
0
agnello
4/22/2011 4:47:33 PM
perl.beginners 29388 articles. 4 followers. Follow

1 Replies
613 Views

Similar Articles

[PageSpeed] 47
Get it on Google Play
Get it on Apple App Store

first, this isn't the proper forum. second...

On Fri, Apr 22, 2011 at 12:47 PM, Agnello George
<agnello.dsouza@gmail.com> wrote:
> Hi All
>
> i am creating a script for deployment of websites and i need to create
> =A0hash =A0 =A0%config ( which stores a lot of configurations setting for
> each type of website ) =A0... i have been manually =A0eaditing this hash
> but now the =A0hash =A0has to now be generated from a a database ( mysql =
)
> ... i have =A0never worked =A0with designing a database structure . Can
> any one guide =A0me how to go about =A0it =A0.
>
>
> my hash structure looks some thing like this
>
> my %config =A0=3D ( 'website_auto_1' =3D> {
> =A0 =A0 =A0 'group' =3D> 'website_auto_group1',
> =A0 =A0 'tempdir' =3D> '/var/www/html/temp/auto' ,
> =A0 'svnurl' =3D> 'http://svn.intranet.com/repos/branch/auto',
> =A0 'excludes' =3D>
> 'uploaded_images|includes/config.php|admin/includes/config.php|.svn',
> =A0 'tarpath' =3D> '/var/www/html/temp/autotar/',
> =A0 'tarname' =3D> 'auto',
> =A0 =A0'rmtrootdir' =3D> '/var/www/projects/auto',
> =A0 =A0'rmttmpdir' =3D> '/temp/auto',
> =A0 =A0'rmteserver' =3D> '192.168.1.26' },
>
> website_auto_2 =3D> { ....
> :
> :
> ) ;
>
> %group =3D ( =A0website_auto_1 =A0=3D> { auto_group =3D> [ name =3D> user=
1 , name
> =3D> user2 , name =3D> user6 ] },
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0website_auto_2 =A0=3D> { auto_group =
=3D> [ name =3D> user2 ,
> =A0name =3D> user5 ] }, ...
> :
> :
> );

this makes no sense to me.

>
> i am not too sure if the %group ( not really implement this ) =A0hash is
> correct , but i what i want to do is , my deployment script should
> only allow users who are logged in =A0to deploy a particular website (
> eg website_auto_1 ) =A0if they belong to the group .
>

ok, now we might be getting somewhere, you want user groups and object grou=
ps?

so give your objects gids. i generally do unsigned int auto_increment
primary key.
then, give your users uids. same theory.
then, your objects (web sites?) get gids.... or, in mysql, just do it
(what i consider) right like this:

CREATE TABLE report (
   id       INT UNSIGNED   NOT NULL AUTO_INCREMENT PRIMARY KEY,
   edate    INT UNSIGNED,
   mdate    INT UNSIGNED,
   duedate  INT UNSIGNED,
   gid      INT,
   uid      INT UNSIGNED,
   FOREIGN KEY( gid ) REFERENCES grp( gid ),
   FOREIGN KEY( uid ) REFERENCES grp( uid )
)

CREATE TABLE user (
   id       INT UNSIGNED   NOT NULL AUTO_INCREMENT PRIMARY KEY,
   uname    VARCHAR(10),
   pass     VARCHAR(50),
   fname    VARCHAR(15),
   lname    VARCHAR(15),
   email    VARCHAR(50),
   org      VARCHAR(50),
   telph    INT UNSIGNED,
   celph    INT UNSIGNED,
   officeph INT UNSIGNED,
   mainph   INT UNSIGNED,
   cdate    INT UNSIGNED,
   edate    INT UNSIGNED,
   enabled  BOOL
)

CREATE TABLE gname (
   id       INT            NOT NULL AUTO_INCREMENT PRIMARY KEY,
   name     VARCHAR(30)
)

CREATE TABLE grp (
   id       INT UNSIGNED   NOT NULL AUTO_INCREMENT PRIMARY KEY,
   uid      INT UNSIGNED,
   gid      INT,
   FOREIGN KEY (uid) REFERENCES user( id ),
   FOREIGN KEY (gid) REFERENCES gname( id )
)


this is what i'm using that seems to work decently. and as you can
see, i store other information for my users. my 'report' would be your
web page. you might want to do other things, but this is ot enough.
ask for more explanation in a better forum for this. btw, you'll need
to do some reading up on dbi or dbic to be able to use this in perl.
0
ag4ve
4/22/2011 5:58:51 PM
Reply:

Similar Artilces:

a little help with transfering table A in Database A into table B in database B
I can't seem to find a good tutorial in transfering data from one table in database a into a different table in database b. The catch is that the fields in the tables don't match exactly. How can I do this? Examples, tutorials, etc are greatly appreciated.Thanks!Graphfixz Data & Web Designhttp://www.graphfixz.com All you need is INSERT INTO with column list that will give you control of how you the the insert into the new database, the other option was to use DTS.  Try the link below for the INSERT INTO statement.  Hope this helps.http://msdn.microsoft.com/library/def...

Help Needed with Table Design.
Hi there everyone, I am starting to develop a new internal website for my company, for logging calls, reports and billings. I am still busy looking at the best way to design the layout of the DB. My biggest concern is a billings table design. What it should do is, that when work was completed, the consultant must add his billings to the logged call. My problem is that i will never know how many individual items will be billed for. I was thinking of just creating a table with [id, call_id, item_1, cost_1, quan_1, item_2, cost_2, quan_2, item_3, cost_3, qua...

Help creating this table layout from 2 database tables
I'm having trouble working this through and hoping for a nudge in the right direction.  .Net 2.0 with C# codebehind  I need to create a reference table that has both the headers of the columns and a row identifier dynamically generated and then of course populate the table.  Example:     Midwest Southeast Northeast Job Title 1 John Smith Jane Doe Billy Bob Job Title 2 Some Name Employe Name Contact nameContact Name 2   The bold items are contained in a lookup...

Tables?! Why Tables?!
Bit random...but why does everything have to be rendered as a table?  It's starting to get quite annoying.  Formview - does this need to be a table?  the Menu??  Wouldn't it make sense to allow the option to...say...not render a Menu as a table?  Am I the only one that thinks this or are there others?  www.internetgeeks.co.ukwww.norwichbookclub.co.uk You can use CSS Adapters to create your own adapters to override how the controls render it self. In the next version of ASP.Net, you will probably have more flexibility to specify the surrounding elements of th...

Need help with complex table design
This is a multi-part message in MIME format. --------------2763C07EE5C04B27253CAD87 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi I have a complex database design problem at hand. I would greatly appreciate your time if you could take a look at the attachment and give me your views. The requirement is to design an approval matrix (like the document approval cycle in Lotus Notes). It is to be implemented as a ASE 11.5 table(s) In brief (please refer the attachd HTML table) 1. The entities are: Groups, account heads, amount, currency, signatory...

Need help with deleting from hash table
First off, thanks to all who offered help with my trying to count the number of items passed in a CGI script. I finally figured out I had my logic wrong and it doesn't matter how many element's I'm passing, but... My problem now is that I can't get items deleted from a hash table. My code is as follows: for ( $i=0;($i < $FORM{'count'}); $i++) { my $place="d".$i; if ( $FORM{$place} eq 'off' ) { # We've matched a check box and a hash so delete it del...

Need help to create this table in my database
I create a database which has the following tables: 1.      Supplier 2.      Item: 3.      Store:4.      Item Stored:5.      Invoice:6.      Invoice Lines:7.      Recite: 8.      Recite Lines:9.      Client:where the Supplier table has the following field:·         Code: contains of  3 characters and 6 auto increment number...

need help with database table creation
hi all, i'm currently working on a login style form where i get the textbox entry and in the button_click event compare it with the database(think of it as password checking).and as the database table which i'm taking the data from has the fields nicely been 1 way hashed...i want to do a  temporary table creation to insert the textbox entry,hash it,and then take it out to compare with the permanent table field..so to make things short...how do i create a table in the backend code?i'm not sure whether to use dataadapter or something else...help please... thanks  w...

I need help connecting to my database table
Hello.  I would appreciate it so much if anyone on this forum can help me to connect to my MySQL database table.  Here's the code I'm working with:   Sub SubmitForm(Sender As Object, E As EventArgs) Dim strConn As String = "bkfwebdesi1_mysqlConn" Dim MySQL As String = "INSERT INTO ContactInfo (FirstName, MI, LastName, NoAndStreet, Unit, " & _ "City, State, ZipCode, PhoneNumber, Email, Username, Password) VALUES (@First, @MI, @Last, @NoAndStreet, " & _ "@Unit, @City, @State, @Zip, @Phone, @Email, @Username, @Password)" Dim MyConn As New SQLCon...

From Table to Table
I am working in Delphi 4 and ran into a roadblock I am unfamiliar with. I am trying to search and find values in one table based off of matching values in another. For example a table of objects with fields like name, description, type, ect; and a table of object properties in which each object can be represented multiple times based on the settings on the page at the time. So if i search the object property table (and eventually loop through to repeat for all objects) to find all cases of visible objects when a certain criteria is met. It stops on the first object with "Yes" in th...

Need help using Derived Table
hello, i am having trouble correctly forming my sql query. my challenge is that two of my columns are calculated values that sum another calculation that is divided by an averaged value. because i am trying to sum an averaged value, i get the error: Cannot perform an aggregate function on an expression containing an aggregate or a subquery. after reading the web and this forum, i see that by using a derived table, i should be able to execute this query. unfortunately, my SQL skills are not up to the job, and i am confused as to how to structure my query using a derived table (or subq...

how to transfer the data from table A to table B OR FROM EXCEL TO TABLE I NEED
Hi all,I am trying to transfer the data in the excel file to the SQL 2005 database .i am able to transfer the data into database, but into new table the table i need.can anybody help to transfer the whole data from the excel to the table i need or from one table to another.i would appreciate if anyone can help. TABLE A -----> TABLE BOREXCEL -----> TABLE I NEEDOR EXCEL ---->TABLE A -----> TABLE B  CheersDivikiran   right click database, select tasks-> import/export data ( depends on your requirements) select source and destination. (if from excel to ...

Need help inserting data from permanent table to temp table for use
I have a permanent table that I want to extract data from by refnumber and show it in a datagrid. I want to put the data into a temp table with a new refnumber. Any ideas?...

Help Needed on Text updating in database table
Environment Sybase 11.9.2 / 12.0 on Win NT I have two tables with text columns. Need to insert/update into table2.textcolumn with the selected value from table1.textcolumn. Not able to get the column value into local variable using readtext/writetext in Sybase procedures.How to accomplish the task ?? Yogesh_Arora wrote... > Environment > Sybase 11.9.2 / 12.0 on Win NT > > I have two tables with text columns. > Need to insert/update into table2.textcolumn with the selected value from > table1.textcolumn. > > Not able to get the column value into ...

Web resources about - need help designing a database table (or tables) to hold a hash ( %config) and ( %group) - perl.beginners

Designing Women - Wikipedia, the free encyclopedia
This article is about the television show of this title. For the 1934 film of this title, see Designing Women (film) . For the 1957 film with ...

Designing for Accessibility: Q&A with Jeff Wieland - Facebook
Facebook Design hat eine Notiz mit dem Titel Designing for Accessibility: Q&A with Jeff Wieland geschrieben. Du kannst den vollständigen Text ...

Designing Around Little Minds
In designing user interfaces, we aim to empower the &ldquo;user&rdquo; to understand and control the system at hand. Output via screens and speakers, ...

Designing Obama for iPad on the iTunes App Store
Get Designing Obama on the App Store. See screenshots and ratings, and read customer reviews.

Flickr: Designing Web Interfaces' Photostream
Figures and Screencasts for the O'Reilly Book: Designing Web Interfaces: Principles & Patterns for Rich Interaction. Designing Web Interfaces ...

Google I/O 2014 - Designing for wearables - YouTube
Speaker(s): Alex Faaborg, Bob Ryskamp, Emmet Connolly, Hayes Raffle Description: Wearable technology requires new design approaches. We'll share ...

James Bond - Designing 007: Fifty Years of Bond Style
Fashion, fast cars: Show eyes Bond film style legacy

Google's Android plans include manufacturing own chips and designing new Pixel phone
Google’s interest in mobile chipmaking can open new business opportunities, including a new Pixel phone line.

Designing a world that sells powerful dreams
The creator of Mad Men once preferred poetry to TV, writes Warwick McFadyen. - Sydney Morning Herald Online

Designing with Edna in mind
Designing with Edna in mind

Resources last updated: 11/28/2015 1:59:33 PM