add good_id
All checks were successful
Build and push image / deploy (push) Successful in 2m36s

This commit is contained in:
2024-01-03 01:01:56 +03:00
parent 7acb7393a3
commit c4e71fca93
5 changed files with 53 additions and 0 deletions

View File

@ -0,0 +1,14 @@
-- +goose Up
-- +goose StatementBegin
ALTER TABLE goods
ADD COLUMN good_id INTEGER NOT NULL DEFAULT 0;
UPDATE goods
SET good_id = split_part(goodlink, '/', 4)::integer;
-- +goose StatementEnd
-- +goose Down
-- +goose StatementBegin
ALTER TABLE goods
DROP COLUMN good_id;
-- +goose StatementEnd