Revision 2631
Added by Aaron Marcuse-Kubitza over 12 years ago
Makefile | ||
---|---|---|
182 | 182 |
|
183 | 183 |
rmPublicSchema := $(call rmSchemaCmd,public) |
184 | 184 |
|
185 |
db: mk_db rm_initial_public schemas/functions/reset schemas/py_functions/reset\ |
|
186 |
schemas/install _always ; |
|
185 |
db: mk_db rm_initial_public schemas/install _always ; |
|
187 | 186 |
|
188 | 187 |
mk_db: _always |
189 | 188 |
-echo "CREATE USER bien PASSWORD '$(bienPassword)';"|$(psqlAsAdmin) |
... | ... | |
204 | 203 |
|
205 | 204 |
reinstall_db: _always rm_db db ; |
206 | 205 |
|
207 |
#### public schema
|
|
206 |
#### Schemas
|
|
208 | 207 |
|
209 |
schemas/install: schemas/vegbien.sql _always |
|
208 |
schemas := functions py_functions public |
|
209 |
schemas/install: $(schemas:%=schemas/%/install) ; |
|
210 |
|
|
211 |
schemasReversed := public py_functions functions |
|
212 |
schemas/uninstall: $(schemasReversed:%=schemas/%/uninstall) ; |
|
213 |
|
|
214 |
### public |
|
215 |
|
|
216 |
schemas/public/install: schemas/vegbien.sql _always |
|
210 | 217 |
-echo $(call mkSchemaCmd,public)|$(psqlAsBien) |
211 | 218 |
<$< $(psqlAsBien) |
212 | 219 |
# ignore errors if schema exists |
213 | 220 |
# public schema will be owned by bien |
214 | 221 |
|
215 |
schemas/uninstall: _always |
|
222 |
schemas/public/uninstall: _always
|
|
216 | 223 |
@$(confirmRmPublicSchema) |
217 | 224 |
echo $(rmPublicSchema)|$(psqlAsBien) |
218 | 225 |
|
... | ... | |
224 | 231 |
@$(confirmRmPublicSchema) |
225 | 232 |
$(psqlAsBien) <schemas/vegbien_empty.sql |
226 | 233 |
|
227 |
#### functions schema
|
|
234 |
### py_functions
|
|
228 | 235 |
|
229 |
schemas/functions/reset: schemas/functions.sql _always |
|
230 |
@$(call confirmRmSchema,functions) |
|
231 |
echo $(call rmSchemaCmd,functions)|$(psqlAsBien) |
|
236 |
schemas/py_functions/install: schemas/py_functions.sql _always |
|
237 |
<$< $(psqlAsAdminVegbien) |
|
238 |
|
|
239 |
### Others |
|
240 |
|
|
241 |
schemas/%/install: schemas/%.sql _always |
|
232 | 242 |
<$< $(psqlAsBien) |
233 | 243 |
|
234 |
#### py_functions schema |
|
244 |
schemas/%/uninstall: _always |
|
245 |
@$(call confirmRmSchema,$*) |
|
246 |
echo $(call rmSchemaCmd,$*)|$(psqlAsBien) |
|
235 | 247 |
|
236 |
schemas/py_functions/reset: schemas/py_functions.sql _always |
|
237 |
@$(call confirmRmSchema,py_functions) |
|
238 |
echo $(call rmSchemaCmd,py_functions)|$(psqlAsBien) |
|
239 |
<$< $(psqlAsAdminVegbien) |
|
240 |
|
|
241 | 248 |
##### MySQL |
242 | 249 |
|
243 | 250 |
mysql: _always $(call forOs,mysql) mysql_user |
Also available in: Unified diff
main Makefile: VegBIEN DB: Schemas: Changed to only allow reinstalling all schemas at once (using the usual `make schemas/reinstall` command), because reinstalling just one schema would silently remove anything in other schemas that depends on that schema