hardyscc / nestjs-dynamoose

Dynamoose module for Nest
MIT License
139 stars 24 forks source link

Adding migration #897

Closed ThienNDDi closed 1 year ago

ThienNDDi commented 1 year ago

I'm submitting a new feature which can create migration for dynamodb.

right now i have to insert a data if i wanna create table. Or may i missing it, can anyone help me to explain what i missed or i did wrong?


[X] Feature request

Environment


NestJS version: 10.1.10
NestJS Dynamoose version: 0.5.5
Dynamoose version: 3.2.0


For Tooling issues:
- Node version: v18.12.1 
- Platform:   Mac


hardyscc commented 1 year ago

you should:

  1. set the table create to false
  2. run npm run genres to generate the resources/dynamodb.yml from schemas
  3. finally link it as a resources to your serverless.yaml
    DynamooseModule.forRoot({
      table: {
        create: false,
      },
    }),

please can refer to https://github.com/hardyscc/aws-nestjs-starter