Skip to main content

Posts

Showing posts from March, 2008

Learning the Hard Way: Installing Drupal on XP

Open Source on Closed Source. Probably a bad idea from the start.

Installing Drupal hearkened back to the old days of computing. Way too much jargon and far too little push-a-button-and-it-works. But I'm sold on the Drupal. If I wasn't, I wouldn't have made it through the past two hours trying to install it (I'm tempted to say her here, which suggests a certain love-hate relationship is already evolving).

Drupal installations should be straight forward. Lullbot manages the whole install in one five minute video that I would highly recommend. My installation took significantly longer.

LESSONS LEARNED
GOTCHA #1
MySQL - At least in my instance the directions for setting permissions given in INSTALL.mySQL.txt were not sufficient to allow the database creation scripts to run.

Command provided in INSTALL.mysql.txt:
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE
TEMPORARY TABLES, LOCK TABLES
ON databasename.*
TO 'username'@'localhost' I…

Printing Folder Contents

Sometimes the old ways were a lot simpler. In DOS and UNIX printing a file directory was as simple as "DIR". And if you wanted to be really fancy you could add a couple characters to switch the listing format.

DIR command line switches:/B Uses bare format (no heading information or summary)/L Forces lowercase display of file names/O List by files in sorted order:N by name (alphabetical)S by size (smallest first)E by extension (alphabetical)D by date/time (oldest first)G group directories first- using this prefix reverses the sort order/P Pauses after each screenful of information/S Lists files in the specified directory and all subdirectories/W Uses wide list format/X Displays 8.3 versions of long file namesAnd if you wanted to put this list in a text file to save, copy, paste or print it was as simple as: dir /b /s > DirectoryListing.txt
Somewhere in the ease of use of folders and drag and drop what was simple became hard. In DOS and UNIX this was all easy. It can be ag…

Maintaining Cross-Database Referential Integrity

It is often convenient to house your master tables in a separate database from application specific databases so that primary keys are copasetic and multiple databases have access to the same lookups.

Common examples would include employees, counties, regions and other lookup tables.

Once these tables are in a separate database however it is no longer possible to simply drag-and-drop a relationship between them to maintain referential integrity.

Here's a Solution
For this example we'll use an Observation table, tied to a master list of Sex, that's right, Sex (we could call it Gender to be all PC, but these are animals, not Pat in the Personnel Department.)

Step 1:
We create a new view called PIC_Sex in our Application Database by querying the table PIC_Sex in our Master Database:

CREATE VIEW dbo.PIC_Sex AS
SELECT SexID, Sex, Rank
FROM Master.dbo.PIC_Sex
ORDER BY Rank
Yes, that's right, Male and Female! You don't even want to go down that road.

Step 2:
We create a new user-defi…