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"),