diff --git a/packages/demo/db-seed.ts b/packages/demo/db-seed.ts index 4a5fc09..62924ce 100644 --- a/packages/demo/db-seed.ts +++ b/packages/demo/db-seed.ts @@ -62,7 +62,7 @@ async function main() { }); const { data: persistedContacts, error: errorContacts } = await supabase .from('contacts') - .insert(contacts) + .insert(contacts.map(({ id, ...contact }) => contact)) .select(); if (errorContacts) { diff --git a/packages/demo/src/contacts/ContactInputs.tsx b/packages/demo/src/contacts/ContactInputs.tsx index 9445fbb..cfab08f 100644 --- a/packages/demo/src/contacts/ContactInputs.tsx +++ b/packages/demo/src/contacts/ContactInputs.tsx @@ -4,6 +4,7 @@ import { ReferenceInput, AutocompleteInput, BooleanInput, + required, } from 'react-admin'; import { Divider, Box } from '@mui/material'; @@ -11,15 +12,23 @@ export const ContactInputs = () => { return ( - + - + - + diff --git a/supabase/migrations/20240606161030_allow_nullable.sql b/supabase/migrations/20240606161030_allow_nullable.sql new file mode 100644 index 0000000..5261056 --- /dev/null +++ b/supabase/migrations/20240606161030_allow_nullable.sql @@ -0,0 +1,31 @@ +alter table "public"."companies" alter column "address" drop not null; +alter table "public"."companies" alter column "city" drop not null; +alter table "public"."companies" alter column "created_at" drop not null; +alter table "public"."companies" alter column "linkedIn" drop not null; +alter table "public"."companies" alter column "logo" drop not null; +alter table "public"."companies" alter column "phone_number" drop not null; +alter table "public"."companies" alter column "sales_id" drop not null; +alter table "public"."companies" alter column "sector" drop not null; +alter table "public"."companies" alter column "size" drop not null; +alter table "public"."companies" alter column "stateAbbr" drop not null; +alter table "public"."companies" alter column "website" drop not null; +alter table "public"."companies" alter column "zipcode" drop not null; +alter table "public"."contacts" alter column "acquisition" drop not null; +alter table "public"."contacts" alter column "background" drop not null; +alter table "public"."contacts" alter column "email" drop not null; +alter table "public"."contacts" alter column "first_seen" drop not null; +alter table "public"."contacts" alter column "gender" drop not null; +alter table "public"."contacts" alter column "last_seen" drop not null; +alter table "public"."contacts" alter column "phone_number1" drop not null; +alter table "public"."contacts" alter column "phone_number2" drop not null; +alter table "public"."contacts" alter column "sales_id" drop not null; +alter table "public"."contacts" alter column "status" drop not null; +alter table "public"."contacts" alter column "title" drop not null; +alter table "public"."deals" alter column "amount" drop not null; +alter table "public"."deals" alter column "contact_ids" drop not null; +alter table "public"."deals" alter column "created_at" drop not null; +alter table "public"."deals" alter column "description" drop not null; +alter table "public"."deals" alter column "sales_id" drop not null; +alter table "public"."deals" alter column "start_at" drop not null; +alter table "public"."deals" alter column "type" drop not null; +alter table "public"."deals" alter column "updated_at" drop not null; \ No newline at end of file