Skip to content

Commit

Permalink
change doc
Browse files Browse the repository at this point in the history
  • Loading branch information
cindyyan317 committed Dec 12, 2024
1 parent c7b2066 commit c8cec95
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
12 changes: 6 additions & 6 deletions src/data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
6 changes: 4 additions & 2 deletions src/migration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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

Expand All @@ -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.
Expand Down

0 comments on commit c8cec95

Please sign in to comment.