migrations

This commit is contained in:
dylan 2023-10-31 20:31:17 -07:00
parent c55a9e8b98
commit 334c09df7c
5 changed files with 19 additions and 3 deletions

View File

@ -1,6 +1,6 @@
export PORT=8080 export PORT=8080
export DB_HOST=postgres export DB_HOST=localhost
export DB_USER=postgres export DB_USER=postgres
export DB_PASSWORD=password export DB_PASSWORD=password
export DB_NAME=db_name export DB_NAME=db_name

View File

@ -9,7 +9,7 @@
"dev-server": "echo \"starting server\" && npm run dev-ts ./src/server/index.ts", "dev-server": "echo \"starting server\" && npm run dev-ts ./src/server/index.ts",
"dev-ts": "nodemon --require 'dotenv/config'", "dev-ts": "nodemon --require 'dotenv/config'",
"dev-watch-client": "ts-node ./scripts/watch.ts", "dev-watch-client": "ts-node ./scripts/watch.ts",
"dev-migrate": "source ./.env pg-migrations apply --directory ./src/database/migrations", "dev-migrate": "source ./.env && pg-migrations apply --directory ./src/database/migrations",
"prod-migrate": "pg-migrations apply --directory ./src/database/migrations", "prod-migrate": "pg-migrations apply --directory ./src/database/migrations",
"prod-build-client": "ts-node ./scripts/build.ts", "prod-build-client": "ts-node ./scripts/build.ts",
"prod-docker": "docker compose --profile prod up -d", "prod-docker": "docker compose --profile prod up -d",

View File

@ -1,4 +1,5 @@
CREATE TABLE users ( CREATE TABLE users (
id text, id text,
username text name text,
password text
) )

View File

@ -0,0 +1,8 @@
CREATE TABLE games (
id text,
name text, -- user defined
repo_fullname text, -- e.g. "username/reponame"
repo_hosttype text, -- "github", "gitea", "gitlab", ...
repo_token text, -- an api auth token to read from the repo
user_id text
)

View File

@ -0,0 +1,7 @@
CREATE TABLE game_instances (
id text,
game_id text,
cart_data text,
created_at time,
is_official boolean
)