Before applying database migrations, systematically validate existing data and check for potential conflicts with current schema constraints. This prevents migration failures and ensures backward compatibility.
When modifying database schema or constants that affect database state:
Example approach for constraint modifications:
# 1. Select all, validate all names per user and update db
# 2. Create new table with constraint that does not conflict with existing constraint
# 3. Insert into it
# 4. Delete old table
This systematic validation prevents issues like foreign key conflicts during table recreation and ensures that changes to constants (like DEFAULT_FOLDER_NAME
) don’t break existing database functions that depend on those values.
Enter the URL of a public GitHub repository