-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup-aws-snapshot-db.sql
205 lines (166 loc) · 5.63 KB
/
setup-aws-snapshot-db.sql
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
/*
SQL setup script for AWS Services Snapshot utility
v0.0.8
This script sets up the PostgreSQL database 'aws_snapshot' for use by the
AWS Services Snapshot utility
>> Note: this script must be executed using the 'ec2-user' role <<
------------------------------------------------------------------------------------
MIT License
Copyright (c) 2018 Enterprise Group, Ltd.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
------------------------------------------------------------------------------------
*/
/* create aws_sps__commands schema */
CREATE SCHEMA IF NOT EXISTS aws_sps__commands
;
/* create driver_aws_services table */
DROP TABLE IF EXISTS aws_sps__commands._postgresql_reserved_words
;
CREATE TABLE aws_sps__commands._postgresql_reserved_words(
key_id SERIAL PRIMARY KEY
, reserved_words TEXT NOT NULL
);
/* create driver_aws_services table */
DROP TABLE IF EXISTS aws_sps__commands._driver_aws_services
;
CREATE TABLE aws_sps__commands._driver_aws_services(
key_id SERIAL PRIMARY KEY
, aws_service TEXT NOT NULL
, execute_yn TEXT NOT NULL
, global_aws_service_yn TEXT NOT NULL
, driver_ver TEXT NOT NULL
, driver_tested_yn TEXT NOT NULL
, driver_all_ok_yn TEXT NOT NULL
, aws_service_comment TEXT NOT NULL
);
/* create driver_aws_cli_commands table */
DROP TABLE IF EXISTS aws_sps__commands._driver_aws_cli_commands
;
CREATE TABLE aws_sps__commands._driver_aws_cli_commands(
key_id SERIAL PRIMARY KEY
, aws_service TEXT NOT NULL
, aws_cli_command TEXT NOT NULL
, execute_yn TEXT NOT NULL
, recursive_yn TEXT NOT NULL
, test_ok_yn TEXT NOT NULL
, command_comment TEXT NOT NULL
);
/* create driver_aws_cli_commands_recursive table */
DROP TABLE IF EXISTS aws_sps__commands._driver_aws_cli_commands_recursive
;
CREATE TABLE aws_sps__commands._driver_aws_cli_commands_recursive(
key_id SERIAL PRIMARY KEY
, aws_service TEXT NOT NULL
, aws_cli_command TEXT NOT NULL
, parameter_source_aws_service TEXT NOT NULL
, parameter_source_aws_cli_command TEXT NOT NULL
, parameter_source_key TEXT NOT NULL
, recursive_dependent_yn TEXT NOT NULL
, parameter_multi_yn TEXT NOT NULL
, parameter_count TEXT NOT NULL
, parameter_source_table_multi_yn TEXT NOT NULL
, parameter_source_table_count TEXT NOT NULL
, command_parameter TEXT NOT NULL
, parameter_key_hardcode_yn TEXT
, parameter_key_hardcode_value TEXT
, test_ok_yn TEXT
, command_recursive_comment TEXT
, recursive_yn TEXT NOT NULL
, execute_yn TEXT NOT NULL
, recursive_multi_dependent_yn TEXT NOT NULL
, command_repeated_yn TEXT NOT NULL
, command_recursive_table TEXT NOT NULL
, parameter_source_table TEXT NOT NULL
, parameter_source_attribute TEXT NOT NULL
, parameter_source_join_attribute TEXT NOT NULL
, command_repeated_hardcoded_yn TEXT
, command_repeated_hardcoded_prior TEXT
, command_repeated_hardcoded_after TEXT
, join_type TEXT
, command_recursive TEXT
, command_recursive_header TEXT
, command_recursive_1 TEXT
, command_recursive_2 TEXT
, command_recursive_3 TEXT
, command_recursive_4 TEXT
, command_recursive_5 TEXT
, command_recursive_6 TEXT
, command_recursive_7 TEXT
, command_recursive_8 TEXT
, parameter_01_source_table TEXT
, parameter_02_source_table TEXT
, parameter_03_source_table TEXT
, parameter_04_source_table TEXT
, parameter_05_source_table TEXT
, parameter_06_source_table TEXT
, parameter_07_source_table TEXT
, parameter_08_source_table TEXT
, parameter_01_source_key TEXT
, parameter_02_source_key TEXT
, parameter_03_source_key TEXT
, parameter_04_source_key TEXT
, parameter_05_source_key TEXT
, parameter_06_source_key TEXT
, parameter_07_source_key TEXT
, parameter_08_source_key TEXT
, command_recursive_single_query TEXT
, command_recursive_multi_query TEXT
, query_1_param TEXT
, query_name TEXT
, query_drop TEXT
, query_create_build TEXT
, query_create_header TEXT
, query_create_1 TEXT
, query_create_2 TEXT
, query_create_3 TEXT
, query_create_4 TEXT
, query_create_5 TEXT
, query_create_6 TEXT
, query_create_7 TEXT
, query_create_8 TEXT
, query_create_tail TEXT
, query_insert_build TEXT
, query_insert_header TEXT
, query_insert_1 TEXT
, query_insert_2 TEXT
, query_insert_3 TEXT
, query_insert_4 TEXT
, query_insert_5 TEXT
, query_insert_6 TEXT
, query_insert_7 TEXT
, query_insert_8 TEXT
, query_insert_tail TEXT
, query_select_build TEXT
, query_select_header TEXT
, query_select_2 TEXT
, query_select_3 TEXT
, query_select_4 TEXT
, query_select_5 TEXT
, query_select_6 TEXT
, query_select_7 TEXT
, query_select_8 TEXT
, query_from TEXT
, query_from_2 TEXT
, query_from_3 TEXT
, query_from_4 TEXT
, query_from_5 TEXT
, query_from_6 TEXT
, query_from_7 TEXT
, query_from_8 TEXT
, query_tail TEXT
)
;