Shiny,

rdsmith (http://drupal.org/user/91447) has sent you a message via your
contact form (http://drupal.org/user/31033/contact) at drupal.org.

If you don't want to receive such e-mails, you can change your settings at
http://drupal.org/user/31033.

Message:

My last script write was a bit off in syntax..

<?php

//Wrote Script to Install for postgreSQL, MySQL, and MySQLi
//Robert D. Smith     2007.03.22   1246EST 
//angusmccrimmont@gmail.com
//document: moodlesso.rds.install

function moodlesso_install() {
        switch ($GLOBALS['db_type']) {
                case 'pgsql':
                        db_query("CREATE TABLE {moodlesso} (
        uid INTEGER NOT NULL REFERENCES {users} (uid),
                                username TEXT UNIQUE NOT NULL,
                                firstname TEXT NOT NULL,
                                lastname TEXT NOT NULL,
                                emailaddress TEXT UNIQUE NOT NULL,
                                cookie_contents TEXT UNIQUE NOT NULL,
                                PRIMARY KEY (uid)
                        );");
                break;
              
                case 'mysql':
                case 'mysqli':
                        db_query("CREATE TABLE {moodlesso} (
                        uid  int(10) NOT NULL default '0',
                                username  varchar(20) UNIQUE NOT NULL,
                                firstname  varchar(20) NOT NULL,
                                lastname  varchar(20) NOT NULL,
                                emailaddress  varchar(25) UNIQUE NOT NULL,
                                cookie_contents  varchar(20) UNIQUE NOT NULL,
                                PRIMARY KEY (uid),
                        ADD FOREIGN KEY (uid) REFERENCES users(uid)
                        );");
                break;

        }
}
?>

//Robert D. Smith

Comments

Shiny’s picture

Status: Active » Fixed

Applied to HEAD and the DRUPAL-5 branch

thanks Robert :)

Anonymous’s picture

Status: Fixed » Closed (fixed)
dwees’s picture

ADD FOREIGN KEY should be
FOREIGN KEY.

Dave