SQL schema versioning #1

Closed
opened 2025-04-17 21:47:31 +02:00 by tma · 0 comments
Owner

Make Schema versionable for v1

See

-- intoduce implementation schema
CREATE SCHEMA IF NOT EXISTS brmbar_implementation;
-- version table (with initialization)
CREATE TABLE IF NOT EXISTS brmbar_implementation.brmbar_schema (
ver INTEGER NOT NULL
);
DO $$
DECLARE v INTEGER;
BEGIN
SELECT ver FROM brmbar_implementation.brmbar_schema INTO v;
IF v IS NULL THEN
INSERT INTO brmbar_implementation.brmbar_schema (ver) VALUES (1);
END IF;
END;
$$;

Make Schema versionable for v1 See https://git.brmlab.cz/brmlab/brmbar/src/commit/3000731ac7b4bbcba045276a0df93acbb02b9af8/brmbar3/SQL-schema-v002.sql#L1-L15
dzoe was assigned by tma 2025-04-17 21:47:31 +02:00
tma added this to the SQL schema modernization + transactional business logic project 2025-04-17 21:47:31 +02:00
dzoe closed this issue 2025-04-20 17:01:55 +02:00
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: brmlab/brmbar#1
No description provided.