Skip to content
Snippets Groups Projects
Name Last commit Last update
..
1.0
1.1
2.0
3.0
3.1
migrations/liquibase
AllCatalogueSchema.hpp
AllCatalogueSchema.hpp.in
ArchiveFileBuilder.cpp
ArchiveFileBuilder.hpp
ArchiveFileRow.cpp
ArchiveFileRow.hpp
CMakeLists.txt
Catalogue.cpp
Catalogue.hpp
CatalogueFactory.cpp
CatalogueFactory.hpp
CatalogueFactoryFactory.cpp
CatalogueFactoryFactory.hpp
CatalogueItor.hpp
CatalogueItorImpl.hpp
CatalogueRetryWrapper.hpp
CatalogueSchema.cpp
CatalogueSchema.hpp
CatalogueTest.cpp
CatalogueTest.hpp
CmdLineTool.cpp
CmdLineTool.hpp
CreateAdminUserCmd.cpp
CreateAdminUserCmd.hpp
CreateAdminUserCmdLineArgs.cpp
CreateAdminUserCmdLineArgs.hpp
CreateAdminUserCmdLineArgsTest.cpp
CreateAdminUserCmdMain.cpp
CreateAllSchemasCppFile.sh
CreateSchemaCmd.cpp
CreateSchemaCmd.hpp
CreateSchemaCmdLineArgs.cpp
CreateSchemaCmdLineArgs.hpp
CreateSchemaCmdLineArgsTest.cpp
CreateSchemaCmdMain.cpp
CreateTapeAttributes.hpp
DatabaseMetadataGetter.cpp
DatabaseMetadataGetter.hpp
DbConfigVersionOfCatalogueTest.cpp
DbToSQLiteStatementTransformer.cpp
DbToSQLiteStatementTransformer.hpp
DropSchemaCmd.cpp
DropSchemaCmd.hpp
DropSchemaCmdLineArgs.cpp
DropSchemaCmdLineArgs.hpp
DropSchemaCmdLineArgsTest.cpp
DropSchemaCmdMain.cpp
DummyCatalogue.hpp
InMemoryCatalogue.cpp
InMemoryCatalogue.hpp
InMemoryCatalogueFactory.cpp
InMemoryCatalogueFactory.hpp
InMemoryCatalogueTest.cpp
InMemoryVersionOfCatalogueTest.cpp
MediaType.hpp
MediaTypeWithLogs.hpp
MysqlCatalogue.cpp
MysqlCatalogue.hpp
MysqlCatalogueFactory.cpp
MysqlCatalogueFactory.hpp
MysqlCatalogueSchema.before_SQL.cpp
MysqlCatalogueSchema.hpp
OracleCatalogue.cpp
OracleCatalogue.hpp
OracleCatalogueFactory.cpp
OracleCatalogueFactory.hpp
OracleCatalogueSchema.before_SQL.cpp
OracleCatalogueSchema.hpp
PollDatabaseCmd.cpp
PollDatabaseCmd.hpp
PollDatabaseCmdLineArgs.cpp
PollDatabaseCmdLineArgs.hpp
PollDatabaseCmdLineArgsTest.cpp
PollDatabaseCmdMain.cpp
PostgresCatalogue.cpp
PostgresCatalogue.hpp
PostgresCatalogueSchema.before_SQL.cpp
PostgresCatalogueSchema.hpp
PostgresqlCatalogueFactory.cpp
PostgresqlCatalogueFactory.hpp
README.md
RdbmsCatalogue.cpp
RdbmsCatalogue.hpp
RdbmsCatalogueGetArchiveFilesForRepackItor.cpp
RdbmsCatalogueGetArchiveFilesForRepackItor.hpp
RdbmsCatalogueGetArchiveFilesItor.cpp
RdbmsCatalogueGetArchiveFilesItor.hpp
RdbmsCatalogueGetDeletedArchiveFilesItor.cpp
RdbmsCatalogueGetDeletedArchiveFilesItor.hpp
RequesterAndGroupMountPolicies.hpp
SQLiteSchemaComparer.cpp
SQLiteSchemaComparer.hpp
SQLiteSchemaInserter.cpp
SQLiteSchemaInserter.hpp
SchemaChecker.cpp
SchemaChecker.hpp
SchemaCheckerResult.cpp
SchemaCheckerResult.hpp
SchemaComparer.cpp
SchemaComparer.hpp
SchemaCreatingSqliteCatalogue.cpp
SchemaCreatingSqliteCatalogue.hpp
SchemaSqlStatementsReader.cpp
SchemaSqlStatementsReader.hpp
SchemaVersion.cpp
SchemaVersion.hpp
SetProductionCmd.cpp
SetProductionCmd.hpp
SetProductionCmdLineArgs.cpp
SetProductionCmdLineArgs.hpp
SetProductionCmdMain.cpp
SqliteCatalogue.cpp
SqliteCatalogue.hpp
SqliteCatalogueFactory.cpp
SqliteCatalogueFactory.hpp
SqliteCatalogueSchema.before_SQL.cpp
SqliteCatalogueSchema.hpp
TapeFileSearchCriteria.hpp
TapeFileWritten.cpp
TapeFileWritten.hpp
TapeForWriting.cpp
TapeForWriting.hpp
TapeItemImplementation.cpp
TapeItemWritten.hpp
TapeItemWrittenPointer.hpp
TapeItemWrittenPointerTest.cpp
TapePool.cpp
TapePool.hpp
TapeSearchCriteria.hpp
TimeBasedCache.hpp
VerifySchemaCmd.cpp
VerifySchemaCmd.hpp
VerifySchemaCmdLineArgs.cpp
VerifySchemaCmdLineArgs.hpp
VerifySchemaCmdLineArgsTest.cpp
VerifySchemaCmdMain.cpp
catalogue_schema.pdf
common_catalogue_schema.sql
cta-catalogue-admin-user-create.1cta
cta-catalogue-schema-create.1cta
cta-catalogue-schema-drop.1cta
cta-catalogue-schema-verify.1cta
cta-catalogue-set-production.1cta
cta-catalogue.conf.example
cta-database-poll.1cta
insert_cta_catalogue_version.sql.in
mysql_catalogue_schema_header.sql
mysql_catalogue_schema_trailer.sql
oracle_catalogue_schema_header.sql
oracle_catalogue_schema_trailer.sql
postgres_catalogue_schema_header.sql
postgres_catalogue_schema_trailer.sql
rdbms_classes.pdf
rdbms_classes.pptx
retryOnLostConnection.hpp
sqlite_catalogue_schema_header.sql
sqlite_catalogue_schema_trailer.sql

Create a new version of the Catalogue Schema

Introduction

The Catalogue schema is the description of the tables that represent the CTA Catalogue.

The Catalogue schema is associated to a number that has the following format :

SCHEMA_VERSION_MAJOR.SCHEMA_VERSION_MINOR

Example: 1.0, 1.1, 2.0

WARNING The changing of the SCHEMA_VERSION_MAJOR number has to be modified ONLY if the changes made to the schema are not backward-compatible with the currently running version of CTA.

DANGER While starting, CTA will check the SCHEMA_VERSION_MAJOR schema version it is supposed to run against. If the SCHEMA_VERSION_MAJOR is not the correct one, CTA will not start.

Modify the Catalogue schema

WARNING Modifying the Catalogue schema means that a new version of the schema has to be created.

DANGER Do not modify any .sql files without changing the version of the schema first (follow the following step 1) ! If you do, the current schema will be overwritten by the modifications you made. (Rollbackable by removing your changes and by building CTA again). If any doubts, do a git diff and check that the current schema directory located in the catalogue folder does not contain any changes.

In order to modify the Catalogue schema, please follow the following steps.

  1. Modify the CTA_CATALOGUE_SCHEMA_VERSION_MAJOR and the CTA_CATALOGUE_SCHEMA_VERSION_MINOR variables that are located in the directory cmake/CTAVersions.cmake.

  2. Run the build of CTA

    --> It will create a new folder that will be named according to the schema versions variables modified at step 1. (Example: if the new schema version is 1.1, the directory 1.1 will be created in the catalogue directory).

  3. Modify the schema by editing the .sql files located in the catalogue directory :

    • databasetype_catalogue_schema_header.sql
    • common_catalogue_schema.sql
    • databasetype_catalogue_schema_trailer.sql

    Where databasetype is either oracle or postgres or sqlite or mysql.

  4. Run the build of CTA --> It will modify the files located in the folder created at step 2.

  5. Try the new schema you created in an empty database. Your schema should work with Oracle, PostgreSQL, MySQL and SQLite.

TIP You can use the cta-catalogue-schema-create tool to create the new schema

  1. If everything works, let's define a upgrade strategy.