-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathdeploy.sql
More file actions
63 lines (54 loc) · 1.9 KB
/
deploy.sql
File metadata and controls
63 lines (54 loc) · 1.9 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
-- Oracle → PostgreSQL Migration Deployment Script
-- Generated: 2025-11-10T16:43:46.032575
-- Migration Project: localhost
-- Total Objects: 3
-- PostgreSQL Version: 15+
--
-- This script contains the complete migrated schema in dependency order.
-- Execute this script against your target PostgreSQL database.
--
-- IMPORTANT:
-- - Review this script before execution
-- - Ensure target database has appropriate permissions
-- - Consider running in a transaction for safety
--
-- BEGIN MIGRATION DEPLOYMENT
-- ==========================================
BEGIN;
-- Migration deployment started
DO $$
BEGIN
RAISE NOTICE 'Starting Oracle → PostgreSQL migration deployment at %', NOW();
END $$;
-- PUBLIC.photoalbum (SCHEMA)
-- Source: artifacts\postgres\PUBLIC\SCHEMA\photoalbum.sql
CREATE SCHEMA IF NOT EXISTS photoalbum;
-- photoalbum.photos (TABLE)
-- Source: artifacts\postgres\photoalbum\TABLE\photos.sql
CREATE TABLE IF NOT EXISTS photoalbum.photos (
id VARCHAR(36) NOT NULL,
file_path VARCHAR(500),
file_size BIGINT NOT NULL,
height BIGINT,
mime_type VARCHAR(50) NOT NULL,
original_file_name VARCHAR(255) NOT NULL,
photo_data BYTEA,
stored_file_name VARCHAR(255) NOT NULL,
uploaded_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
width BIGINT,
CONSTRAINT photos_pkey PRIMARY KEY (id)
);
-- PUBLIC.idx_photos_uploaded_at (INDEX)
-- Source: artifacts\postgres\PUBLIC\INDEX\idx_photos_uploaded_at.sql
CREATE INDEX IF NOT EXISTS idx_photos_uploaded_at ON photoalbum.photos ("uploaded_at");
-- Migration deployment completed
DO $$
BEGIN
RAISE NOTICE 'Oracle → PostgreSQL migration deployment completed successfully at %', NOW();
END $$;
COMMIT;
-- END MIGRATION DEPLOYMENT
-- ==========================================
--
-- Migration deployment script generated by Oracle Migration Service
-- For support and documentation, visit: https://github.com/microsoft/vscode-postgresql