[Solved] AppwriteException: Invalid document structure: Missing required attribute "createdAt"
- 0
- Resolved
- 2
- Cloud
await tablesDB.createRow({
databaseId: '***',
tableId: '***',
rowId: user.$id,
data
});
why it require createdAt attribute the docs doesn't say so
data: {}
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
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?
no i didn't
export const UpdateThemeSchema = v.object({
Background: HexColor,
Secondary: HexColor,
FontPrimary: HexColor,
FontSecondary: HexColor,
Icons: HexColor,
Shadow: HexColor
});
this is my data Schema
let me check the database in the console maybe it get created by mistake somehow
hmm that is weird i didn't create them!
but they exist somehow
Thank you for helping
Look! Here's the exact reason behind your issue in your screenshot itself
yes it worked after i removed them
createdAt and updatedAT
but am not sure how they got created
Great! Glad your problem is solved 😊
Thank you @Devika
How exactly you created the columns for this table?
Anytime!
manually from the dashboard
Then you might've mistakenly created them. No worries. At least your issue is resolved now 👍🏻
yes probably i did something wrong that lead to creation of them
Please mark this post as SOLVED since your issue is resolved now
Recommended threads
- Error With iOS Apps
I keep getting the below errors for my flutter app. The clients are registered and have been. This wasn't an issue a few hours ago. AppwriteException: AppwriteE...
- Backup policies think im on free tier
Cant create more than one policy as im told to ugprade, when clicking upgrade im taken to the upgrade page which confirms im already on pro
- Cant get rid of "get started"
Not that important, but annoying. No matter what I do I cant get the "Get started" to go away, ive added a bunch of web platforms and its just stuck.