Commit f510b380 authored by Allele Dev's avatar Allele Dev

fix: sql setup instructions

parent 1643a0d6
......@@ -53,6 +53,29 @@ steps. The default settings are:
* User name: `strangeloop`
* Password: `cat`
Once you're able to connect, you should be able to create all the
required tables using three commands, two run as the superuser:
```sql
$ createdb strangeloop
$ psql strangeloop < sql/00-setup.sql
CREATE EXTENSION
CREATE ROLE
GRANT
CREATE SCHEMA
$ psql -h localhost strangeloop strangeloop < sql/01-players-runs-games.sql
Password for user strangeloop:
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
```
## Redis
Redis is used for session key management. The easiest way to get that
......
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
CREATE USER strangeloop ENCRYPTED PASSWORD 'cat';
GRANT ALL ON DATABASE strangeloop to strangeloop;
CREATE SCHEMA IF NOT EXISTS tas AUTHORIZATION strangeloop;
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
CREATE SCHEMA IF NOT EXISTS tas AUTHORIZATION strangeloop;
CREATE TABLE IF NOT EXISTS tas.image (
id uuid PRIMARY KEY DEFAULT uuid_generate_v4(),
iname varchar(64) NOT NULL,
......@@ -61,7 +57,3 @@ CREATE TABLE IF NOT EXISTS tas.player_games (
player_id uuid NOT NULL REFERENCES tas.player (id),
game_id uuid NOT NULL REFERENCES tas.game (id)
);
GRANT SELECT, INSERT, UPDATE, DELETE
ON ALL TABLES IN SCHEMA tas
TO strangeloop;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment