This project houses the database schemas for the PostgreSQL database that feeds the whole run.codes application.
This project is very simple in its structure. The most important directory is the schema/
.
It houses the SQL files used to build the whole database, there are, currently, three variants:
schema/base.sql
- The base file, as the name suggests, is the most "raw" form of the SQL file, constructing only the tables and overall structure, without including any pre-defined data.
schema/development.sql
- The development file extends the base one, adding some initial data for simplifying the development process, like pre-registred users and universities.
schema/production.sql
- The production file also extends the base one, but doesn't include much initial data, the only information included is a initial admin user, which can then be used to setup and control the application.
To simplify the deployment and testing of the application, there are some base Docker files that
extends the default postgres
one, the only change it makes is the inclusion of the initialization
SQL code for each of the environments.
There are, currently, two variants:
docker/Dockerfile.development
- Which initializes the database with the
schema/development.sql
file.
- Which initializes the database with the
docker/Dockerfile.production
- Which initializes the database with the
schema/production.sql
file.
- Which initializes the database with the
The recommended way to build and tag these images are as follows (all commands assume that you are on the root of this repository):
docker build -t runcodes-database:development -f ./docker/Dockerfile.development .
docker build -t runcodes-database:production -f ./docker/Dockerfile.production .
To simplify the building process by not needing to run those commands "by hand" all the time, there is also a Makefile that automates it. So you can just run:
make production
- To build and tag the production image.
make development
- To build and tag the development image.
make
ormake all
- To build and tag both images.
For information on the license of this project, please see our license file.
For information of the contributors of this project, please see our contributors file.
For information on contributing to this project, please see our contribution guidelines.