From 3600ec58449dcf3999ed7b5bd609fd523cbd9d2e Mon Sep 17 00:00:00 2001 From: Jesse McConnell Date: Mon, 26 Feb 2007 22:10:41 +0000 Subject: added definitions for other tables and fixed up naming conventions git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@512034 13f79535-47bb-0310-9956-ffa450edef68 --- .../archiva/database/IbatisMetadataStore.java | 10 ++++- .../src/main/resources/ibatis-config.xml | 2 +- .../apache/maven/archiva/database/CreateTables.xml | 44 ++++++++++++++++------ .../apache/maven/archiva/database/MetadataKey.xml | 14 +++---- 4 files changed, 48 insertions(+), 22 deletions(-) (limited to 'archiva-database/src') diff --git a/archiva-database/src/main/java/org/apache/maven/archiva/database/IbatisMetadataStore.java b/archiva-database/src/main/java/org/apache/maven/archiva/database/IbatisMetadataStore.java index aaa78c90c..781b2fe30 100644 --- a/archiva-database/src/main/java/org/apache/maven/archiva/database/IbatisMetadataStore.java +++ b/archiva-database/src/main/java/org/apache/maven/archiva/database/IbatisMetadataStore.java @@ -63,11 +63,17 @@ public class IbatisMetadataStore // Create the tables getLogger().info( "Creating metadata keys instance table" ); - sqlMap.update( "createMetadataKeyTable", null ); + sqlMap.update( "initializeMetadataKeyTable", null ); getLogger().info( "Creating repository metadata instance table" ); - sqlMap.update( "createRepositoryMetadataTable", null ); + sqlMap.update( "initializeRepositoryMetadataTable", null ); + getLogger().info( "Creating repository health metadata instance table" ); + sqlMap.update( "initializeHealthMetadataTable", null ); + + getLogger().info( "Creating repository versions metadata instance table" ); + sqlMap.update( "initializeVersionsMetadataTable", null ); + sqlMap.commitTransaction(); } catch ( SQLException e ) diff --git a/archiva-database/src/main/resources/ibatis-config.xml b/archiva-database/src/main/resources/ibatis-config.xml index b3b222db1..cec13f491 100644 --- a/archiva-database/src/main/resources/ibatis-config.xml +++ b/archiva-database/src/main/resources/ibatis-config.xml @@ -23,6 +23,6 @@ - + \ No newline at end of file diff --git a/archiva-database/src/main/resources/org/apache/maven/archiva/database/CreateTables.xml b/archiva-database/src/main/resources/org/apache/maven/archiva/database/CreateTables.xml index 4d936a6ea..800e855d9 100644 --- a/archiva-database/src/main/resources/org/apache/maven/archiva/database/CreateTables.xml +++ b/archiva-database/src/main/resources/org/apache/maven/archiva/database/CreateTables.xml @@ -8,7 +8,7 @@ - + CREATE TABLE MetadataKeys ( metadataKey integer generated always as identity ( start with 1 ) primary key, groupId varchar(100) not null, @@ -17,17 +17,37 @@ METADATA_KEYS is the index table for all other tables ) - - CREATE TABLE StepInstance ( - repositoryId integer, - repositoryName varchar(100) not null, - latest varchar(100) not null, - release varchar(100) not null, - lastUpdated long not null, - snapshotTimestamp long not null, - snapshotBuildNumber long not null, - snapshotLocalCopy boolean, - primary key( repositoryId ), + + CREATE TABLE RepositoryMetadata ( + metadataKey integer not null, + id integer generated always as identity ( start with 1 ) primary key, + repositoryId varchar(100) not null, + latest varchar(100) not null, + release varchar(100) not null, + lastUpdated integer not null, + snapshotTimestamp integer not null, + snapshotBuildNumber integer not null, + snapshotLocalCopy char(1) not null, + foreign key( metadataKey ) references MetadataKeys( metadataKey ) + ) + + + + CREATE TABLE HealthMetadata ( + metadataKey integer not null, + id integer generated always as identity ( start with 1 ) primary key, + processId varchar(100) not null, + problemId varchar(100) not null, + message varchar(8000) not null, + foreign key( metadataKey ) references MetadataKeys( metadataKey ) + ) + + + + CREATE TABLE VersionMetadata ( + metadataKey integer not null, + id integer generated always as identity ( start with 1 ) primary key, + version varchar(100) not null, foreign key( metadataKey ) references MetadataKeys( metadataKey ) ) diff --git a/archiva-database/src/main/resources/org/apache/maven/archiva/database/MetadataKey.xml b/archiva-database/src/main/resources/org/apache/maven/archiva/database/MetadataKey.xml index 86bbcd4a2..06bce40e0 100644 --- a/archiva-database/src/main/resources/org/apache/maven/archiva/database/MetadataKey.xml +++ b/archiva-database/src/main/resources/org/apache/maven/archiva/database/MetadataKey.xml @@ -7,17 +7,17 @@ INSERT INTO - METADATA_KEYS ( GROUP_ID, ARTIFACT_ID, VERSION_ID ) + MetadataKeys ( groupId, artifactId, version ) VALUES (#groupId#, #artifactId#, #version# ) -- cgit v1.2.3