From: Chuck Hagenbuch Date: Sat, 9 Jan 2010 04:11:35 +0000 (-0500) Subject: Add a migration script for creating the tables in rampage_base.xml with Horde_Db X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=ebd841c4d65e8cbb658239d16e598890163a1f66;p=horde.git Add a migration script for creating the tables in rampage_base.xml with Horde_Db instead of with MDB2_Schema. Should be a bit easier to make work and to get going. This currently works, if you have content set up in registry.php, by running: $ db_migrate -a content --- diff --git a/content/migrations/1_rampage_base_tables.php b/content/migrations/1_rampage_base_tables.php new file mode 100644 index 000000000..b2ea87d44 --- /dev/null +++ b/content/migrations/1_rampage_base_tables.php @@ -0,0 +1,38 @@ +createTable('rampage_types', array('primaryKey' => false)); + $t->column('type_id', 'primaryKey'); + $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->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->column('user_name', 'string', array('limit' => 255, 'null' => false)); + $t->end(); + + $this->addIndex('rampage_users', array('user_name'), array('name' => 'rampage_users_user_name', 'unique' => true)); + } + + public function down() + { + $this->dropTable('rampage_types'); + $this->dropTable('rampage_objects'); + $this->dropTable('rampage_users'); + } +}