blob: e0183d78f4f2af403ac426aa91e71e80342ac7ab [file] [log] [blame]
-- Copyright 2021 The Go Authors. All rights reserved.
-- Use of this source code is governed by a BSD-style
-- license that can be found in the LICENSE file.
BEGIN;
ALTER TABLE documentation ADD COLUMN id_bigint bigint;
CREATE OR REPLACE FUNCTION update_documentation_id() RETURNS TRIGGER AS $BODY$
BEGIN
NEW.id=nextval('sequence_documentation_id');
-- Update id_bigint with the same value on insert/update.
NEW.id_bigint=NEW.id;
RETURN NEW;
END
$BODY$ LANGUAGE PLPGSQL;
ALTER SEQUENCE sequence_documentation_id OWNED BY documentation.id;
END;