Skip to content

Migrations

EncryptSL edited this page Aug 19, 2024 · 1 revision

1.4.9-SNAPSHOT MultiCurrencies

Hello dear users of LiteEco, plugin since 1.4.8 beta and new version have support for multicurrencies.

There is now easy answer how export data from file database.db, plugin have inside more changes nessesary to works with multicurrencies and single currency like a previous version.

Only for this reasons i created script and tools for migration to new versions.

Step by step i take you to migrate your config and locales.

Migration of config.yml

Now you can disable or enable metrics and offline-suggestion-players in commands.

#Official settings for this plugin.
plugin:
  # Translations list of supported locales below
  # https://github.com/EncryptSL/LiteEco/blob/main/src/main/kotlin/encryptsl/cekuj/net/api/enums/LangKey.kt
  translation: EN_US
  # Plugin prefix
  prefix: "<dark_gray>[<green>Eco<dark_gray>] <dark_green>»</dark_gray>"
  # Enable or disable Metrics
  metrics: true
  # Settings for modifiable players suggestion.
  # Enabled: Offline Players Suggestion..
  # Disabled: Online Players Suggestion...
  offline-suggestion-players: true

Easy way how create multicurrencies.

  • economy.currencies.<table_name_of_currency>
  • Represent name of table and if you change this table you lost data.
  • Plugin create new table with name lite_eco_<your_currency>.
  • Please keep in mind plugin accepting dollars like a primary currency used in single currency support never change this key.
  • Plugin must have hardcoded this value in default exception for primary currency.
economy:
  currencies: # Since 1.4.8 to new versions
    # Don't change this currency because this is implemented for vault....
    # Key of currencies is name of table please don't change this value if you don't want to lose data.
    dollars:
      currency_name: dollars
      currency_plural_name: dollars
      currency_singular_name: dollar
      # Currency Format
      currency_format: '$ <money>'
      # This amount is granted to players who don't have an existing account in the database.
      starting_balance: 30
      # This amount is checked when player is above allowed limit
      balance_limit: 1000000
      # Enabled or disable balance limit, disabled check mean fully for paid amounts by player, given/set by admins.
      balance_limit_check: true
      # Convert large currency values into a more compact format.
      compact_display: false

    # Example of other currencies
    # Don't change this currency because this is implemented for vault....
    # Key of currencies is name of table please don't change this value if you don't want to lose data.
    # credits:
        # currency_name: credits
        # currency_plural_name: credits
        # currency_singular_name: credit
        # Currency Format
        # currency_format: '€ <money>'
        # # This amount is granted to players who don't have an existing account in the database.
        # starting_balance: 30
        # # This amount is checked when player is above allowed limit
        # balance_limit: 1000000
        # # Enabled or disable balance limit, disabled check mean fully for paid amounts by player, given/set by admins.
        # balance_limit_check: true
        # # Convert large currency values into a more compact format.
        # compact_display: false

  # Enable logging about economies activities add, set, withdraw, pay money.
  # Command /eco monolog [player]
  monolog_activity: true

Database have same connection settings.

# Settings for Database or SQLite connection.
database:
  # For SQLite, the path to the SQLite database file: jdbc:sqlite:plugins/LiteEco/database.db
  # For MySQL, the JDBC connection URL in the format: jdbc:mysql://your_host:port/name_of_database
  connection:
    # Settings for JDBC_HOST
    jdbc_url: "jdbc:sqlite:plugins/LiteEco/database.db"
    # The username of the user to connect to your database (MySQL only).
    username: user_name
    # The password of the user to connect to your database (MySQL only).
    password: password

  # You can enable sql-plugin-logger for some problems with database...
  sql-plugin-logger: false

How migrate my old lite_eco table to multicurrencies ?

You can export your old table with command /eco migration [SQL, CSV, LEGACY_TABLE, SQL_LITE_FILE]

Explanations:

  • SQL: Exports your table data into file migration/economy_migration_<current_timestamp>.sql
  • CSV: Exports your table data into file migration/economy_migration_<current_timestamp>.csv
  • LEGACY_TABLE: Exports your data from old_table lite_eco to database.db or mysql connected database forced.
  • SQL_LITE_FILE: Exports your table data into file migration/economy_migration_sql_lite<current_timestamp>.sql needed to import into database.db after open in SQL Lite Browser.
Clone this wiki locally