Some checks failed
Backend Tests / Static Checks (push) Has been cancelled
Backend Tests / Tests (other) (push) Has been cancelled
Backend Tests / Tests (plugin) (push) Has been cancelled
Backend Tests / Tests (server) (push) Has been cancelled
Backend Tests / Tests (store) (push) Has been cancelled
Build Canary Image / build-frontend (push) Has been cancelled
Build Canary Image / build-push (linux/amd64) (push) Has been cancelled
Build Canary Image / build-push (linux/arm64) (push) Has been cancelled
Build Canary Image / merge (push) Has been cancelled
Frontend Tests / Lint (push) Has been cancelled
Frontend Tests / Build (push) Has been cancelled
Proto Linter / Lint Protos (push) Has been cancelled
18 lines
383 B
SQL
18 lines
383 B
SQL
ALTER TABLE
|
|
resource
|
|
ADD
|
|
COLUMN public_id TEXT NOT NULL DEFAULT '';
|
|
|
|
CREATE UNIQUE INDEX resource_id_public_id_unique_index ON resource (id, public_id);
|
|
|
|
UPDATE
|
|
resource
|
|
SET
|
|
public_id = printf (
|
|
'%s-%s-%s-%s-%s',
|
|
lower(hex(randomblob(4))),
|
|
lower(hex(randomblob(2))),
|
|
lower(hex(randomblob(2))),
|
|
lower(hex(randomblob(2))),
|
|
lower(hex(randomblob(6)))
|
|
); |