comparison sql/createdb.sql @ 0:1eef88068f9f tip

initial commit of maze game source
author ferencd
date Sun, 15 Sep 2019 11:46:47 +0200
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:1eef88068f9f
1 -- install script for mazedb
2
3 -- clear the leftovers, ie. a brand new database
4 drop database if exists mazedb;
5 drop role if exists mazedb;
6
7 -- create the requested mazedb user and DB
8 create user mazedb createdb unencrypted password 's321851gper';
9 create database mazedb owner mazedb;
10
11 -- just in case make it superuser
12 alter user mazedb with SUPERUSER;
13
14 -- connect to the database
15 \connect mazedb
16
17 CREATE TABLE games
18 (
19 game_id SERIAL, -- Just primary key
20 level_id character varying, -- The ID of the level, also a URL parameter
21 level_number integer, -- On which level the game was saved
22 level_type CHARACTER(1), -- What type this game is: S, A, T
23 created_at TIMESTAMP DEFAULT NOW(),-- When this game was created
24 CONSTRAINT game_pk PRIMARY KEY (game_id)
25 )
26 WITH (
27 OIDS = FALSE
28 )
29 ;