From 92bf62d2a2af056c51d959eac7d1e974007b9a18 Mon Sep 17 00:00:00 2001 From: yuunlimm Date: Mon, 8 Jul 2024 17:40:31 -0700 Subject: [PATCH 1/2] truncate deprecated tables --- .../2024-07-08-182507_truncate_deprecated_tables/down.sql | 2 ++ .../2024-07-08-182507_truncate_deprecated_tables/up.sql | 4 ++++ 2 files changed, 6 insertions(+) create mode 100644 rust/processor/src/db/postgres/migrations/2024-07-08-182507_truncate_deprecated_tables/down.sql create mode 100644 rust/processor/src/db/postgres/migrations/2024-07-08-182507_truncate_deprecated_tables/up.sql diff --git a/rust/processor/src/db/postgres/migrations/2024-07-08-182507_truncate_deprecated_tables/down.sql b/rust/processor/src/db/postgres/migrations/2024-07-08-182507_truncate_deprecated_tables/down.sql new file mode 100644 index 000000000..15cdf6517 --- /dev/null +++ b/rust/processor/src/db/postgres/migrations/2024-07-08-182507_truncate_deprecated_tables/down.sql @@ -0,0 +1,2 @@ +-- No down migration for truncate operation +SELECT 1; diff --git a/rust/processor/src/db/postgres/migrations/2024-07-08-182507_truncate_deprecated_tables/up.sql b/rust/processor/src/db/postgres/migrations/2024-07-08-182507_truncate_deprecated_tables/up.sql new file mode 100644 index 000000000..2c04e1619 --- /dev/null +++ b/rust/processor/src/db/postgres/migrations/2024-07-08-182507_truncate_deprecated_tables/up.sql @@ -0,0 +1,4 @@ +---- Delete the data inside the tables +TRUNCATE TABLE move_resources; +TRUNCATE TABLE write_set_changes; +TRUNCATE TABLE transactions; From 9179ea06941626970ee36c0806e86291002895ba Mon Sep 17 00:00:00 2001 From: yuunlimm Date: Tue, 9 Jul 2024 10:18:18 -0700 Subject: [PATCH 2/2] comment out the script in case customers need data --- .../2024-07-08-182507_truncate_deprecated_tables/up.sql | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/rust/processor/src/db/postgres/migrations/2024-07-08-182507_truncate_deprecated_tables/up.sql b/rust/processor/src/db/postgres/migrations/2024-07-08-182507_truncate_deprecated_tables/up.sql index 2c04e1619..e8f31311e 100644 --- a/rust/processor/src/db/postgres/migrations/2024-07-08-182507_truncate_deprecated_tables/up.sql +++ b/rust/processor/src/db/postgres/migrations/2024-07-08-182507_truncate_deprecated_tables/up.sql @@ -1,4 +1,5 @@ ---- Delete the data inside the tables -TRUNCATE TABLE move_resources; -TRUNCATE TABLE write_set_changes; -TRUNCATE TABLE transactions; +-- If you don't need the data and would like to delete, you could uncomment to run it. +--TRUNCATE TABLE move_resources; +--TRUNCATE TABLE write_set_changes; +--TRUNCATE TABLE transactions;