dex/db/migrations/0009_key_not_primary_key.sql
Bobby Rullo c1f8effe1a db, functional: make value column in key not pkey
go-oidc increased the size of the generated keys, which were too large
to be used as primary keys in postgres.
2015-12-28 16:02:16 -08:00

5 lines
182 B
SQL

-- +migrate Up
ALTER TABLE key ADD COLUMN tmp_value bytea;
UPDATE KEY SET tmp_value = value;
ALTER TABLE key DROP COLUMN value;
ALTER TABLE key RENAME COLUMN "tmp_value" to "value";