From 8655c93853506acf05f6ae4e58bfc2c6198be254 Mon Sep 17 00:00:00 2001
From: Conrad Ludgate <conradludgate@gmail.com>
Date: Mon, 12 Jun 2023 09:04:35 +0100
Subject: refactor server to allow pluggable db and tracing (#1036)

* refactor server to allow pluggable db and tracing

* clean up

* fix descriptions

* remove dependencies
---
 .../migrations/20210425153757_create_users.sql                 | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 atuin-server-postgres/migrations/20210425153757_create_users.sql

(limited to 'atuin-server-postgres/migrations/20210425153757_create_users.sql')

diff --git a/atuin-server-postgres/migrations/20210425153757_create_users.sql b/atuin-server-postgres/migrations/20210425153757_create_users.sql
new file mode 100644
index 00000000..a25dcced
--- /dev/null
+++ b/atuin-server-postgres/migrations/20210425153757_create_users.sql
@@ -0,0 +1,10 @@
+create table users (
+	id bigserial primary key,               -- also store our own ID
+	username varchar(32) not null unique,   -- being able to contact users is useful
+	email varchar(128) not null unique,     -- being able to contact users is useful
+	password varchar(128) not null unique
+);
+
+-- the prior index is case sensitive :(
+CREATE UNIQUE INDEX email_unique_idx on users (LOWER(email));
+CREATE UNIQUE INDEX username_unique_idx on users (LOWER(username));
-- 
cgit v1.3.1

