This commit is contained in:
14
migrations/20240103005325_goods_id.sql
Normal file
14
migrations/20240103005325_goods_id.sql
Normal 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
|
Reference in New Issue
Block a user