Skip to content

Last-Men-Standing/blueview-database

Repository files navigation

Database Management System for BlueView

This repository contains SQL and corresponding scripts to setup and populate the database for BlueView

Authored by:

  • William A. Zawilinski
  • Joseph C. Cengel
  • Richard Drum
  • Anthony Chen
  • Zack Allen

Development Environment

The latest version of Node.js > (v8.0.0) should be installed on your system. If you are using Windows and are having a hard time installing the latest version, please consider using Node Version Manager.

Installation Instructions

Clone the repository in the desired directory. Once cloned, run the following command in the root of the project directory to install the required dependencies.

npm install

Installing Postgres

On Windows, you can use installer available on the Postgres Windows Installers page. At the least, you should install the Postgres server. pgAdmin might be helpful but is not a requirement. StackBuilder is provided by the company that creates the installer; it's not necessary.

On Mac, use homebrew: brew install postgres. You can install pgAdmin separately if you wish.

On Linux, there are instructions available. There are packages for most major distributions that will be sufficient.

Setup

Once you've installed Postgres, you should be able to run the psql command from the command line.

Postgres ties into the underlying user accounts of the host operating system, so when you run psql with no other arguments, it will attempt to connect to a Postgres user with the same name as whatever username you're signed in with, and to a database with the same name.

Start the postgres prompt with some variation of

  • psql

  • psql -U postgres postgres

  • sudo -u postgres psql postgres depending on the specifics of your installation.

  • \q Use this to exit the prompt

Running the Initialization Script

Once Postgres is installed on your machine, run the following command to create the database and database user. Run this command in the root of the database directory.

psql postgres < initialize.sql

Building the Database

Once the database has been created along with the user, run the following script to create the tables and populate the department data.

npm run rebuild_database

Killing the script

Run the following commands to ensure the database is populated. Once the relations are there, kill the script. We realize this is not the best way to manage this and are exploring alternative modules/methods.

psql -U bv_user blueview_development 

Once in the sql prompt, run the following

\dt

Run the following to exit the psql prompt

\q

Run the following in the root directory to exit the build_script

^C

Starting the Database

Once the database has been built, run the following command in any directory to start Postgres on your machine Mac/Linux

postgres

About

DBMS for BlueView

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •