From 0d389b024e83625c5856cd67b7ca1f89f7edd354 Mon Sep 17 00:00:00 2001 From: Niklas Fiekas Date: Wed, 28 Sep 2011 13:40:41 +0200 Subject: [PATCH 1/2] #1291308 by Niklas Fiekas: Add versioncontrol_git_repositories table --- versioncontrol_git.install | 49 ++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 49 insertions(+), 0 deletions(-) diff --git a/versioncontrol_git.install b/versioncontrol_git.install index fb81c8d..5dd5b1d 100644 --- a/versioncontrol_git.install +++ b/versioncontrol_git.install @@ -87,6 +87,24 @@ function versioncontrol_git_schema() { 'primary key' => array('item_revision_id'), ); + $schema['versioncontrol_git_repositories'] = array( + 'description' => 'A one-to-one table extending {versioncontrol_repositories} with additional git-specific data.', + 'fields' => array( + 'repo_id' => array( + 'description' => 'Foreign key to {versioncontrol_repositories}.repo_id.', + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + ), + 'default_branch' => array( + 'description' => 'The default (HEAD) branch of the git repository.', + 'type' => 'text', + 'not null' => TRUE, + ), + ), + 'primary key' => array('repo_id'), + ); + return $schema; } @@ -189,3 +207,34 @@ function versioncontrol_git_update_6202() { return $ret; } + +/** + * Adds the versioncontrol_git_repositories table. + * + * Implements hook_update_N(). + */ +function versioncontrol_git_update_6203() { + $ret = array(); + + $versioncontrol_git_repositories_schema = array( + 'description' => 'A one-to-one table extending {versioncontrol_repositories} with additional git-specific data.', + 'fields' => array( + 'repo_id' => array( + 'description' => 'Foreign key to {versioncontrol_repositories}.repo_id.', + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + ), + 'default_branch' => array( + 'description' => 'The default (HEAD) branch of the git repository.', + 'type' => 'text', + 'not null' => TRUE, + ), + ), + 'primary key' => array('repo_id'), + ); + + db_create_table($ret, 'versioncontrol_git_repositories', $versioncontrol_git_repositories_schema); + + return $ret; +} -- 1.7.4.4