From 98a3ae5009bde4bd8d21ea17877afedb73ef41a8 Mon Sep 17 00:00:00 2001 From: michaelschal <35957947-michaelschal@users.noreply.replit.com> Date: Mon, 11 Aug 2025 18:15:26 +0000 Subject: [PATCH] Ensure username is required for new users Update database schema to make the username field mandatory for all users. Replit-Commit-Author: Agent Replit-Commit-Session-Id: a8a78c07-e900-425c-a577-5b4c5894379d Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/a8a78c07-e900-425c-a577-5b4c5894379d/vetH0Gp --- init.sql | 2 +- shared/schema.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/init.sql b/init.sql index dd11655..e75cdb2 100644 --- a/init.sql +++ b/init.sql @@ -31,7 +31,7 @@ CREATE INDEX IDX_session_expire ON sessions(expire); -- Création de la table users CREATE TABLE users ( id VARCHAR PRIMARY KEY NOT NULL, - username VARCHAR UNIQUE, + username VARCHAR UNIQUE NOT NULL, email VARCHAR UNIQUE, name VARCHAR, first_name VARCHAR, diff --git a/shared/schema.ts b/shared/schema.ts index a38f52a..cb09e89 100644 --- a/shared/schema.ts +++ b/shared/schema.ts @@ -30,7 +30,7 @@ export const sessions = pgTable( // User storage table - supports both Replit Auth and local auth export const users = pgTable("users", { id: varchar("id").primaryKey().notNull(), - username: varchar("username").unique(), // For simple login + username: varchar("username").unique().notNull(), // For simple login email: varchar("email").unique(), name: varchar("name"), // Single name field for compatibility firstName: varchar("first_name"),