mirror of
https://github.com/lalanza808/monero.fail.git
synced 2025-08-25 05:49:20 -04:00
add simple schema migration script
This commit is contained in:
parent
a2dadc97c5
commit
726d2766e8
2 changed files with 20 additions and 0 deletions
16
migrate_schema.sh
Normal file
16
migrate_schema.sh
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
#!/bin/bash
|
||||||
|
xmrnodes
|
||||||
|
#
|
||||||
|
sqlite3 data/sqlite.db "SELECT * from node;" > /dev/null
|
||||||
|
|
||||||
|
# backup database
|
||||||
|
cp data/sqlite.db data/backup.sqlite
|
||||||
|
|
||||||
|
# rename table
|
||||||
|
sqlite3 data/sqlite.db "ALTER TABLE node RENAME TO old_node;"
|
||||||
|
|
||||||
|
# init table
|
||||||
|
./manage.sh init
|
||||||
|
|
||||||
|
# move data
|
||||||
|
sqlite3 data/sqlite.db "INSERT INTO node SELECT * FROM old_node;"
|
|
@ -321,6 +321,10 @@ def get_peers():
|
||||||
rw_cache('map_peers', list(Peer.select().execute()))
|
rw_cache('map_peers', list(Peer.select().execute()))
|
||||||
|
|
||||||
|
|
||||||
|
@app.cli.command('init')
|
||||||
|
def init():
|
||||||
|
pass
|
||||||
|
|
||||||
@app.cli.command("validate")
|
@app.cli.command("validate")
|
||||||
def validate():
|
def validate():
|
||||||
nodes = Node.select().where(Node.validated == False)
|
nodes = Node.select().where(Node.validated == False)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue