#Imported table auto increment

1 messages · Page 1 of 1 (latest)

granite plinth
#

I imported a new table into my Directus 9. It imported correctly and PGSQL shows the key and default value appears right (nextval('notes_id_seq'::regclass)) -- field name is ID.

But, when I attempt to create a new row in Directus, it balks and says the ID field isn't filled in. Is there somewhere in Directus I have to set for it to see that as auto-increment? I can't "change" the id column that exists there to be auto increment, it shows as primary key but just integer.

sinful merlinBOT
#

Thanks for posting! This is a community powered server, so you may or may not get an answer based on available help and expertise. To increase your chances of somebody being able to help you, please make sure your question includes the following:

  • An explanation of exactly what you're trying to achieve.
  • Any and all related code or previous attempts.
  • The exact issue or error you are facing.
  • Any screenshots if applicable.

When you're done with this thread, please close it.

(If you have a support agreement and need help, please contact the core team via email.)

granite plinth
#

An update to this - after some more digging, it appears the error is actually masking something more complex - this table has a Many to Many relationship with another table (junction table). Viewing the records for the imported tables works well. Creating a NEW item in the initial table with no selection in the many to many relationship succeeds. It's only when one or more items are selected in the related table when the error appears. Checking the junction table appears to have auto increment selected correctly in PGSQL, so I'm not sure why it's failing to create the junction record.