-
Notifications
You must be signed in to change notification settings - Fork 2
Custom field name panic #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Update: Found the exact issue - Column naming is hardcodedI've identified a clear reproduction of the issue. The plugin appears to ignore the field mappings entirely. When I modified my migration to use camelCase naming directly in the database (instead of snake_case with mappings): -- Migration: 0003_add_normalized_email.sql
-- Description: Add normalized_email field to firestorm_users table for email harmony
PRAGMA foreign_keys = ON;
-- Add normalized_email column to firestorm_users table
ALTER TABLE firestorm_users ADD COLUMN normalizedEmail TEXT;
-- Create a unique index for the normalized_email column
CREATE UNIQUE INDEX idx_users_normalized_email ON firestorm_users(normalizedEmail); The application works perfectly without changing any of the mappings in the configuration. This confirms that the user: {
modelName: "firestorm_users",
fields: {
// This mapping is being completely ignored by the plugin
normalizedEmail: "normalized_email"
},
} The plugin should respect the field mappings defined in the configuration rather than assuming database column names. |
Make the normalized email field name configurable via normalizedEmailField option to fix compatibility with databases that use different field names. Fixes GeKorm#31
Bug Report: emailHarmony plugin causes error with missing normalized_email field
Describe the bug
When adding the
emailHarmony()
plugin to the plugins array, the application fails. The error occurs during user creation even though the database schema includes thenormalized_email
column and it's properly mapped in the configuration.To Reproduce
normalized_email
field on the users tablenormalizedEmail: "normalized_email"
emailHarmony()
plugin to the plugins arrayExpected behavior
The application should successfully create users with the normalized email populated by the emailHarmony plugin.
Code Example
Database schema
Error Details
The error appears to be related to database operations when the emailHarmony plugin is active. Execution fails during the user creation process in the Kysely query builder execution:
Environment
Additional context
I've verified that:
normalized_email
columnemailHarmony()
plugin is addedThe text was updated successfully, but these errors were encountered: