Skip to content
Back

AppwriteException: Invalid document structure: Missing required attribute "createdAt"

  • 0
  • Cloud
RoxGame
8 Dec, 2025, 15:23
TypeScript
        await tablesDB.createRow({
            databaseId: '***',
            tableId: '***',
            rowId: user.$id,
            data
        });

why it require createdAt attribute the docs doesn't say so

TL;DR
Developers encountered an AppwriteException regarding a missing "createdAt" attribute. It turns out the default column is auto-created if not explicitly defined. The issue was resolved by removing the unwanted columns. The root cause was not explicitly creating the default column in the table creation process defined in the code.
James
8 Dec, 2025, 15:49

data: {}

RoxGame
8 Dec, 2025, 15:51
TypeScript
export const UpdateTheme = command(UpdateThemeSchema, async (data) => {
    const user = RequireAuth();
    const { tablesDB } = getAdminServices();
    try {
        await tablesDB.upsertRow({
            databaseId,
            tableId: 'theme',
            rowId: user.$id,
            data
        });
    } catch (error) {
        console.log(error);

    }
});

am passing it correctly

Devika
8 Dec, 2025, 15:51

The createdAt is a default column which automatically gets created when you create any DB Table. Have you explicitly created any similar column and mentioned it as required somewhere in your code?

RoxGame
8 Dec, 2025, 15:51

no i didn't

RoxGame
8 Dec, 2025, 15:52
TypeScript
export const UpdateThemeSchema = v.object({
    Background: HexColor,
    Secondary: HexColor,
    FontPrimary: HexColor,
    FontSecondary: HexColor,
    Icons: HexColor,
    Shadow: HexColor
});
RoxGame
8 Dec, 2025, 15:52

this is my data Schema

RoxGame
8 Dec, 2025, 15:52

let me check the database in the console maybe it get created by mistake somehow

RoxGame
8 Dec, 2025, 15:53
RoxGame
8 Dec, 2025, 15:53

hmm that is weird i didn't create them!

RoxGame
8 Dec, 2025, 15:53

but they exist somehow

RoxGame
8 Dec, 2025, 15:54

Thank you for helping

Devika
8 Dec, 2025, 15:55

Look! Here's the exact reason behind your issue in your screenshot itself

RoxGame
8 Dec, 2025, 15:56

yes it worked after i removed them

RoxGame
8 Dec, 2025, 15:56

createdAt and updatedAT

RoxGame
8 Dec, 2025, 15:56

but am not sure how they got created

Devika
8 Dec, 2025, 15:56

Great! Glad your problem is solved 😊

RoxGame
8 Dec, 2025, 15:57

Thank you @Devika

Devika
8 Dec, 2025, 15:58

How exactly you created the columns for this table?

Devika
8 Dec, 2025, 15:58

Anytime!

RoxGame
8 Dec, 2025, 15:58

manually from the dashboard

Devika
8 Dec, 2025, 15:59

Then you might've mistakenly created them. No worries. At least your issue is resolved now 👍🏻

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more