001/*- 002 * #%L 003 * HAPI FHIR Server - SQL Migration 004 * %% 005 * Copyright (C) 2014 - 2025 Smile CDR, Inc. 006 * %% 007 * Licensed under the Apache License, Version 2.0 (the "License"); 008 * you may not use this file except in compliance with the License. 009 * You may obtain a copy of the License at 010 * 011 * http://www.apache.org/licenses/LICENSE-2.0 012 * 013 * Unless required by applicable law or agreed to in writing, software 014 * distributed under the License is distributed on an "AS IS" BASIS, 015 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 016 * See the License for the specific language governing permissions and 017 * limitations under the License. 018 * #L% 019 */ 020package ca.uhn.fhir.jpa.migrate.tasks.api; 021 022import ca.uhn.fhir.jpa.migrate.taskdef.InitializeSchemaTask; 023 024public enum TaskFlagEnum { 025 026 /** 027 * This task should be skipped by default on live system migrations. Use this flag 028 * in cases where the benefit of applying a migration doesn't justify the effort, and 029 * only use this flag in cases where skipping the task will not leave the system in 030 * an unusable state. 031 * <p> 032 * This flag is intended for situations where a change to the schema would be useful 033 * to add to the default initialized schema, but would not be worth the effort of 034 * applying in-place to large databases due to the outsized effort it would take. 035 * </p> 036 * <p> 037 * USE THIS FLAG WITH CAUTION: It means that the migrator unit tests will execute the 038 * task, but live migrations probably won't. So think long and hard before you set it! 039 * </p> 040 */ 041 HEAVYWEIGHT_SKIP_BY_DEFAULT, 042 043 /** 044 * Should this task run even if we're doing the very first initialization of an empty schema. By 045 * default, we skip most tasks during that pass, since they just take up time and the 046 * schema should be fully initialized by the {@link InitializeSchemaTask} 047 */ 048 RUN_DURING_SCHEMA_INITIALIZATION, 049 050 /** 051 * This task is allowed to fail, and failure won't abort the migration. Upon any 052 * detected failures, the task will still be recorded as having been successfully 053 * complected. A failure in this context means that the SQL statement(s) being 054 * executed returned a non-successful response, or timed out. 055 */ 056 FAILURE_ALLOWED, 057 058 /** 059 * This task should not actually do anything, and will always be recorded as 060 * a success. Use this flag for tasks that are no longer needed, e.g. because 061 * they are superseded by later tasks or because they turned out to be a bad 062 * idea. 063 */ 064 DO_NOTHING 065}