diff --git a/migrations/20210318172317_initialmigration.up.sql b/migrations/20210318172317_initialmigration.up.sql
index 4fdd3e4..514d3ba 100644
--- a/migrations/20210318172317_initialmigration.up.sql
+++ b/migrations/20210318172317_initialmigration.up.sql
@@ -8,11 +8,10 @@ CREATE TABLE IF NOT EXISTS users (
email VARCHAR NOT NULL,
password VARCHAR NOT NULL,
role INTEGER DEFAULT 1 NOT NULL,
- UNIQUE(username, email)
+ UNIQUE(username),
+ UNIQUE(email)
);
-CREATE UNIQUE INDEX ux_username ON users(username);
-
CREATE TABLE IF NOT EXISTS links (
id INTEGER PRIMARY KEY NOT NULL,
title VARCHAR NOT NULL,
diff --git a/src/cli.rs b/src/cli.rs
index a65ddb4..12f189d 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -5,6 +5,7 @@ use clap::{
use dotenv::dotenv;
use sqlx::{migrate::Migrator, Pool, Sqlite};
use std::{
+ fs::File,
io::{self, BufRead, Write},
path::PathBuf,
};
@@ -213,14 +214,16 @@ async fn parse_args_to_config(config: ArgMatches<'_>, log: Logger) -> ServerConf
pub(crate) async fn setup() -> Result