From 95cc472037fcb3207b510e67f1a44af4e2a2cae9 Mon Sep 17 00:00:00 2001
From: Ellie Huxtable <ellie@elliehuxtable.com>
Date: Thu, 18 Apr 2024 16:41:28 +0100
Subject: chore: move crates into crates/ dir (#1958)

I'd like to tidy up the root a little, and it's nice to have all the
rust crates in one place
---
 .../migrations/20210425153757_create_users.sql                 | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 crates/atuin-server-postgres/migrations/20210425153757_create_users.sql

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

diff --git a/crates/atuin-server-postgres/migrations/20210425153757_create_users.sql b/crates/atuin-server-postgres/migrations/20210425153757_create_users.sql
new file mode 100644
index 00000000..a25dcced
--- /dev/null
+++ b/crates/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

