A regex that stops at the first brace loses the next model as soon as @relation brings its own parentheses. The parser tracks brace, string, and comment depth, so enums, fields, and the following model stay intact.
The arrow and onDelete
The arrow starts on the side whose @relation has fields. The back-relation Post[] does not draw a second arrow. onDelete is shown as written: Cascade, Restrict, or not set. Restrict stays a valid choice and does not raise its own warning.
An index on the foreign key
The warning appears when fields are not a leading @@index, @@unique, or @@id, and are not marked @id or @unique. An index that starts with a different column does not cover the key.
@@index([createdAt, authorId])
@@index([authorId])The first index does not cover authorId. The second one does. String @default(uuid()) without @db.Uuid is marked on its own: Postgres indexes a native uuid better.