-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.sql
More file actions
31 lines (25 loc) · 766 Bytes
/
init.sql
File metadata and controls
31 lines (25 loc) · 766 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
DO $$
BEGIN
IF NOT EXISTS (SELECT 1 FROM pg_type WHERE typname = 'lang_type') THEN
CREATE TYPE lang_type AS ENUM ('pl', 'en', 'fr', 'de');
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS (SELECT 1 FROM pg_type WHERE typname = 'select_type') THEN
CREATE TYPE select_type AS ENUM ('button', 'select');
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS (SELECT 1 FROM pg_type WHERE typname = 'unit_type') THEN
CREATE TYPE unit_type AS ENUM ('pc.', 'l', 'kg', 'set');
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS (SELECT 1 FROM pg_type WHERE typname = 'action_type') THEN
CREATE TYPE action_type AS ENUM ('password_reset', 'email_verification', 'admin_action');
END IF;
END $$;