vitess.io/vitess@v0.16.2/go/vt/sidecardb/schema/onlineddl/schema_migrations.sql (about)

     1  /*
     2  Copyright 2023 The Vitess Authors.
     3  
     4  Licensed under the Apache License, Version 2.0 (the "License");
     5  you may not use this file except in compliance with the License.
     6  You may obtain a copy of the License at
     7  
     8      http://www.apache.org/licenses/LICENSE-2.0
     9  
    10  Unless required by applicable law or agreed to in writing, software
    11  distributed under the License is distributed on an "AS IS" BASIS,
    12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  See the License for the specific language governing permissions and
    14  limitations under the License.
    15  */
    16  
    17  CREATE TABLE IF NOT EXISTS _vt.schema_migrations
    18  (
    19      `id`                              bigint unsigned  NOT NULL AUTO_INCREMENT,
    20      `migration_uuid`                  varchar(64)      NOT NULL,
    21      `keyspace`                        varchar(256)     NOT NULL,
    22      `shard`                           varchar(255)     NOT NULL,
    23      `mysql_schema`                    varchar(128)     NOT NULL,
    24      `mysql_table`                     varchar(128)     NOT NULL,
    25      `migration_statement`             text             NOT NULL,
    26      `strategy`                        varchar(128)     NOT NULL,
    27      `options`                         varchar(8192)    NOT NULL,
    28      `added_timestamp`                 timestamp        NOT NULL DEFAULT CURRENT_TIMESTAMP,
    29      `requested_timestamp`             timestamp        NOT NULL DEFAULT CURRENT_TIMESTAMP,
    30      `ready_timestamp`                 timestamp        NULL     DEFAULT NULL,
    31      `started_timestamp`               timestamp        NULL     DEFAULT NULL,
    32      `liveness_timestamp`              timestamp        NULL     DEFAULT NULL,
    33      `completed_timestamp`             timestamp(6)     NULL     DEFAULT NULL,
    34      `cleanup_timestamp`               timestamp        NULL     DEFAULT NULL,
    35      `migration_status`                varchar(128)     NOT NULL,
    36      `log_path`                        varchar(1024)    NOT NULL,
    37      `artifacts`                       text             NOT NULL,
    38      `retries`                         int unsigned     NOT NULL DEFAULT '0',
    39      `tablet`                          varchar(128)     NOT NULL DEFAULT '',
    40      `tablet_failure`                  tinyint unsigned NOT NULL DEFAULT '0',
    41      `progress`                        float            NOT NULL DEFAULT '0',
    42      `migration_context`               varchar(1024)    NOT NULL DEFAULT '',
    43      `ddl_action`                      varchar(16)      NOT NULL DEFAULT '',
    44      `message`                         text             NOT NULL,
    45      `eta_seconds`                     bigint           NOT NULL DEFAULT '-1',
    46      `rows_copied`                     bigint unsigned  NOT NULL DEFAULT '0',
    47      `table_rows`                      bigint           NOT NULL DEFAULT '0',
    48      `added_unique_keys`               int unsigned     NOT NULL DEFAULT '0',
    49      `removed_unique_keys`             int unsigned     NOT NULL DEFAULT '0',
    50      `log_file`                        varchar(1024)    NOT NULL DEFAULT '',
    51      `retain_artifacts_seconds`        bigint           NOT NULL DEFAULT '0',
    52      `postpone_completion`             tinyint unsigned NOT NULL DEFAULT '0',
    53      `removed_unique_key_names`        text             NOT NULL,
    54      `dropped_no_default_column_names` text             NOT NULL,
    55      `expanded_column_names`           text             NOT NULL,
    56      `revertible_notes`                text             NOT NULL,
    57      `allow_concurrent`                tinyint unsigned NOT NULL DEFAULT '0',
    58      `reverted_uuid`                   varchar(64)      NOT NULL DEFAULT '',
    59      `is_view`                         tinyint unsigned NOT NULL DEFAULT '0',
    60      `ready_to_complete`               tinyint unsigned NOT NULL DEFAULT '0',
    61      `stowaway_table`                  tinytext         NOT NULL,
    62      `vitess_liveness_indicator`       bigint           NOT NULL DEFAULT '0',
    63      `user_throttle_ratio`             float            NOT NULL DEFAULT '0',
    64      `special_plan`                    text             NOT NULL,
    65      `last_throttled_timestamp`        timestamp        NULL     DEFAULT NULL,
    66      `component_throttled`             tinytext         NOT NULL,
    67      `cancelled_timestamp`             timestamp        NULL     DEFAULT NULL,
    68      `postpone_launch`                 tinyint unsigned NOT NULL DEFAULT '0',
    69      `stage`                           text             NOT NULL,
    70      `cutover_attempts`                int unsigned     NOT NULL DEFAULT '0',
    71      `is_immediate_operation`          tinyint unsigned NOT NULL DEFAULT '0',
    72      `reviewed_timestamp`              timestamp        NULL DEFAULT NULL,
    73      PRIMARY KEY (`id`),
    74      UNIQUE KEY `uuid_idx` (`migration_uuid`),
    75      KEY `keyspace_shard_idx` (`keyspace`(64), `shard`(64)),
    76      KEY `status_idx` (`migration_status`, `liveness_timestamp`),
    77      KEY `cleanup_status_idx` (`cleanup_timestamp`, `migration_status`),
    78      KEY `tablet_failure_idx` (`tablet_failure`, `migration_status`, `retries`),
    79      KEY `table_complete_idx` (`migration_status`, `keyspace`(64), `mysql_table`(64), `completed_timestamp`),
    80      KEY `migration_context_idx` (`migration_context`(64)),
    81      KEY `reverted_uuid_idx` (`reverted_uuid`)
    82  ) ENGINE = InnoDB