learn-request-queue/db/00-version.sql

12 lines
268 B
PL/PgSQL

CREATE TABLE version (
major INT NOT NULL,
minor INT NOT NULL,
PRIMARY KEY (major,minor)
);
CREATE OR REPLACE FUNCTION get_version() RETURNS VARCHAR
AS $$SELECT major || '.' || minor FROM version $$
LANGUAGE SQL;
INSERT INTO version (major,minor) VALUES (0,2);