From c8cec958d0e4aa12b5a6016ba3ed345be98d34b9 Mon Sep 17 00:00:00 2001 From: cyan Date: Thu, 12 Dec 2024 11:49:54 +0000 Subject: [PATCH] change doc --- src/data/README.md | 12 ++++++------ src/migration/README.md | 6 ++++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/data/README.md b/src/data/README.md index 429571909..757534748 100644 --- a/src/data/README.md +++ b/src/data/README.md @@ -263,14 +263,14 @@ CREATE TABLE clio.nf_token_transactions ( The `nf_token_transactions` table serves as the NFT counterpart to `account_tx`, inspired by the same motivations and fulfilling a similar role within this context. It drives the `nft_history` API. -### migrated_features +### migrator_status ``` -CREATE TABLE clio.migrated_features ( - status TEXT, # The migration status of the feature - feature_name TEXT, # The name of the feature - PRIMARY KEY (status, feature_name) +CREATE TABLE clio.migrator_status ( + migrator_name TEXT, # The name of the migrator + status TEXT, # The status of the migrator + PRIMARY KEY (migrator_name) ) ``` -The `migrated_features` table stores the status of the migration of features in this database. If a feature's status is `migrated`, it means this database has finished data migration for this feature. The feature name is the name of the feature that has been migrated. Now the status can only be `migrated`. +The `migrator_status` table stores the status of the migratior in this database. If a migrator's status is `migrated`, it means this database has finished data migration for this migrator. diff --git a/src/migration/README.md b/src/migration/README.md index 1d97bf9d9..8d5f97aa7 100644 --- a/src/migration/README.md +++ b/src/migration/README.md @@ -21,7 +21,7 @@ This command returns the current migration status of each migrator. The example Current Migration Status: - Migrator: ExampleMigrator - not migrated + Migrator: ExampleMigrator - Feature v1, Clio v3 - not migrated ### To start a migration: @@ -30,7 +30,7 @@ This command returns the current migration status of each migrator. The example ./clio_server --migrate ExampleMigrator ~/config/migrator.json -Migration will run if the migrator has not been migrated. The migrator will be marked as migrated after the migration is completed. User can not re-run the migration for the same migrator. +Migration will run if the migrator has not been migrated. The migrator will be marked as migrated after the migration is completed. ## How to write a migrator @@ -42,6 +42,8 @@ It contains: - A `name` which will be used to identify the migrator. User will refer this migrator in command-line tool by this name. The name needs to be different with other migrators, otherwise a compiler error will be raised. +- A `description` which is the detail information of the migrator. + - A static function `runMigration`, it will be called when user run `--migrate name`. It accepts two parameters: backend, which provides the DB operations interface, and cfg, which provides migration-related configuration. Each migrator can have its own configuration under `.migration` session. - A type name alias `Backend` which specifies the backend type it supports.