From 16ec2c09c5835e5df9da2e752a632120cd048060 Mon Sep 17 00:00:00 2001 From: Gildas Garcia <1122076+djhi@users.noreply.github.com> Date: Wed, 25 Mar 2026 18:12:11 +0100 Subject: [PATCH 1/2] fix: cannot create nor edit foreign keys from schema visualiser (#44190) ## Problem Users cannot create nor edit foreign keys when editing a table or a column from the schema visualiser ## Solution The foreign key edition component is always reading the current table from the URL parameters. However, in the context of the schema visualiser, the parameter does not exist. Allows to override it from the side panel editor context ## How to test - Create two tables - Go to the schema visualiser and edit one of the table - Click the _Add foreign key relation_ and add a foreign key to the other table - Edit one of the foreign key column - You should be able to edit the relation --- .../SidePanelEditor/ColumnEditor/ColumnEditor.tsx | 1 + .../SidePanelEditor/ColumnEditor/ColumnForeignKey.tsx | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/ColumnEditor.tsx b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/ColumnEditor.tsx index 563580f547545..3426c2477728e 100644 --- a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/ColumnEditor.tsx +++ b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/ColumnEditor.tsx @@ -364,6 +364,7 @@ export const ColumnEditor = ({ > void @@ -20,6 +21,7 @@ interface ColumnForeignKeyProps { } const ColumnForeignKey = ({ + tableId, column, relations, closePanel, @@ -29,7 +31,6 @@ const ColumnForeignKey = ({ const { id: _id } = useParams() const [open, setOpen] = useState(false) const [selectedFk, setSelectedFk] = useState() - const { data: project } = useSelectedProjectQuery() const { data } = useForeignKeyConstraintsQuery({ projectRef: project?.ref, @@ -41,7 +42,7 @@ const ColumnForeignKey = ({ const { data: table } = useTableEditorQuery({ projectRef: project?.ref, connectionString: project?.connectionString, - id, + id: tableId ?? id, }) const formattedColumnsForFkSelector = (table?.columns ?? []).map((c) => { return { From 9da28685ec442aa4a687d972b5d2a140096b034c Mon Sep 17 00:00:00 2001 From: Ali Waseem Date: Wed, 25 Mar 2026 14:19:27 -0600 Subject: [PATCH 2/2] fix: remove SMS validation of fields for Twilio Verify (#44198) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## I have read the [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) file. YES ## What kind of change does this PR introduce? Investigation by claude, validated! - Before (Formik): The old form used `
` Formik does not unregister hidden fields — all fields from initialValues stay in form state with their initial values, so hidden required fields still pass validation because they retain their default values (e.g., the OTP expiry/length numbers from the config). - After (react-hook-form): The new form uses useForm({ shouldUnregister: true }). This explicitly removes fields from form state when their components unmount. When Twilio Verify is selected, the three hidden fields are unmounted, their values become undefined, and yup's unconditional .required() fails silently. this bug was introduced today by PR #44095, the Formik-to-react-hook-form migration. --- .../Auth/AuthProvidersFormValidation.tsx | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/apps/studio/components/interfaces/Auth/AuthProvidersFormValidation.tsx b/apps/studio/components/interfaces/Auth/AuthProvidersFormValidation.tsx index 2feadc158315d..173081f8a6b50 100644 --- a/apps/studio/components/interfaces/Auth/AuthProvidersFormValidation.tsx +++ b/apps/studio/components/interfaces/Auth/AuthProvidersFormValidation.tsx @@ -194,9 +194,25 @@ export const getPhoneProviderValidationSchema = (config: ProjectAuthConfigData) }), // Phone SMS - SMS_OTP_EXP: number().min(0, 'Must be more than 0').required('This is required'), - SMS_OTP_LENGTH: number().min(6, 'Must be 6 or more in length').required('This is required'), - SMS_TEMPLATE: string().required('SMS template is required.'), + SMS_OTP_EXP: number() + .min(0, 'Must be more than 0') + .when('SMS_PROVIDER', { + is: (val: string) => val !== 'twilio_verify', + then: (schema) => schema.required('This is required'), + otherwise: (schema) => schema, + }), + SMS_OTP_LENGTH: number() + .min(6, 'Must be 6 or more in length') + .when('SMS_PROVIDER', { + is: (val: string) => val !== 'twilio_verify', + then: (schema) => schema.required('This is required'), + otherwise: (schema) => schema, + }), + SMS_TEMPLATE: string().when('SMS_PROVIDER', { + is: (val: string) => val !== 'twilio_verify', + then: (schema) => schema.required('SMS template is required.'), + otherwise: (schema) => schema, + }), SMS_TEST_OTP: string() .matches( /^\s*([0-9]{1,15}=[0-9]+)(\s*,\s*[0-9]{1,15}=[0-9]+)*\s*$/g,