-- +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
