mirror of
https://github.com/planetmint/planetmint.git
synced 2025-11-25 23:15:44 +00:00
changes in drop_file.txt
This commit is contained in:
parent
38884b487f
commit
949be41b84
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
import copy
|
import copy
|
||||||
import logging
|
import logging
|
||||||
|
import os
|
||||||
|
|
||||||
from planetmint.log import DEFAULT_LOGGING_CONFIG as log_config
|
from planetmint.log import DEFAULT_LOGGING_CONFIG as log_config
|
||||||
from planetmint.lib import Planetmint # noqa
|
from planetmint.lib import Planetmint # noqa
|
||||||
@ -35,12 +36,12 @@ _base_database_tarantool_local_db = { # TODO Rewrite this configs for tarantool
|
|||||||
}
|
}
|
||||||
init_config = {
|
init_config = {
|
||||||
"init_file": "init_db.txt",
|
"init_file": "init_db.txt",
|
||||||
"relative_path": "backend/tarantool/"
|
"relative_path": os.path.dirname(os.path.abspath(__file__)) + "/backend/tarantool/"
|
||||||
}
|
}
|
||||||
|
|
||||||
drop_config = {
|
drop_config = {
|
||||||
"drop_file": "drop_db.txt",
|
"drop_file": "drop_db.txt", # planetmint/backend/tarantool/init_db.txt
|
||||||
"relative_path": "backend/tarantool/"
|
"relative_path": os.path.dirname(os.path.abspath(__file__)) + "/backend/tarantool/"
|
||||||
}
|
}
|
||||||
_database_tarantool = {
|
_database_tarantool = {
|
||||||
'backend': 'tarantool_db',
|
'backend': 'tarantool_db',
|
||||||
|
|||||||
@ -40,15 +40,17 @@ class TarantoolDB:
|
|||||||
|
|
||||||
def drop_database(self):
|
def drop_database(self):
|
||||||
from planetmint.backend.tarantool.utils import run
|
from planetmint.backend.tarantool.utils import run
|
||||||
config = get_planetmint_config_value_or_key_error("ctl_config")["drop_config"]
|
config = get_planetmint_config_value_or_key_error("ctl_config")
|
||||||
f_path = "%s%s" % (config["relative_path"], config["drop_file"])
|
drop_config = config["drop_config"]
|
||||||
|
f_path = "%s%s" % (drop_config["relative_path"], drop_config["drop_file"])
|
||||||
commands = self.__read_commands(file_path=f_path)
|
commands = self.__read_commands(file_path=f_path)
|
||||||
run(commands=commands, config=config)
|
run(commands=commands, config=config)
|
||||||
|
|
||||||
def init_database(self):
|
def init_database(self):
|
||||||
from planetmint.backend.tarantool.utils import run
|
from planetmint.backend.tarantool.utils import run
|
||||||
config = get_planetmint_config_value_or_key_error("ctl_config")["init_config"]
|
config = get_planetmint_config_value_or_key_error("ctl_config")
|
||||||
f_path = "%s%s" % (config["relative_path"], config["init_file"])
|
init_config = config["init_config"]
|
||||||
|
f_path = "%s%s" % (init_config["relative_path"], init_config["init_file"])
|
||||||
commands = self.__read_commands(file_path=f_path)
|
commands = self.__read_commands(file_path=f_path)
|
||||||
run(commands=commands, config=config)
|
run(commands=commands, config=config)
|
||||||
|
|
||||||
|
|||||||
@ -1,23 +1,23 @@
|
|||||||
abci_chains:drop()
|
box.space.abci_chains.drop()
|
||||||
|
|
||||||
assets:drop()
|
box.space.assets.drop()
|
||||||
|
|
||||||
blocks:drop()
|
box.space.blocks.drop()
|
||||||
|
|
||||||
blocks_tx:drop()
|
box.space.blocks_tx.drop()
|
||||||
|
|
||||||
elections:drop()
|
box.space.elections.drop()
|
||||||
|
|
||||||
meta_datas:drop()
|
box.space.meta_datas.drop()
|
||||||
|
|
||||||
pre_commits:drop()
|
box.space.pre_commits.drop()
|
||||||
|
|
||||||
validators:drop()
|
box.space.validators.drop()
|
||||||
|
|
||||||
transactions:drop()
|
box.space.transactions.drop()
|
||||||
|
|
||||||
inputs:drop()
|
box.space.inputs.drop()
|
||||||
|
|
||||||
outputs:drop()
|
box.space.outputs.drop()
|
||||||
|
|
||||||
keys:drop()
|
box.space.keys.drop()
|
||||||
Loading…
x
Reference in New Issue
Block a user