-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.sql
More file actions
35 lines (27 loc) · 1.04 KB
/
main.sql
File metadata and controls
35 lines (27 loc) · 1.04 KB
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
32
33
34
35
-- Main schema file demonstrating \i include functionality
-- This represents a modular approach to organizing database schema
-- Includes ALL supported PostgreSQL database objects
-- Include custom types first (dependencies for tables)
\i types/user_status.sql
\i types/order_status.sql
\i types/address.sql
-- Include domain types (constrained base types)
\i domains/email_address.sql
\i domains/positive_integer.sql
-- Include sequences (may be used by tables)
\i sequences/global_id_seq.sql
\i sequences/order_number_seq.sql
-- Include trigger function (needed by users table trigger)
\i functions/update_timestamp.sql
-- Include core tables (with their constraints, indexes, and policies)
\i tables/addresses.sql
\i tables/users.sql
-- Include other functions (after tables that they reference)
\i functions/get_user_count.sql
\i functions/get_order_count.sql
-- Include procedures
\i procedures/cleanup_orders.sql
\i procedures/update_status.sql
-- Include views (depend on tables and functions)
\i views/user_summary.sql
\i views/order_details.sql