From 27a7040f8e4bde16d87eccf33b4123e5a86262c5 Mon Sep 17 00:00:00 2001 From: Lorenzo Delgado Date: Thu, 3 Nov 2022 17:58:05 +0100 Subject: [PATCH] chore(migrations): move migration scripts to project root --- .../message_store}/00001_addMessageTable.up.sql | 0 .../message_store}/00002_addSenderTimeStamp.up.sql | 0 .../00003_convertTimestampsToInt64.up.sql | 0 .../message_store}/00004_extendPrimaryKey.up.sql | 0 .../message_store}/00005_updateIndex.up.sql | 0 .../message_store}/00006_renameColumn.up.sql | 0 .../message_store}/00007_updatePrimaryKey.up.sql | 0 .../peer_store}/00001_addPeerTable.up.sql | 0 waku/v2/node/storage/migration/migration_types.nim | 13 +++++++------ 9 files changed, 7 insertions(+), 6 deletions(-) rename {waku/v2/node/storage/migration/migrations_scripts/message => migrations/message_store}/00001_addMessageTable.up.sql (100%) rename {waku/v2/node/storage/migration/migrations_scripts/message => migrations/message_store}/00002_addSenderTimeStamp.up.sql (100%) rename {waku/v2/node/storage/migration/migrations_scripts/message => migrations/message_store}/00003_convertTimestampsToInt64.up.sql (100%) rename {waku/v2/node/storage/migration/migrations_scripts/message => migrations/message_store}/00004_extendPrimaryKey.up.sql (100%) rename {waku/v2/node/storage/migration/migrations_scripts/message => migrations/message_store}/00005_updateIndex.up.sql (100%) rename {waku/v2/node/storage/migration/migrations_scripts/message => migrations/message_store}/00006_renameColumn.up.sql (100%) rename {waku/v2/node/storage/migration/migrations_scripts/message => migrations/message_store}/00007_updatePrimaryKey.up.sql (100%) rename {waku/v2/node/storage/migration/migrations_scripts/peer => migrations/peer_store}/00001_addPeerTable.up.sql (100%) diff --git a/waku/v2/node/storage/migration/migrations_scripts/message/00001_addMessageTable.up.sql b/migrations/message_store/00001_addMessageTable.up.sql similarity index 100% rename from waku/v2/node/storage/migration/migrations_scripts/message/00001_addMessageTable.up.sql rename to migrations/message_store/00001_addMessageTable.up.sql diff --git a/waku/v2/node/storage/migration/migrations_scripts/message/00002_addSenderTimeStamp.up.sql b/migrations/message_store/00002_addSenderTimeStamp.up.sql similarity index 100% rename from waku/v2/node/storage/migration/migrations_scripts/message/00002_addSenderTimeStamp.up.sql rename to migrations/message_store/00002_addSenderTimeStamp.up.sql diff --git a/waku/v2/node/storage/migration/migrations_scripts/message/00003_convertTimestampsToInt64.up.sql b/migrations/message_store/00003_convertTimestampsToInt64.up.sql similarity index 100% rename from waku/v2/node/storage/migration/migrations_scripts/message/00003_convertTimestampsToInt64.up.sql rename to migrations/message_store/00003_convertTimestampsToInt64.up.sql diff --git a/waku/v2/node/storage/migration/migrations_scripts/message/00004_extendPrimaryKey.up.sql b/migrations/message_store/00004_extendPrimaryKey.up.sql similarity index 100% rename from waku/v2/node/storage/migration/migrations_scripts/message/00004_extendPrimaryKey.up.sql rename to migrations/message_store/00004_extendPrimaryKey.up.sql diff --git a/waku/v2/node/storage/migration/migrations_scripts/message/00005_updateIndex.up.sql b/migrations/message_store/00005_updateIndex.up.sql similarity index 100% rename from waku/v2/node/storage/migration/migrations_scripts/message/00005_updateIndex.up.sql rename to migrations/message_store/00005_updateIndex.up.sql diff --git a/waku/v2/node/storage/migration/migrations_scripts/message/00006_renameColumn.up.sql b/migrations/message_store/00006_renameColumn.up.sql similarity index 100% rename from waku/v2/node/storage/migration/migrations_scripts/message/00006_renameColumn.up.sql rename to migrations/message_store/00006_renameColumn.up.sql diff --git a/waku/v2/node/storage/migration/migrations_scripts/message/00007_updatePrimaryKey.up.sql b/migrations/message_store/00007_updatePrimaryKey.up.sql similarity index 100% rename from waku/v2/node/storage/migration/migrations_scripts/message/00007_updatePrimaryKey.up.sql rename to migrations/message_store/00007_updatePrimaryKey.up.sql diff --git a/waku/v2/node/storage/migration/migrations_scripts/peer/00001_addPeerTable.up.sql b/migrations/peer_store/00001_addPeerTable.up.sql similarity index 100% rename from waku/v2/node/storage/migration/migrations_scripts/peer/00001_addPeerTable.up.sql rename to migrations/peer_store/00001_addPeerTable.up.sql diff --git a/waku/v2/node/storage/migration/migration_types.nim b/waku/v2/node/storage/migration/migration_types.nim index c91b8c948..694fd2325 100644 --- a/waku/v2/node/storage/migration/migration_types.nim +++ b/waku/v2/node/storage/migration/migration_types.nim @@ -1,11 +1,12 @@ -{.push raises: [Defect].} +{.push raises: [].} -import tables, stew/results, strutils, os +import + std/[tables, os, strutils], + stew/results -template sourceDir: string = currentSourcePath.rsplit(DirSep, 1)[0] -const MessageStoreMigrationPath* = sourceDir / "migrations_scripts/message" -const PeerStoreMigrationPath* = sourceDir / "migrations_scripts/peer" -const AllStoreMigrationPath* = sourceDir / "migrations_scripts" +template projectRoot: string = currentSourcePath.rsplit(DirSep, 1)[0] / ".." / ".." / ".." / ".." / ".." +const MessageStoreMigrationPath* = projectRoot / "migrations" / "message_store" +const PeerStoreMigrationPath* = projectRoot / "migrations" / "peer_store" type MigrationScriptsResult*[T] = Result[T, string] type