DASSL / ClassDB

An open-source system to let students experiment with relational data
https://dassl.github.io/ClassDB/
Other
7 stars 2 forks source link

Add kind specific prep scripts #167

Closed KevinKelly25 closed 6 years ago

KevinKelly25 commented 6 years ago

Added kind specific prep scripts for each subfolder in server and database.

smurthys commented 6 years ago

Thanks @KevinKelly25 for creating the files. The files generally implement the criteria we decided.

Before it is lost in other details, I wonder if prepareServerCore.sql should be renamed to intitializeServerCore.sql. That is not the subject of this PR, but this PR does show the need to rename. If we agree, the change can be done in this PR.

A few thoughts:

--This script runs other scripts that add optional ClassDB functionality to the current database

--This script should be run after adding core ClassDB functionality

-- This script uses psql meta-commands run other scripts and so it should be run using psql.
--  the script can be run using the -f command line switch of psql or using the \i command 
--  inside a psql interactive session
KevinKelly25 commented 6 years ago

Made corrections for @smurthys comment

afig commented 6 years ago

Thanks for implementing these scripts @KevinKelly25, they work great.

In relation to @smurthys's comment, I agree that prepareServerCore.psql should be renamed to initializeServerCore.psql.

On a related note, I wonder if we should use the \ir flag instead of the \i flag that we are using now. The \i flag looks for scripts using the current working directory of the command window. However, \ir looks for scripts using a relative path from where the script is located. Using this new flag will avoid having to exit psql and change directories to run each of the new scripts.

(Just got ninja'd by @srrollo 😄 )

smurthys commented 6 years ago

I agree with using \ir meta command.

wildtayne commented 6 years ago

I agree with @afig's assesment more than mine. I though it would be enough to execute the install scripts with the \ir command, but it appears we need to change \i in all the scripts for it to work.

smurthys commented 6 years ago

BTW, comments in scripts should also reflect the use of \ir meta command.

KevinKelly25 commented 6 years ago

@afig and @srrollo Thank you for making me aware of the \ir flag. It makes much more sense to use. I added commit c897652 to address that issue and add related comments.