From 89f7061a8cf84761a473d10b96ebfad9816483df Mon Sep 17 00:00:00 2001 From: Chuck Hagenbuch Date: Sun, 10 Jan 2010 14:34:32 -0500 Subject: [PATCH] Smarter specification of the primary key --- content/migrations/1_rampage_base_tables.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/content/migrations/1_rampage_base_tables.php b/content/migrations/1_rampage_base_tables.php index b2ea87d44..1572e6cbf 100644 --- a/content/migrations/1_rampage_base_tables.php +++ b/content/migrations/1_rampage_base_tables.php @@ -4,25 +4,24 @@ class RampageBaseTables extends Horde_Db_Migration_Base public function up() { // rampage_types - $t = $this->createTable('rampage_types', array('primaryKey' => false)); - $t->column('type_id', 'primaryKey'); + $t = $this->createTable('rampage_types', array('primaryKey' => 'type_id')); $t->column('type_name', 'string', array('limit' => 255, 'null' => false)); $t->end(); $this->addIndex('rampage_types', array('type_name'), array('name' => 'rampage_objects_type_name', 'unique' => true)); + // rampage_objects - $t = $this->createTable('rampage_objects', array('primaryKey' => false)); - $t->column('object_id', 'primaryKey'); + $t = $this->createTable('rampage_objects', array('primaryKey' => 'object_id')); $t->column('object_name', 'string', array('limit' => 255, 'null' => false)); $t->column('type_id', 'integer', array('null' => false, 'unsigned' => true)); $t->end(); $this->addIndex('rampage_objects', array('type_id', 'object_name'), array('name' => 'rampage_objects_type_object_name', 'unique' => true)); + // rampage_users - $t = $this->createTable('rampage_users', array('primaryKey' => false)); - $t->column('user_id', 'primaryKey'); + $t = $this->createTable('rampage_users', array('primaryKey' => 'user_id')); $t->column('user_name', 'string', array('limit' => 255, 'null' => false)); $t->end(); -- 2.11.0