// 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 )
<!--
METADATA_KEYS is the index table for all other tables
-->
-<statement id="initalizeMetadataKeyTable">
+<statement id="initializeMetadataKeyTable">
CREATE TABLE MetadataKeys (
metadataKey integer generated always as identity ( start with 1 ) primary key,
groupId varchar(100) not null,
)
</statement>
-<statement id="createRepositoryMetadataTable">
- 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 ),
+<statement id="initializeRepositoryMetadataTable">
+ 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 )
+ )
+</statement>
+
+<statement id="initializeHealthMetadataTable">
+ 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 )
+ )
+</statement>
+
+<statement id="initializeVersionsMetadataTable">
+ 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 )
)
</statement>
<select id="getMetadataKey" resultClass="org.apache.maven.archiva.database.key.MetadataKey">
SELECT
- METADATA_KEY as id
- GROUP_ID as groupId,
- ARTIFACT_ID as artifactId,
- VERSION as version,
- FROM METADATA_KEYS
- WHERE METADATA_KEY = #value#
+ metadataKey as id
+ groupId as groupId,
+ artifactId as artifactId,
+ version as version,
+ FROM MetadataKeys
+ WHERE metadataKey = #value#
</select>
<insert id="addMetadataKey" parameterClass="org.apache.maven.archiva.database.key.MetadataKey">
INSERT INTO
- METADATA_KEYS ( GROUP_ID, ARTIFACT_ID, VERSION_ID )
+ MetadataKeys ( groupId, artifactId, version )
VALUES (#groupId#, #artifactId#, #version# )
</insert>