Skip to content

Commit

Permalink
fix(condo): DOMA-10735 migration filled account number column for met… (
Browse files Browse the repository at this point in the history
#5535)

* fix(condo): DOMA-10735 migration filled account number column for meter readings

* fix(condo): DOMA-10735 fixed condition

* fix(condo): DOMA-10735 removed changes on down
  • Loading branch information
abshnko authored and vovaaxeapolla committed Nov 26, 2024
1 parent a5651f5 commit 8fd48ba
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions apps/condo/migrations/20241125100251-0439_auto_20241125_0702.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// auto generated by kmigrator
// KMIGRATOR:0439_auto_20241125_0702:IyBHZW5lcmF0ZWQgYnkgRGphbmdvIDQuMi4xMyBvbiAyMDI0LTExLTI1IDA3OjAyCgpmcm9tIGRqYW5nby5kYiBpbXBvcnQgbWlncmF0aW9ucwoKCmNsYXNzIE1pZ3JhdGlvbihtaWdyYXRpb25zLk1pZ3JhdGlvbik6CgogICAgZGVwZW5kZW5jaWVzID0gWwogICAgICAgICgnX2RqYW5nb19zY2hlbWEnLCAnMDQzOF9hdXRvXzIwMjQxMTEyXzExNTknKSwKICAgIF0KCiAgICBvcGVyYXRpb25zID0gWwogICAgXQo=

exports.up = async (knex) => {
await knex.raw(`
BEGIN;
SET statement_timeout = '1500s';
UPDATE "MeterReading"
SET "accountNumber" = "Meter"."accountNumber"
FROM "Meter"
WHERE "MeterReading"."meter" = "Meter"."id"
AND "Meter"."deletedAt" is NULL
AND "MeterReading"."accountNumber" is NULL;
SET statement_timeout = '10s';
COMMIT;
`)
}

exports.down = async (knex) => {
await knex.raw(`
BEGIN;
COMMIT;
`)
}

0 comments on commit 8fd48ba

Please sign in to comment.