summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorKjetil Orbekk <kj@orbekk.com>2022-10-08 08:26:57 -0400
committerKjetil Orbekk <kj@orbekk.com>2022-10-08 08:26:57 -0400
commit97598e7edfcdc97e665453d6f5cda316bd51291b (patch)
tree729ed92e6c40f691fe364bb556908b0df73914b0 /server
parentba57f14611b3a35bc08f01050779f1b4c9fc6090 (diff)
Add initial postgresql database setup
Diffstat (limited to 'server')
-rw-r--r--server/.env3
-rw-r--r--server/Cargo.toml1
-rw-r--r--server/migrations/20221008120534_init.down.sql2
-rw-r--r--server/migrations/20221008120534_init.up.sql8
4 files changed, 13 insertions, 1 deletions
diff --git a/server/.env b/server/.env
index fe7eb8f..61c7e89 100644
--- a/server/.env
+++ b/server/.env
@@ -4,4 +4,5 @@ RUST_BACKTRACE=1
OPENID_ISSUER_URL=https://auth.orbekk.com/realms/test
OPENID_CLIENT_ID=test-client
OPENID_CLIENT_SECRET=EbIMIpGnYPrG1GBl6eZtVM5zIhiuu5p1
-APP_URL=https://bridge.orbekk.com \ No newline at end of file
+APP_URL=https://bridge.orbekk.com
+DATABASE_URL=postgres://bridge_nightly:bridge_nightly@dragon.nyc.orbekk.com/bridge_nightly \ No newline at end of file
diff --git a/server/Cargo.toml b/server/Cargo.toml
index 92e4730..e7824a2 100644
--- a/server/Cargo.toml
+++ b/server/Cargo.toml
@@ -21,3 +21,4 @@ uuid = { version = "1.1.2", features = ["serde", "fast-rng", "v4"] }
tower-cookies = "0.7.0"
tower = { version = "0.4.13", features = ["full"] }
urlencoding = "2.1.2"
+sqlx = { version = "0.6", features = [ "runtime-tokio-native-tls" , "postgres" ] } \ No newline at end of file
diff --git a/server/migrations/20221008120534_init.down.sql b/server/migrations/20221008120534_init.down.sql
new file mode 100644
index 0000000..3b80b80
--- /dev/null
+++ b/server/migrations/20221008120534_init.down.sql
@@ -0,0 +1,2 @@
+-- Add down migration script here
+drop table if exists users;
diff --git a/server/migrations/20221008120534_init.up.sql b/server/migrations/20221008120534_init.up.sql
new file mode 100644
index 0000000..bcd9c2c
--- /dev/null
+++ b/server/migrations/20221008120534_init.up.sql
@@ -0,0 +1,8 @@
+-- Add up migration script here
+create table users (
+ id uuid primary key,
+ username varchar(32) not null,
+ access_token varchar(2048) not null,
+ access_token_expiration timestamp with time zone not null,
+ refresh_token varchar(512) not null
+);