mirror of
https://github.com/markqvist/Reticulum.git
synced 2026-11-19 14:36:34 -05:00
Pre-release migrations
This commit is contained in:
parent
d45a5860fd
commit
fe2fe94dd8
1 changed files with 14 additions and 5 deletions
|
|
@ -262,11 +262,20 @@ class KnownDestinationsStore:
|
|||
ratchet BLOB NOT NULL,
|
||||
received REAL NOT NULL)""")
|
||||
|
||||
# Pre-release migrations, will be folded into finalized schema befor 1.6.0 release
|
||||
if 0 < db_version < 2: self._conn.execute("ALTER TABLE known_destinations ADD COLUMN lr_cost REAL")
|
||||
|
||||
self._conn.execute("PRAGMA user_version = 2")
|
||||
self._conn.commit()
|
||||
try:
|
||||
# Pre-release migrations, will be folded into finalized schema before 1.6.0 release
|
||||
if 0 < db_version < 2: self._conn.execute("ALTER TABLE known_destinations ADD COLUMN lr_cost REAL")
|
||||
if 0 < db_version < 3: self._conn.execute("ALTER TABLE known_destinations ALTER COLUMN packet_hash DROP NOT NULL")
|
||||
self._conn.execute("PRAGMA user_version = 3")
|
||||
self._conn.commit()
|
||||
except Exception as e:
|
||||
import RNS
|
||||
RNS.log(f"Pre-release database migration failed: {e}", RNS.LOG_CRITICAL)
|
||||
RNS.log(f"You will need to remove the known_destinations.db* files from your storage directory", RNS.LOG_CRITICAL)
|
||||
RNS.log(f"On the next instance start, the database will be rebuilt", RNS.LOG_CRITICAL)
|
||||
RNS.log(f"Exiting now", RNS.LOG_CRITICAL)
|
||||
time.sleep(1)
|
||||
RNS.panic()
|
||||
|
||||
def __entry_row(self, destination_hash, entry):
|
||||
stamp = entry[5] if len(entry) > 5 else None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue