diff --git a/src/main/resources/schema.sql b/src/main/resources/schema.sql
index 2018117..365f9e7 100644
--- a/src/main/resources/schema.sql
+++ b/src/main/resources/schema.sql
@@ -2,7 +2,8 @@
   user_id INT AUTO_INCREMENT PRIMARY KEY,
   user_name VARCHAR(255) NOT NULL,
   password VARCHAR(255) NOT NULL,
-  email VARCHAR(255) NOT NULL UNIQUE
+  email VARCHAR(255) NOT NULL UNIQUE,
+  passkey VARCHAR(255) NOT NULL UNIQUE
 );
 
 CREATE TABLE IF NOT EXISTS `torrents` (
@@ -15,7 +16,7 @@
 );
 
 CREATE TABLE IF NOT EXISTS `peers` (
-  user_id INT NOT NULL,
+  passkey VARCHAR(255) NOT NULL,
   info_hash BINARY(20) NOT NULL,
   peer_id VARCHAR(20) NOT NULL,
   ip_address VARCHAR(128) NOT NULL,
@@ -23,6 +24,6 @@
   uploaded FLOAT NOT NULL,
   downloaded FLOAT NOT NULL,
   last_seen TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
-  FOREIGN KEY (user_id) REFERENCES users(user_id),
-  PRIMARY KEY (user_id, info_hash, peer_id)
+  FOREIGN KEY (passkey) REFERENCES users(passkey),
+  PRIMARY KEY (passkey, info_hash, peer_id)
 );
