Docs
Database
Database
How to config your Neon database.
This project uses DynamoDB.
Steps
Create AWS account
If you don’t have an AWS account or haven’t configured Amplify yet, go to the Authentication step.
Database schema
You can find the database schema in the amplify/data/resource.ts file. If you want to add more tables, simply define them in this file.
const schema = a
.schema({
// =================================
// Schema dedicated for template
// =================================
Users: a
.model({
userId: a.id().required(),
stripe_customer_id: a.string(),
stripe_subscription_id: a.string(),
stripe_price_id: a.string(),
stripe_current_period_end: a.datetime(),
coins: a.float(),
marketing_mails_accepted: a.boolean().default(false),
privacy_policy_accepted: a.boolean().default(false),
})
.identifier(['userId'])
.authorization((allow) => [allow.ownerDefinedIn('userId')]),
// =================================
// Schema dedicated for application
// Add your custom models here
// =================================
})
.authorization((allow) => [allow.authenticated()]);Update database
When you deploy new version on AWS Amplify it automatically updates your database schema.